diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a38c247e..16485caab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,7 +29,7 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOUIC ON) set(CMAKE_AUTORCC ON) -set(REQUIRED_QT_VERSION "5.12") +set(REQUIRED_QT_VERSION "5.15.0") set(KF5_MINIMUM_VERSION "5.36.0") set(LXQT_GLOBALKEYS_MINIMUM_VERSION "0.17.0") set(LXQT_MINIMUM_VERSION "0.17.0") diff --git a/panel/config/addplugindialog.cpp b/panel/config/addplugindialog.cpp index cb0899a23..5c461f474 100644 --- a/panel/config/addplugindialog.cpp +++ b/panel/config/addplugindialog.cpp @@ -49,11 +49,7 @@ AddPluginDialog::AddPluginDialog(QWidget *parent): ui->setupUi(this); QStringList desktopFilesDirs; -#if (QT_VERSION >= QT_VERSION_CHECK(5,15,0)) desktopFilesDirs << QString::fromLocal8Bit(qgetenv("LXQT_PANEL_PLUGINS_DIR")).split(QLatin1Char(':'), Qt::SkipEmptyParts); -#else - desktopFilesDirs << QString::fromLocal8Bit(qgetenv("LXQT_PANEL_PLUGINS_DIR")).split(QLatin1Char(':'), QString::SkipEmptyParts); -#endif desktopFilesDirs << QStringLiteral("%1/%2").arg(XdgDirs::dataHome(), QStringLiteral("/lxqt/lxqt-panel")); desktopFilesDirs << QStringLiteral(PLUGIN_DESKTOPS_DIR); diff --git a/panel/lxqtpanel.cpp b/panel/lxqtpanel.cpp index 324c4460d..1598c5efa 100644 --- a/panel/lxqtpanel.cpp +++ b/panel/lxqtpanel.cpp @@ -430,11 +430,7 @@ void LXQtPanel::show() QStringList pluginDesktopDirs() { QStringList dirs; -#if (QT_VERSION >= QT_VERSION_CHECK(5,15,0)) dirs << QString::fromLocal8Bit(qgetenv("LXQT_PANEL_PLUGINS_DIR")).split(QLatin1Char(':'), Qt::SkipEmptyParts); -#else - dirs << QString::fromLocal8Bit(qgetenv("LXQT_PANEL_PLUGINS_DIR")).split(QLatin1Char(':'), QString::SkipEmptyParts); -#endif dirs << QStringLiteral("%1/%2").arg(XdgDirs::dataHome(), QStringLiteral("/lxqt/lxqt-panel")); dirs << QStringLiteral(PLUGIN_DESKTOPS_DIR); return dirs; @@ -1127,11 +1123,7 @@ bool LXQtPanel::event(QEvent *event) // Sometimes Qt needs to re-create the underlying window of the widget and // the winId() may be changed at runtime. So we need to reset all X11 properties // when this happens. - #if (QT_VERSION >= QT_VERSION_CHECK(5,14,0)) qDebug() << "WinIdChange" << Qt::hex << effectiveWinId() << "handle" << windowHandle() << windowHandle()->screen(); - #else - qDebug() << "WinIdChange" << hex << effectiveWinId() << "handle" << windowHandle() << windowHandle()->screen(); - #endif // Qt::WA_X11NetWmWindowTypeDock becomes ineffective in Qt 5 // See QTBUG-39887: https://bugreports.qt-project.org/browse/QTBUG-39887 diff --git a/panel/panelpluginsmodel.cpp b/panel/panelpluginsmodel.cpp index a614656bf..40d015fcf 100644 --- a/panel/panelpluginsmodel.cpp +++ b/panel/panelpluginsmodel.cpp @@ -319,11 +319,7 @@ void PanelPluginsModel::onMovePluginUp(QModelIndex const & index) return; //can't move up beginMoveRows(QModelIndex(), row, row, QModelIndex(), row - 1); -#if (QT_VERSION >= QT_VERSION_CHECK(5,13,0)) mPlugins.swapItemsAt(row - 1, row); -#else - mPlugins.swap(row - 1, row); -#endif endMoveRows(); pluginslist_t::const_reference moved_plugin = mPlugins[row - 1]; pluginslist_t::const_reference prev_plugin = mPlugins[row]; @@ -346,11 +342,7 @@ void PanelPluginsModel::onMovePluginDown(QModelIndex const & index) return; //can't move down beginMoveRows(QModelIndex(), row, row, QModelIndex(), row + 2); -#if (QT_VERSION >= QT_VERSION_CHECK(5,13,0)) mPlugins.swapItemsAt(row, row + 1); -#else - mPlugins.swap(row, row + 1); -#endif endMoveRows(); pluginslist_t::const_reference moved_plugin = mPlugins[row + 1]; pluginslist_t::const_reference next_plugin = mPlugins[row]; diff --git a/plugin-desktopswitch/desktopswitch.cpp b/plugin-desktopswitch/desktopswitch.cpp index e1a70523c..13a050929 100644 --- a/plugin-desktopswitch/desktopswitch.cpp +++ b/plugin-desktopswitch/desktopswitch.cpp @@ -54,11 +54,7 @@ DesktopSwitch::DesktopSwitch(const ILXQtPanelPluginStartupInfo &startupInfo) : { m_buttons = new QButtonGroup(this); -#if (QT_VERSION >= QT_VERSION_CHECK(5,15,0)) connect (m_pSignalMapper, &QSignalMapper::mappedInt, this, &DesktopSwitch::setDesktop); -#else - connect (m_pSignalMapper, QOverload::of(&QSignalMapper::mapped), this, &DesktopSwitch::setDesktop); -#endif mLayout = new LXQt::GridLayout(&mWidget); @@ -69,14 +65,7 @@ DesktopSwitch::DesktopSwitch(const ILXQtPanelPluginStartupInfo &startupInfo) : onCurrentDesktopChanged(KWindowSystem::currentDesktop()); QTimer::singleShot(0, this, SLOT(registerShortcuts())); -#if (QT_VERSION >= QT_VERSION_CHECK(5,15,0)) connect(m_buttons, &QButtonGroup::idClicked, this, &DesktopSwitch::setDesktop); -#else - connect(m_buttons, QOverload::of(&QButtonGroup::buttonClicked), this, [=](QAbstractButton * /*button*/){ - int id = m_buttons->checkedId(); - setDesktop(id); - }); -#endif connect(KWindowSystem::self(), &KWindowSystem::numberOfDesktopsChanged, this, &DesktopSwitch::onNumberOfDesktopsChanged); connect(KWindowSystem::self(), &KWindowSystem::currentDesktopChanged, this, &DesktopSwitch::onCurrentDesktopChanged); diff --git a/plugin-directorymenu/directorymenu.cpp b/plugin-directorymenu/directorymenu.cpp index 79f068daa..494abd4c5 100644 --- a/plugin-directorymenu/directorymenu.cpp +++ b/plugin-directorymenu/directorymenu.cpp @@ -54,16 +54,9 @@ DirectoryMenu::DirectoryMenu(const ILXQtPanelPluginStartupInfo &startupInfo) : connect(&mButton, &QToolButton::clicked, this, &DirectoryMenu::showMenu); -#if (QT_VERSION >= QT_VERSION_CHECK(5,15,0)) connect(mOpenDirectorySignalMapper, &QSignalMapper::mappedString, this, &DirectoryMenu::openDirectory); connect(mOpenTerminalSignalMapper, &QSignalMapper::mappedString, this, &DirectoryMenu::openInTerminal); connect(mMenuSignalMapper, &QSignalMapper::mappedString, this, &DirectoryMenu::addMenu); -#else - connect(&mButton, SIGNAL(clicked()), this, SLOT(showMenu())); - connect(mOpenDirectorySignalMapper, SIGNAL(mapped(QString)), this, SLOT(openDirectory(QString))); - connect(mOpenTerminalSignalMapper, SIGNAL(mapped(QString)), this, SLOT(openInTerminal(QString))); - connect(mMenuSignalMapper, SIGNAL(mapped(QString)), this, SLOT(addMenu(QString))); -#endif settingsChanged(); } @@ -131,19 +124,11 @@ void DirectoryMenu::addActions(QMenu* menu, const QString& path) mPathStrings.push_back(path); QAction* openDirectoryAction = menu->addAction(XdgIcon::fromTheme(QStringLiteral("folder")), tr("Open")); -#if (QT_VERSION >= QT_VERSION_CHECK(5,15,0)) connect(openDirectoryAction, &QAction::triggered, mOpenDirectorySignalMapper, [this] { mOpenDirectorySignalMapper->map(); } ); -#else - connect(openDirectoryAction, SIGNAL(triggered()), mOpenDirectorySignalMapper, SLOT(map())); -#endif mOpenDirectorySignalMapper->setMapping(openDirectoryAction, mPathStrings.back()); QAction* openTerminalAction = menu->addAction(XdgIcon::fromTheme(QStringLiteral("folder")), tr("Open in terminal")); -#if (QT_VERSION >= QT_VERSION_CHECK(5,15,0)) connect(openTerminalAction, &QAction::triggered, mOpenTerminalSignalMapper, [this] { mOpenTerminalSignalMapper->map(); } ); -#else - connect(openTerminalAction, SIGNAL(triggered()), mOpenTerminalSignalMapper, SLOT(map())); -#endif mOpenTerminalSignalMapper->setMapping(openTerminalAction, mPathStrings.back()); menu->addSeparator(); @@ -159,11 +144,7 @@ void DirectoryMenu::addActions(QMenu* menu, const QString& path) QMenu* subMenu = menu->addMenu(XdgIcon::fromTheme(QStringLiteral("folder")), mPathStrings.back()); -#if (QT_VERSION >= QT_VERSION_CHECK(5,15,0)) connect(subMenu, &QMenu::aboutToShow, mMenuSignalMapper, [this] { mMenuSignalMapper->map(); } ); -#else - connect(subMenu, SIGNAL(aboutToShow()), mMenuSignalMapper, SLOT(map())); -#endif mMenuSignalMapper->setMapping(subMenu, entry.absoluteFilePath()); } } diff --git a/plugin-quicklaunch/lxqtquicklaunch.cpp b/plugin-quicklaunch/lxqtquicklaunch.cpp index d325a6dc8..c3f2ce81d 100644 --- a/plugin-quicklaunch/lxqtquicklaunch.cpp +++ b/plugin-quicklaunch/lxqtquicklaunch.cpp @@ -198,13 +198,8 @@ void LXQtQuickLaunch::dropEvent(QDropEvent *e) return; } -#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0)) const auto & urls = e->mimeData()->urls(); for (const QUrl &url : QSet{urls.cbegin(), urls.cend()}) -#else - const auto urls = e->mimeData()->urls().toSet(); - for (const QUrl &url : urls) -#endif { QString fileName(url.isLocalFile() ? url.toLocalFile() : url.url()); QFileInfo fi(fileName); diff --git a/plugin-quicklaunch/quicklaunchaction.cpp b/plugin-quicklaunch/quicklaunchaction.cpp index 830b67cb7..fc445f64f 100644 --- a/plugin-quicklaunch/quicklaunchaction.cpp +++ b/plugin-quicklaunch/quicklaunchaction.cpp @@ -123,12 +123,8 @@ void QuickLaunchAction::execAction(QString additionalAction) { case ActionLegacy: { -#if (QT_VERSION >= QT_VERSION_CHECK(5,15,0)) QStringList args = QProcess::splitCommand(exec); QProcess::startDetached(args.takeFirst(), args); -#else - QProcess::startDetached(exec); -#endif break; } case ActionXdg: diff --git a/plugin-statusnotifier/statusnotifierbutton.h b/plugin-statusnotifier/statusnotifierbutton.h index 3a14213a0..7f0f45f68 100644 --- a/plugin-statusnotifier/statusnotifierbutton.h +++ b/plugin-statusnotifier/statusnotifierbutton.h @@ -38,16 +38,6 @@ #include #include -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) -template inline T qFromUnaligned(const uchar *src) -{ - T dest; - const size_t size = sizeof(T); - memcpy(&dest, src, size); - return dest; -} -#endif - class ILXQtPanelPlugin; class SniAsync; diff --git a/plugin-sysstat/lxqtsysstatcolours.cpp b/plugin-sysstat/lxqtsysstatcolours.cpp index d9dad17dd..6a46fd20a 100644 --- a/plugin-sysstat/lxqtsysstatcolours.cpp +++ b/plugin-sysstat/lxqtsysstatcolours.cpp @@ -80,11 +80,7 @@ LXQtSysStatColours::LXQtSysStatColours(QWidget *parent) : ++iterator; } -#if (QT_VERSION >= QT_VERSION_CHECK(5,15,0)) connect(mSelectColourMapper, &QSignalMapper::mappedString, this, &LXQtSysStatColours::selectColour); -#else - connect(mSelectColourMapper, QOverload::of(&QSignalMapper::mapped), this, &LXQtSysStatColours::selectColour); -#endif } LXQtSysStatColours::~LXQtSysStatColours() diff --git a/plugin-taskbar/lxqttaskbar.cpp b/plugin-taskbar/lxqttaskbar.cpp index 8e04ec001..aa4abe580 100644 --- a/plugin-taskbar/lxqttaskbar.cpp +++ b/plugin-taskbar/lxqttaskbar.cpp @@ -90,11 +90,7 @@ LXQtTaskBar::LXQtTaskBar(ILXQtPanelPlugin *plugin, QWidget *parent) : QTimer::singleShot(0, this, &LXQtTaskBar::settingsChanged); setAcceptDrops(true); -#if (QT_VERSION >= QT_VERSION_CHECK(5,15,0)) connect(mSignalMapper, &QSignalMapper::mappedInt, this, &LXQtTaskBar::activateTask); -#else - connect(mSignalMapper, static_cast(&QSignalMapper::mapped), this, &LXQtTaskBar::activateTask); -#endif QTimer::singleShot(0, this, &LXQtTaskBar::registerShortcuts); connect(KWindowSystem::self(), static_cast(&KWindowSystem::windowChanged) diff --git a/plugin-taskbar/lxqttaskbutton.cpp b/plugin-taskbar/lxqttaskbutton.cpp index c8660f707..ad11c544c 100644 --- a/plugin-taskbar/lxqttaskbutton.cpp +++ b/plugin-taskbar/lxqttaskbutton.cpp @@ -147,11 +147,7 @@ void LXQtTaskButton::updateIcon() } if (ico.isNull()) { -#if QT_VERSION >= 0x050600 int devicePixels = mIconSize * devicePixelRatioF(); -#else - int devicePixels = mIconSize * devicePixelRatio(); -#endif ico = KWindowSystem::icon(mWindow, devicePixels, devicePixels); } setIcon(ico.isNull() ? XdgIcon::defaultApplicationIcon() : ico); diff --git a/plugin-volume/alsaengine.cpp b/plugin-volume/alsaengine.cpp index 15db0506e..a0bdff521 100644 --- a/plugin-volume/alsaengine.cpp +++ b/plugin-volume/alsaengine.cpp @@ -178,11 +178,7 @@ void AlsaEngine::discoverDevices() struct pollfd pfd; if (snd_mixer_poll_descriptors(mixer, &pfd, 1)) { QSocketNotifier *notifier = new QSocketNotifier(pfd.fd, QSocketNotifier::Read, this); - #if (QT_VERSION >= QT_VERSION_CHECK(5,15,0)) connect(notifier, &QSocketNotifier::activated, this, [this] (QSocketDescriptor socket, QSocketNotifier::Type) { this->driveAlsaEventHandling(socket); }); - #else - connect(notifier, SIGNAL(activated(int)), this, SLOT(driveAlsaEventHandling(int))); - #endif m_mixerMap.insert(pfd.fd, mixer); }