You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
790 B
43 lines
790 B
#ifndef WEBAPP_H
|
|
#define WEBAPP_H
|
|
|
|
#include <QMainWindow>
|
|
#include <QWebEngineView>
|
|
#include <iostream>
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
namespace Ui { class WebApp; }
|
|
QT_END_NAMESPACE
|
|
|
|
class WebApp : public QMainWindow
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
WebApp(QWidget *parent = nullptr);
|
|
void setPath(QString _appPathl);
|
|
~WebApp();
|
|
|
|
private:
|
|
Ui::WebApp *ui;
|
|
QWebEngineView *mView;
|
|
QString appPath;
|
|
QUrl _lastUrl;
|
|
void SetUrl();
|
|
private Q_SLOTS:
|
|
void onUrlChanged(const QUrl & url){
|
|
if (url == QUrl("file://"+appPath+"/but1"))
|
|
{
|
|
qWarning("Нажал 1");
|
|
SetUrl();
|
|
}
|
|
|
|
if (url == QUrl("file://"+appPath+"/but2"))
|
|
{
|
|
qWarning("Нажал 2");
|
|
SetUrl();
|
|
}
|
|
|
|
}
|
|
};
|
|
#endif // WEBAPP_H
|
|
|