From 315687fd6c7bf9707386c96854dd0a8a96fc7a37 Mon Sep 17 00:00:00 2001 From: zcy <290198252@qq.com> Date: Tue, 5 Oct 2021 13:50:16 +0800 Subject: [PATCH 1/2] no message --- Qss.cpp | 2 -- Qss.h | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Qss.cpp b/Qss.cpp index 41dea73..d051a1d 100644 --- a/Qss.cpp +++ b/Qss.cpp @@ -91,7 +91,6 @@ QssTtitleBar::QssTtitleBar(QWidget *parent , QFile file(":/qss/css/QssTitleBar.css"); if (!file.open(QIODevice::ReadOnly)){ qDebug()<<"error bar"; - exit(0); } QTextStream in(&file); QString css = in.readAll(); @@ -278,7 +277,6 @@ QssMainWindow::QssMainWindow(QWidget *parent/* = 0*/, Qt::WindowFlags flags/* = QFile file(":/qss/css/QssMainWindow.css"); if (!file.open(QIODevice::ReadOnly)){ qDebug()<<"error bar"; - exit(0); } QTextStream in(&file); QString css = in.readAll(); diff --git a/Qss.h b/Qss.h index 6489ae0..4e69c5b 100644 --- a/Qss.h +++ b/Qss.h @@ -26,7 +26,9 @@ class QPushButton; class QLabel; class QMouseEvent; #define STANDARD_DPI 96.0 +#ifndef WM_DPICHANGED #define WM_DPICHANGED 0x02e0 +#endif typedef enum{ From e6eaef4a2c49fbfc3a8766836093f210cda02f1b Mon Sep 17 00:00:00 2001 From: 18650180552 Date: Wed, 27 Oct 2021 10:38:39 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E9=AB=98dpi=E4=B8=8B=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=E5=8D=A1=E9=A1=BF=E5=8E=9F=E5=9B=A0=E6=89=BE?= =?UTF-8?q?=E5=88=B0=20//=20=20=20=20=20=20=20=20QCoreApplication::sendEve?= =?UTF-8?q?nt(this,new=20QEvent(QEvent::Type::Resize));?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Qss.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Qss.cpp b/Qss.cpp index f4b628c..c7f02df 100644 --- a/Qss.cpp +++ b/Qss.cpp @@ -413,7 +413,7 @@ int QssMainWindow::CalCursorCol(QPoint pt) } -void QssMainWindow::onMouseMoveEvent( QMouseEvent * ev ) +void QssMainWindow::onMouseMoveEvent(QMouseEvent * ev) { if (m_titleBar->maxOrRestore()) { @@ -586,7 +586,7 @@ bool QssMainWindow::eventFilter(QObject * obj, QEvent * ev){ } else if (obj == m_titleBar) { - QCoreApplication::sendEvent(this,new QEvent(QEvent::Type::Resize)); +// QCoreApplication::sendEvent(this,new QEvent(QEvent::Type::Resize)); if (ev->type() == QEvent::Enter) { m_left = false; @@ -814,7 +814,7 @@ void QssDialog::onMouseMoveEvent( QMouseEvent * ev ) rc.setTop(rc.top() + dy); if (m_bottom) rc.setBottom(rc.bottom() + dy); - + qDebug()<<"onMouseMoveEvent"<setGeometry(rc); mFrameRect = rc; m_pos = ev->globalPos();