From 326b25e1dde9e8145eacf618802fe109016ba40e Mon Sep 17 00:00:00 2001 From: dreamsourcelabTAI Date: Fri, 5 Jan 2024 15:12:49 +0800 Subject: [PATCH] remove DsComboBox --- DSView/pv/mainframe.cpp | 18 +++++++++--------- DSView/pv/ui/dscombobox.cpp | 9 +++++++++ DSView/pv/ui/dscombobox.h | 9 ++++++++- 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/DSView/pv/mainframe.cpp b/DSView/pv/mainframe.cpp index 5aa633bc..a32418fd 100644 --- a/DSView/pv/mainframe.cpp +++ b/DSView/pv/mainframe.cpp @@ -222,8 +222,8 @@ void MainFrame::showMaximized() if (sk >= 1.5) { auto rect = QGuiApplication::primaryScreen()->availableGeometry(); - this->move(rect.left(), rect.top()); - this->resize(rect.width(), rect.height()); + // this->move(rect.left(), rect.top()); + //this->resize(rect.width(), rect.height()); } #endif @@ -292,13 +292,13 @@ bool MainFrame::eventFilter(QObject *object, QEvent *event) if (type == QEvent::MouseMove) { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) - int x0 = (int)mouse_event->globalPosition().x(); - int y0 = (int)mouse_event->globalPosition().y(); -#else - int x0 = mouse_event->globalX(); - int y0 = mouse_event->globalY(); -#endif + #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + int x0 = (int)mouse_event->globalPosition().x(); + int y0 = (int)mouse_event->globalPosition().y(); + #else + int x0 = mouse_event->globalX(); + int y0 = mouse_event->globalY(); + #endif if(mouse_event->buttons().testFlag(Qt::LeftButton)) { if (!_freezing) { diff --git a/DSView/pv/ui/dscombobox.cpp b/DSView/pv/ui/dscombobox.cpp index d1ca0194..62a5238d 100644 --- a/DSView/pv/ui/dscombobox.cpp +++ b/DSView/pv/ui/dscombobox.cpp @@ -20,6 +20,14 @@ */ +#include "dscombobox.h" + +DsComboBox::DsComboBox(QWidget *parent) + : QComboBox(parent) +{ +} + +/* #include "dscombobox.h" #include #include @@ -92,3 +100,4 @@ DsComboBox::DsComboBox(QWidget *parent) : QComboBox(parent) _bPopup = false; } +*/ \ No newline at end of file diff --git a/DSView/pv/ui/dscombobox.h b/DSView/pv/ui/dscombobox.h index cb3f7876..0b4acb51 100644 --- a/DSView/pv/ui/dscombobox.h +++ b/DSView/pv/ui/dscombobox.h @@ -25,6 +25,13 @@ #include #include +class DsComboBox : public QComboBox +{ +public: + explicit DsComboBox(QWidget *parent = nullptr); +}; + +/* class DsComboBox : public QComboBox { Q_OBJECT @@ -47,7 +54,7 @@ private: int _contentWidth; bool _bPopup; }; - +*/ #endif // DSCOMBOBOX_H