UI: Fix build for Qt 5.

This commit is contained in:
Nodir Temirkhodjaev 2021-04-07 11:21:23 +03:00
parent 1f73f0795e
commit b10340c394
3 changed files with 12 additions and 1 deletions

View File

@ -164,7 +164,9 @@ class QCP { // when in moc-run, make it look like a class, so we get Q_GADGET, Q
Q_ENUMS(SelectionRectMode)
Q_ENUMS(SelectionType)
public:
#endif
#if QT_VERSION < QT_VERSION_CHECK(6, 2, 0)
extern const QMetaObject staticMetaObject; // in moc-run we create a static meta object for QCP "fake" object. This line is the link to it via QCP::staticMetaObject in normal operation as namespace
#endif

View File

@ -75,7 +75,9 @@ void MainPage::setupTabBar()
m_tabBar->addTab(statisticsPage, IconCache::icon(":/icons/database.png"), QString());
m_tabBar->addTab(schedulePage, IconCache::icon(":/icons/clock.png"), QString());
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
m_tabBar->setTabVisible(2, false); // TODO: Impl. Network Rules
#endif
}
QLayout *MainPage::setupDialogButtons()

View File

@ -16,7 +16,14 @@ bool HotKeyManager::addAction(QAction *action, const QKeySequence &shortcut)
{
const int hotKeyId = m_actions.size();
if (!m_nativeEventFilter->registerHotKey(hotKeyId, shortcut[0]))
const auto keyCombination = shortcut[0];
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
const int key = keyCombination;
#else
const int key = keyCombination.toCombined();
#endif
if (!m_nativeEventFilter->registerHotKey(hotKeyId, key))
return false;
action->setText(action->text() + '\t' + shortcut.toString());