mirror of
https://github.com/libretro/RetroArch
synced 2025-03-13 07:14:43 +00:00
Revert Qt5 implementation (#17202)
This commit is contained in:
parent
adcf146e7d
commit
6de5ebadf9
@ -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
|
||||
|
@ -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);
|
||||
|
@ -1443,7 +1443,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
|
||||
|
@ -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,7 +1499,11 @@ 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);
|
||||
|
@ -20,6 +20,11 @@
|
||||
#include <QtWidgets/QFileDialog>
|
||||
#include <QtWidgets/QMessageBox>
|
||||
#include <QtCore/QString>
|
||||
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||
#include <QDesktopWidget>
|
||||
#endif
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QCloseEvent>
|
||||
#include <QResizeEvent>
|
||||
@ -1908,7 +1913,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;
|
||||
@ -2629,13 +2634,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
|
||||
}
|
||||
}
|
||||
@ -3194,8 +3199,13 @@ QComboBox* MainWindow::launchWithComboBox()
|
||||
void MainWindow::onSearchLineEditEdited(const QString &text)
|
||||
{
|
||||
int i;
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
|
||||
QVector<char32_t> textHiraToKata;
|
||||
QVector<char32_t> textKataToHira;
|
||||
#else
|
||||
QVector<unsigned> textHiraToKata;
|
||||
QVector<unsigned> textKataToHira;
|
||||
#endif
|
||||
QVector<unsigned> textUnicode = text.toUcs4();
|
||||
bool found_hiragana = false;
|
||||
bool found_katakana = false;
|
||||
@ -4312,7 +4322,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)
|
||||
@ -4550,7 +4560,11 @@ 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;
|
||||
@ -4593,8 +4607,13 @@ static void* ui_companion_qt_init(void)
|
||||
(ui_application_qt.initialize());
|
||||
handle->window = static_cast<ui_window_qt_t*>(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;
|
||||
|
||||
@ -5204,7 +5223,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);
|
||||
@ -5238,7 +5257,11 @@ 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);
|
||||
@ -5250,7 +5273,11 @@ void LoadCoreWindow::initCoreList(const QStringList &extensionFilters)
|
||||
unsigned i;
|
||||
QStringList horizontal_header_labels;
|
||||
core_info_list_t *cores = NULL;
|
||||
QScreen *desktop = qApp->primaryScreen();
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
|
||||
QScreen *desktop = qApp->primaryScreen();
|
||||
#else
|
||||
QDesktopWidget *desktop = qApp->desktop();
|
||||
#endif
|
||||
QRect desktopRect = desktop->availableGeometry();
|
||||
|
||||
horizontal_header_labels << msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_NAME);
|
||||
|
Loading…
x
Reference in New Issue
Block a user