zcy 2021-11-18 10:39:37 +08:00
commit 58d67597cc
2 changed files with 5 additions and 5 deletions

View File

@ -92,7 +92,6 @@ QssTtitleBar::QssTtitleBar(QWidget *parent ,
QFile file(":/qss/css/QssTitleBar.css"); QFile file(":/qss/css/QssTitleBar.css");
if (!file.open(QIODevice::ReadOnly)){ if (!file.open(QIODevice::ReadOnly)){
qDebug()<<"error bar"; qDebug()<<"error bar";
exit(0);
} }
QTextStream in(&file); QTextStream in(&file);
QString css = in.readAll(); QString css = in.readAll();
@ -279,7 +278,6 @@ QssMainWindow::QssMainWindow(QWidget *parent/* = 0*/, Qt::WindowFlags flags/* =
QFile file(":/qss/css/QssMainWindow.css"); QFile file(":/qss/css/QssMainWindow.css");
if (!file.open(QIODevice::ReadOnly)){ if (!file.open(QIODevice::ReadOnly)){
qDebug()<<"error bar"; qDebug()<<"error bar";
exit(0);
} }
QTextStream in(&file); QTextStream in(&file);
QString css = in.readAll(); QString css = in.readAll();
@ -415,7 +413,7 @@ int QssMainWindow::CalCursorCol(QPoint pt)
} }
void QssMainWindow::onMouseMoveEvent( QMouseEvent * ev ) void QssMainWindow::onMouseMoveEvent(QMouseEvent * ev)
{ {
if (m_titleBar->maxOrRestore()) if (m_titleBar->maxOrRestore())
{ {
@ -588,7 +586,7 @@ bool QssMainWindow::eventFilter(QObject * obj, QEvent * ev){
} }
else if (obj == m_titleBar) 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) if (ev->type() == QEvent::Enter)
{ {
m_left = false; m_left = false;
@ -816,7 +814,7 @@ void QssDialog::onMouseMoveEvent( QMouseEvent * ev )
rc.setTop(rc.top() + dy); rc.setTop(rc.top() + dy);
if (m_bottom) if (m_bottom)
rc.setBottom(rc.bottom() + dy); rc.setBottom(rc.bottom() + dy);
qDebug()<<"onMouseMoveEvent"<<rc;
m_frame->setGeometry(rc); m_frame->setGeometry(rc);
mFrameRect = rc; mFrameRect = rc;
m_pos = ev->globalPos(); m_pos = ev->globalPos();

2
Qss.h
View File

@ -26,7 +26,9 @@ class QPushButton;
class QLabel; class QLabel;
class QMouseEvent; class QMouseEvent;
#define STANDARD_DPI 96.0 #define STANDARD_DPI 96.0
#ifndef WM_DPICHANGED
#define WM_DPICHANGED 0x02e0 #define WM_DPICHANGED 0x02e0
#endif
typedef enum{ typedef enum{