work save

This commit is contained in:
royqh1979@gmail.com 2021-12-13 12:09:37 +08:00
parent 2de2f1e162
commit 0e0689ad64
4 changed files with 21 additions and 1 deletions

View File

@ -38,6 +38,8 @@ bool WindowLogoutEventFilter::nativeEventFilter(const QByteArray & /*eventType*/
} }
return true; return true;
} }
} else if (pMsg->message == WM_DPICHANGED) {
qDebug()<<"app dpi changed!";
} }
return false; return false;
} }
@ -77,6 +79,7 @@ QString getSettingFilename(const QString& filepath = QString()) {
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
//QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication app(argc, argv); QApplication app(argc, argv);
//Translation must be loaded first //Translation must be loaded first

View File

@ -653,6 +653,7 @@ protected:
void closeEvent(QCloseEvent *event) override; void closeEvent(QCloseEvent *event) override;
void showEvent(QShowEvent* event) override; void showEvent(QShowEvent* event) override;
void hideEvent(QHideEvent *event) override; void hideEvent(QHideEvent *event) override;
}; };
extern MainWindow* pMainWindow; extern MainWindow* pMainWindow;

View File

@ -6261,7 +6261,19 @@ void SynEdit::dragLeaveEvent(QDragLeaveEvent *)
// setCaretXY(mDragCaretSave); // setCaretXY(mDragCaretSave);
// setBlockBegin(mDragSelBeginSave); // setBlockBegin(mDragSelBeginSave);
// setBlockEnd(mDragSelEndSave); // setBlockEnd(mDragSelEndSave);
// showCaret(); // showCaret();
}
bool SynEdit::nativeEvent(const QByteArray &eventType, void *message, long *result)
{
#ifdef Q_OS_WIN
MSG* msg = (MSG*)message;
if (msg && msg->message == WM_DPICHANGED) {
qDebug()<<"dpi changed!";
synFontChanged();
}
#endif
return QAbstractScrollArea::nativeEvent(eventType,message,result);
} }
int SynEdit::maxScrollHeight() const int SynEdit::maxScrollHeight() const

View File

@ -737,6 +737,10 @@ void dragEnterEvent(QDragEnterEvent *event) override;
void dropEvent(QDropEvent *event) override; void dropEvent(QDropEvent *event) override;
void dragMoveEvent(QDragMoveEvent *event) override; void dragMoveEvent(QDragMoveEvent *event) override;
void dragLeaveEvent(QDragLeaveEvent *event) override; void dragLeaveEvent(QDragLeaveEvent *event) override;
// QWidget interface
protected:
bool nativeEvent(const QByteArray &eventType, void *message, long *result) override;
}; };
#endif // SYNEDIT_H #endif // SYNEDIT_H