diff --git a/ui/drivers/qt/gridview.cpp b/ui/drivers/qt/gridview.cpp index d2e5e451a5..1565ca9426 100644 --- a/ui/drivers/qt/gridview.cpp +++ b/ui/drivers/qt/gridview.cpp @@ -391,7 +391,7 @@ void GridView::paintEvent(QPaintEvent*) { QModelIndex index = model()->index(row, 0, rootIndex()); QRectF rect = viewportRectForRow(row); -#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) +#if (QT_VERSION > QT_VERSION_CHECK(6, 0, 0)) QStyleOptionViewItem option; initViewItemOption(&option); #else diff --git a/ui/drivers/qt/qt_dialogs.cpp b/ui/drivers/qt/qt_dialogs.cpp index 69c0de4d75..db2f96b1a9 100644 --- a/ui/drivers/qt/qt_dialogs.cpp +++ b/ui/drivers/qt/qt_dialogs.cpp @@ -543,7 +543,7 @@ ViewOptionsDialog::ViewOptionsDialog(MainWindow *mainwindow, QWidget *parent) : QHBoxLayout *headerHLayout = new QHBoxLayout; const int leftMargin = QApplication::style()->pixelMetric(QStyle::PM_LayoutLeftMargin); -#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) +#if (QT_VERSION > QT_VERSION_CHECK(6, 0, 0)) m_optionsStack->setContentsMargins(0, 0, 0, 0); #else m_optionsStack->setMargin(0); diff --git a/ui/drivers/qt/qt_options.cpp b/ui/drivers/qt/qt_options.cpp index 6c7d22adce..455aaf4a99 100644 --- a/ui/drivers/qt/qt_options.cpp +++ b/ui/drivers/qt/qt_options.cpp @@ -1440,7 +1440,7 @@ QWidget *VideoPage::widget() layout->addStretch(); -#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) +#if (QT_VERSION > QT_VERSION_CHECK(6, 0, 0)) void (VideoPage::*cb)(int) = &VideoPage::onResolutionComboIndexChanged; connect(m_resolutionCombo, &QComboBox::currentIndexChanged, this, cb); #else diff --git a/ui/drivers/qt/qt_playlist.cpp b/ui/drivers/qt/qt_playlist.cpp index 7ee0d49188..9250630637 100644 --- a/ui/drivers/qt/qt_playlist.cpp +++ b/ui/drivers/qt/qt_playlist.cpp @@ -246,7 +246,7 @@ void PlaylistModel::loadThumbnail(const QModelIndex &index) if (!m_pendingImages.contains(path) && !m_cache.contains(path)) { m_pendingImages.insert(path); -#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) +#if (QT_VERSION > QT_VERSION_CHECK(6, 0, 0)) QtConcurrent::run(&PlaylistModel::loadImage, this, index, path); #else QtConcurrent::run(this, &PlaylistModel::loadImage, index, path); @@ -878,7 +878,7 @@ void MainWindow::onPlaylistWidgetContextMenuRequested(const QPoint&) for (j = 0; j < m_listWidget->count(); j++) { QListWidgetItem *item = m_listWidget->item(j); -#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) +#if (QT_VERSION > QT_VERSION_CHECK(6, 0, 0)) bool hidden = item->isHidden(); #else bool hidden = m_listWidget->isItemHidden(item); @@ -1499,11 +1499,7 @@ void PlaylistModel::getPlaylistItems(QString path) playlist_config.fuzzy_archive_match = settings->bools.playlist_fuzzy_archive_match; playlist_config_set_base_content_directory(&playlist_config, settings->bools.playlist_portable_paths ? settings->paths.directory_menu_content : NULL); -#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) pathArray.append(path.toUtf8()); -#else - pathArray.append(path); -#endif pathData = pathArray.constData(); if (!string_is_empty(pathData)) playlistName = path_basename(pathData); diff --git a/ui/drivers/ui_qt.cpp b/ui/drivers/ui_qt.cpp index a8a40a0b0d..f2fb1f9c92 100644 --- a/ui/drivers/ui_qt.cpp +++ b/ui/drivers/ui_qt.cpp @@ -20,11 +20,6 @@ #include #include #include - -#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) -#include -#endif - #include #include #include @@ -1913,7 +1908,7 @@ void MainWindow::onFileBrowserTreeContextMenuRequested(const QPoint&) if (currentDirString.isEmpty()) return; -#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) +#if (QT_VERSION > QT_VERSION_CHECK(6, 0, 0)) dir.setPath(currentDirString); #else dir = currentDirString; @@ -2634,13 +2629,13 @@ void MainWindow::selectBrowserDir(QString path) #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) m_proxyFileModel->setFilterRegularExpression(QRegularExpression()); #else - m_proxyFileModel->setFilterRegExp(QRegExp()); + m_proxyFileModel->setFilterRegExp(QRegExp()); #endif m_fileTableView->setRootIndex(m_proxyFileModel->mapFromSource(sourceIndex)); #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) m_proxyFileModel->setFilterRegularExpression(m_searchRegularExpression); #else - m_proxyFileModel->setFilterRegExp(m_searchRegExp); + m_proxyFileModel->setFilterRegExp(m_searchRegExp); #endif } } @@ -3199,13 +3194,8 @@ QComboBox* MainWindow::launchWithComboBox() void MainWindow::onSearchLineEditEdited(const QString &text) { int i; -#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) QVector textHiraToKata; QVector textKataToHira; -#else - QVector textHiraToKata; - QVector textKataToHira; -#endif QVector textUnicode = text.toUcs4(); bool found_hiragana = false; bool found_katakana = false; @@ -4322,7 +4312,7 @@ static void ui_application_qt_process_events(void) QAbstractEventDispatcher *dispatcher = QApplication::eventDispatcher(); if (dispatcher && dispatcher->hasPendingEvents()) #endif - QApplication::processEvents(); + QApplication::processEvents(); } static void ui_application_qt_quit(void) @@ -4560,11 +4550,7 @@ static void* ui_companion_qt_init(void) QVBoxLayout *launchWithWidgetLayout = NULL; QHBoxLayout *coreComboBoxLayout = NULL; QMenuBar *menu = NULL; -#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) QScreen *screen = NULL; -#else - QDesktopWidget *desktop = NULL; -#endif QMenu *fileMenu = NULL; QMenu *editMenu = NULL; QMenu *viewMenu = NULL; @@ -4607,13 +4593,8 @@ static void* ui_companion_qt_init(void) (ui_application_qt.initialize()); handle->window = static_cast(ui_window_qt.init()); -#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) screen = qApp->primaryScreen(); desktopRect = screen->availableGeometry(); -#else - desktop = qApp->desktop(); - desktopRect = desktop->availableGeometry(); -#endif mainwindow = handle->window->qtWindow; @@ -5223,7 +5204,7 @@ void LoadCoreWindow::onCoreEnterPressed() Qt::UserRole).toHash(); QString path = hash["path"].toString(); -#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) +#if (QT_VERSION > QT_VERSION_CHECK(6, 0, 0)) pathArray.append(path.toStdString()); #else pathArray.append(path); @@ -5257,11 +5238,7 @@ void LoadCoreWindow::onLoadCustomCoreClicked() if (path.isEmpty()) return; -#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) pathArray.append(path.toUtf8()); -#else - pathArray.append(path); -#endif pathData = pathArray.constData(); loadCore(pathData); @@ -5273,11 +5250,7 @@ void LoadCoreWindow::initCoreList(const QStringList &extensionFilters) unsigned i; QStringList horizontal_header_labels; core_info_list_t *cores = NULL; -#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) - QScreen *desktop = qApp->primaryScreen(); -#else - QDesktopWidget *desktop = qApp->desktop(); -#endif + QScreen *desktop = qApp->primaryScreen(); QRect desktopRect = desktop->availableGeometry(); horizontal_header_labels << msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_NAME);