diff options
Diffstat (limited to 'src/shared')
-rw-r--r-- | src/shared/help/indexwindow.cpp | 2 | ||||
-rw-r--r-- | src/shared/proparser/proitems.cpp | 5 | ||||
-rw-r--r-- | src/shared/qtcreator_pch.h | 6 | ||||
-rw-r--r-- | src/shared/qtsingleapplication/qtsingleapplication.cpp | 14 |
4 files changed, 14 insertions, 13 deletions
diff --git a/src/shared/help/indexwindow.cpp b/src/shared/help/indexwindow.cpp index 36712d85936..3c6a7949e5f 100644 --- a/src/shared/help/indexwindow.cpp +++ b/src/shared/help/indexwindow.cpp @@ -78,7 +78,7 @@ IndexWindow::IndexWindow() connect(m_indexWidget, &Utils::NavigationTreeView::activated, this, [this](const QModelIndex &index) { open(index); }); connect(m_searchLineEdit, &QLineEdit::returnPressed, - m_indexWidget, [this]() { open(m_indexWidget->currentIndex()); }); + m_indexWidget, [this] { open(m_indexWidget->currentIndex()); }); layout->addWidget(m_indexWidget); m_indexWidget->viewport()->installEventFilter(this); diff --git a/src/shared/proparser/proitems.cpp b/src/shared/proparser/proitems.cpp index 4a5108f9253..57b894396f6 100644 --- a/src/shared/proparser/proitems.cpp +++ b/src/shared/proparser/proitems.cpp @@ -223,14 +223,9 @@ ProString &ProString::append(const ProStringList &other, bool *pending, bool ski if (!m_length && sz == startIdx + 1) { *this = other.at(startIdx); } else { - int totalLength = sz - startIdx; - for (int i = startIdx; i < sz; ++i) - totalLength += other.at(i).size(); bool putSpace = false; if (pending && !*pending && m_length) putSpace = true; - else - totalLength--; m_string = toQString(); m_offset = 0; diff --git a/src/shared/qtcreator_pch.h b/src/shared/qtcreator_pch.h index 8684cf59415..e9488230b9f 100644 --- a/src/shared/qtcreator_pch.h +++ b/src/shared/qtcreator_pch.h @@ -18,11 +18,11 @@ #undef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN -// lib/Utils needs defines for Windows 8 +// Minimum requirement for Qt 6, and therefore Creator is Windows 10 #undef WINVER -#define WINVER 0x0602 +#define WINVER 0x0A00 #undef _WIN32_WINNT -#define _WIN32_WINNT 0x0602 +#define _WIN32_WINNT 0x0A00 #define NOHELP #include <qt_windows.h> diff --git a/src/shared/qtsingleapplication/qtsingleapplication.cpp b/src/shared/qtsingleapplication/qtsingleapplication.cpp index c38d568004c..6bfdc0edfa4 100644 --- a/src/shared/qtsingleapplication/qtsingleapplication.cpp +++ b/src/shared/qtsingleapplication/qtsingleapplication.cpp @@ -11,6 +11,8 @@ #include <QSharedMemory> #include <QWidget> +using namespace std::chrono; + namespace SharedTools { static const int instancesSize = 1024; @@ -179,16 +181,19 @@ public: : QtSingleApplication(id, argc, argv) , m_align(21, QChar::Space) {} - void setFreezeTreshold(std::chrono::milliseconds freezeAbove) { m_threshold = freezeAbove; } + void setFreezeTreshold(milliseconds freezeAbove) { m_threshold = freezeAbove; } bool notify(QObject *receiver, QEvent *event) override { - using namespace std::chrono; + if (m_inNotify) + return QtSingleApplication::notify(receiver, event); const auto start = system_clock::now(); const QPointer<QObject> p(receiver); const QString className = QLatin1String(receiver->metaObject()->className()); const QString name = receiver->objectName(); + m_inNotify = true; const bool ret = QtSingleApplication::notify(receiver, event); + m_inNotify = false; const auto end = system_clock::now(); const auto freeze = duration_cast<milliseconds>(end - start); @@ -207,8 +212,9 @@ public: } private: + bool m_inNotify = false; const QString m_align; - std::chrono::milliseconds m_threshold = std::chrono::milliseconds(100); + milliseconds m_threshold{100}; }; QtSingleApplication *createApplication(const QString &id, int &argc, char **argv) @@ -222,7 +228,7 @@ QtSingleApplication *createApplication(const QString &id, int &argc, char **argv qDebug() << "Change the freeze detection threshold by setting the" << s_freezeDetector << "env var to a different numeric value (in ms)."; ApplicationWithFreezerDetector *app = new ApplicationWithFreezerDetector(id, argc, argv); - app->setFreezeTreshold(std::chrono::milliseconds(*freezeDetector)); + app->setFreezeTreshold(milliseconds(*freezeDetector)); return app; } |