加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
mainwindow.h 2.07 KB
一键复制 编辑 原始数据 按行查看 历史
vincentman 提交于 2018-01-18 11:46 . 修改不能下载的bug
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QWebEngineView>
#include <QWebEngineSettings>
#include <QWebEngineProfile>
#include <QWheelEvent>
#include <QVBoxLayout>
#include <QAction>
#include <QMenu>
#include <QSystemTrayIcon> //用于系统图标
#include <QContextMenuEvent> //用于托盘菜单实现
#include <QUrl>
#include <QIcon>
#include <QMessageBox>
#include <QLineEdit> //网页查找功能
#include <QToolButton>
#include <chrono>
#include <thread>
#include <QFileDialog>
#include "webengineview.h"
#include "confighelper.h"
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
Q_SLOT void onFullScreen();
Q_SLOT void onExitFullScreen();
Q_SLOT void onResetZoom();
Q_SLOT void onFindText();
void createActions();
void createMenu();
WebEngineView * createView();
protected slots:
void closeEvent( QCloseEvent * event );
void on_showMainAction();
void on_exitAppAction();
void on_activatedSysTrayIcon(QSystemTrayIcon::ActivationReason reason);
void resizeEvent(QResizeEvent *);
void wheelEvent(QWheelEvent *event);
void clickButton();
void downloadRequested(QWebEngineDownloadItem* download);
private:
int m_flag{0};
bool m_isHide{false};
double m_zoomScale{1.0};
QString m_configPath{"/opt/ydnote/setting.ini"};
QString m_zoomKey{"zoomScale"};
QString m_site{"https://note.youdao.com/"
"signIn/"
"index.html?&callback=https%3A%2F%2Fnote.youdao.com%2Fweb%2F&from=web"};
Ui::MainWindow *m_pUi;
WebEngineView *m_pView{nullptr};
QSystemTrayIcon *m_pSysTrayIcon{nullptr};
QMenu *m_pMenu{nullptr};
QVBoxLayout *m_pLayout{nullptr};
QAction *m_pShowMainAction{nullptr};
QAction *m_pExitAppAction{nullptr};
QAction *m_pEscAct;
QAction *m_pResetZoom{nullptr};
QAction *m_pLookup{nullptr};
QLineEdit *m_pFindEdit{nullptr};
QToolButton *m_pButton{nullptr};
};
#endif // MAINWINDOW_H
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化