diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/qt6gtk2-qtplugin/main.cpp | 2 | ||||
| -rw-r--r-- | src/qt6gtk2-qtplugin/qt6gtk2dialoghelpers.cpp | 22 | ||||
| -rw-r--r-- | src/qt6gtk2-qtplugin/qt6gtk2dialoghelpers.h | 2 | ||||
| -rw-r--r-- | src/qt6gtk2-qtplugin/qt6gtk2theme.cpp | 5 | ||||
| -rw-r--r-- | src/qt6gtk2-qtplugin/qt6gtk2theme.h | 2 | ||||
| -rw-r--r-- | src/qt6gtk2-style/plugin.cpp | 4 | ||||
| -rw-r--r-- | src/qt6gtk2-style/qgtk2painter.cpp | 2 | ||||
| -rw-r--r-- | src/qt6gtk2-style/qgtk2painter_p.h | 2 | ||||
| -rw-r--r-- | src/qt6gtk2-style/qgtkglobal_p.h | 2 | ||||
| -rw-r--r-- | src/qt6gtk2-style/qgtkpainter.cpp | 2 | ||||
| -rw-r--r-- | src/qt6gtk2-style/qgtkpainter_p.h | 2 | ||||
| -rw-r--r-- | src/qt6gtk2-style/qgtkstyle.cpp | 14 | ||||
| -rw-r--r-- | src/qt6gtk2-style/qgtkstyle_p.cpp | 4 | ||||
| -rw-r--r-- | src/qt6gtk2-style/qgtkstyle_p.h | 2 | ||||
| -rw-r--r-- | src/qt6gtk2-style/qgtkstyle_p_p.h | 2 | ||||
| -rw-r--r-- | src/qt6gtk2-style/qstylehelper.cpp | 11 | ||||
| -rw-r--r-- | src/qt6gtk2-style/qstylehelper_p.h | 2 |
17 files changed, 50 insertions, 32 deletions
diff --git a/src/qt6gtk2-qtplugin/main.cpp b/src/qt6gtk2-qtplugin/main.cpp index 63171d2..7da2d20 100644 --- a/src/qt6gtk2-qtplugin/main.cpp +++ b/src/qt6gtk2-qtplugin/main.cpp @@ -1,6 +1,6 @@ /*************************************************************************** * Copyright (C) 2015 The Qt Company Ltd. * - * Copyright (C) 2016-2024 Ilya Kotov, forkotov02@ya.ru * + * Copyright (C) 2016-2025 Ilya Kotov, forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * diff --git a/src/qt6gtk2-qtplugin/qt6gtk2dialoghelpers.cpp b/src/qt6gtk2-qtplugin/qt6gtk2dialoghelpers.cpp index a01f083..cb04020 100644 --- a/src/qt6gtk2-qtplugin/qt6gtk2dialoghelpers.cpp +++ b/src/qt6gtk2-qtplugin/qt6gtk2dialoghelpers.cpp @@ -1,6 +1,6 @@ /*************************************************************************** * Copyright (C) 2015 The Qt Company Ltd. * - * Copyright (C) 2016-2024 Ilya Kotov, forkotov02@ya.ru * + * Copyright (C) 2016-2025 Ilya Kotov, forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -99,8 +99,8 @@ void QGtk2Dialog::exec() } else { // block input to the window, allow input to other GTK dialogs QEventLoop loop; - connect(this, SIGNAL(accept()), &loop, SLOT(quit())); - connect(this, SIGNAL(reject()), &loop, SLOT(quit())); + connect(this, &QGtk2Dialog::accept, &loop, &QEventLoop::quit); + connect(this, &QGtk2Dialog::reject, &loop, &QEventLoop::quit); loop.exec(); } } @@ -154,8 +154,8 @@ void QGtk2Dialog::onParentWindowDestroyed() Qt6Gtk2ColorDialogHelper::Qt6Gtk2ColorDialogHelper() { d.reset(new QGtk2Dialog(gtk_color_selection_dialog_new(""))); - connect(d.data(), SIGNAL(accept()), this, SLOT(onAccepted())); - connect(d.data(), SIGNAL(reject()), this, SIGNAL(reject())); + connect(d.data(), &QGtk2Dialog::accept, this, &Qt6Gtk2ColorDialogHelper::onAccepted); + connect(d.data(), &QGtk2Dialog::reject, this, &Qt6Gtk2ColorDialogHelper::reject); GtkWidget *gtkColorSelection = gtk_color_selection_dialog_get_color_selection(GTK_COLOR_SELECTION_DIALOG(d->gtkDialog())); g_signal_connect_swapped(gtkColorSelection, "color-changed", G_CALLBACK(onColorChanged), this); @@ -243,8 +243,8 @@ Qt6Gtk2FileDialogHelper::Qt6Gtk2FileDialogHelper() GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_OK, nullptr))); - connect(d.data(), SIGNAL(accept()), this, SLOT(onAccepted())); - connect(d.data(), SIGNAL(reject()), this, SIGNAL(reject())); + connect(d.data(), &QGtk2Dialog::accept, this, &Qt6Gtk2FileDialogHelper::onAccepted); + connect(d.data(), &QGtk2Dialog::reject, this, &Qt6Gtk2FileDialogHelper::reject); g_signal_connect(GTK_FILE_CHOOSER(d->gtkDialog()), "selection-changed", G_CALLBACK(onSelectionChanged), this); g_signal_connect_swapped(GTK_FILE_CHOOSER(d->gtkDialog()), "current-folder-changed", G_CALLBACK(onCurrentFolderChanged), this); @@ -400,7 +400,7 @@ void Qt6Gtk2FileDialogHelper::onUpdatePreview(GtkDialog *gtkDialog, Qt6Gtk2FileD // Don't attempt to open anything which isn't a regular file. If a named pipe, // this may hang. - QFileInfo fileinfo(filename); + QFileInfo fileinfo(QString::fromLocal8Bit(filename)); if (!fileinfo.exists() || !fileinfo.isFile()) { g_free(filename); gtk_file_chooser_set_preview_widget_active(GTK_FILE_CHOOSER(gtkDialog), false); @@ -408,7 +408,7 @@ void Qt6Gtk2FileDialogHelper::onUpdatePreview(GtkDialog *gtkDialog, Qt6Gtk2FileD } // This will preserve the image's aspect ratio. - GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file_at_size(filename, PREVIEW_WIDTH, PREVIEW_HEIGHT, 0); + GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file_at_size(filename, PREVIEW_WIDTH, PREVIEW_HEIGHT, nullptr); g_free(filename); if (pixbuf) { gtk_image_set_from_pixbuf(GTK_IMAGE(helper->previewWidget), pixbuf); @@ -518,8 +518,8 @@ void Qt6Gtk2FileDialogHelper::setNameFilters(const QStringList &filters) Qt6Gtk2FontDialogHelper::Qt6Gtk2FontDialogHelper() { d.reset(new QGtk2Dialog(gtk_font_selection_dialog_new(""))); - connect(d.data(), SIGNAL(accept()), this, SLOT(onAccepted())); - connect(d.data(), SIGNAL(reject()), this, SIGNAL(reject())); + connect(d.data(), &QGtk2Dialog::accept, this, &Qt6Gtk2FontDialogHelper::onAccepted); + connect(d.data(), &QGtk2Dialog::reject, this, &Qt6Gtk2FontDialogHelper::reject); } Qt6Gtk2FontDialogHelper::~Qt6Gtk2FontDialogHelper() diff --git a/src/qt6gtk2-qtplugin/qt6gtk2dialoghelpers.h b/src/qt6gtk2-qtplugin/qt6gtk2dialoghelpers.h index b6c15d7..2c721df 100644 --- a/src/qt6gtk2-qtplugin/qt6gtk2dialoghelpers.h +++ b/src/qt6gtk2-qtplugin/qt6gtk2dialoghelpers.h @@ -1,6 +1,6 @@ /*************************************************************************** * Copyright (C) 2015 The Qt Company Ltd. * - * Copyright (C) 2016-2024 Ilya Kotov, forkotov02@ya.ru * + * Copyright (C) 2016-2025 Ilya Kotov, forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * diff --git a/src/qt6gtk2-qtplugin/qt6gtk2theme.cpp b/src/qt6gtk2-qtplugin/qt6gtk2theme.cpp index 9fbee53..6249477 100644 --- a/src/qt6gtk2-qtplugin/qt6gtk2theme.cpp +++ b/src/qt6gtk2-qtplugin/qt6gtk2theme.cpp @@ -1,6 +1,6 @@ /*************************************************************************** * Copyright (C) 2015 The Qt Company Ltd. * - * Copyright (C) 2016-2024 Ilya Kotov, forkotov02@ya.ru * + * Copyright (C) 2016-2025 Ilya Kotov, forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -86,8 +86,7 @@ QVariant Qt6Gtk2Theme::themeHint(QPlatformTheme::ThemeHint hint) const return gtkSetting("gtk-fallback-icon-theme"); case QPlatformTheme::StyleNames: { - QStringList styleNames; - styleNames << "qt6gtk2"; + QStringList styleNames = { QStringLiteral("qt6gtk2") }; //styleNames << QGnomeTheme::themeHint(hint).toStringList(); return styleNames; } diff --git a/src/qt6gtk2-qtplugin/qt6gtk2theme.h b/src/qt6gtk2-qtplugin/qt6gtk2theme.h index 2e6a489..ff63fa7 100644 --- a/src/qt6gtk2-qtplugin/qt6gtk2theme.h +++ b/src/qt6gtk2-qtplugin/qt6gtk2theme.h @@ -1,6 +1,6 @@ /*************************************************************************** * Copyright (C) 2015 The Qt Company Ltd. * - * Copyright (C) 2016-2024 Ilya Kotov, forkotov02@ya.ru * + * Copyright (C) 2016-2025 Ilya Kotov, forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * diff --git a/src/qt6gtk2-style/plugin.cpp b/src/qt6gtk2-style/plugin.cpp index 257d90b..d25aae4 100644 --- a/src/qt6gtk2-style/plugin.cpp +++ b/src/qt6gtk2-style/plugin.cpp @@ -1,6 +1,6 @@ /*************************************************************************** * Copyright (C) 2015 The Qt Company Ltd. * - * Copyright (C) 2016-2024 Ilya Kotov, forkotov02@ya.ru * + * Copyright (C) 2016-2025 Ilya Kotov, forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -42,7 +42,7 @@ QStyle *Qt6Gtk2StylePlugin::create(const QString &key) return nullptr; } - if (key == "gtk2" || key == "qt6gtk2" || key == "qt5gtk2") + if (key == QLatin1String("gtk2") || key == QLatin1String("qt6gtk2") || key == QLatin1String("qt5gtk2")) return new QGtkStyle; return nullptr; } diff --git a/src/qt6gtk2-style/qgtk2painter.cpp b/src/qt6gtk2-style/qgtk2painter.cpp index 2a80d08..0bb6ca3 100644 --- a/src/qt6gtk2-style/qgtk2painter.cpp +++ b/src/qt6gtk2-style/qgtk2painter.cpp @@ -1,6 +1,6 @@ /*************************************************************************** * Copyright (C) 2015 The Qt Company Ltd. * - * Copyright (C) 2016-2024 Ilya Kotov, forkotov02@ya.ru * + * Copyright (C) 2016-2025 Ilya Kotov, forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * diff --git a/src/qt6gtk2-style/qgtk2painter_p.h b/src/qt6gtk2-style/qgtk2painter_p.h index 59a2fa9..121b7d0 100644 --- a/src/qt6gtk2-style/qgtk2painter_p.h +++ b/src/qt6gtk2-style/qgtk2painter_p.h @@ -1,6 +1,6 @@ /*************************************************************************** * Copyright (C) 2015 The Qt Company Ltd. * - * Copyright (C) 2016-2024 Ilya Kotov, forkotov02@ya.ru * + * Copyright (C) 2016-2025 Ilya Kotov, forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * diff --git a/src/qt6gtk2-style/qgtkglobal_p.h b/src/qt6gtk2-style/qgtkglobal_p.h index f0eae9d..a2ce038 100644 --- a/src/qt6gtk2-style/qgtkglobal_p.h +++ b/src/qt6gtk2-style/qgtkglobal_p.h @@ -1,6 +1,6 @@ /*************************************************************************** * Copyright (C) 2015 The Qt Company Ltd. * - * Copyright (C) 2016-2024 Ilya Kotov, forkotov02@ya.ru * + * Copyright (C) 2016-2025 Ilya Kotov, forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * diff --git a/src/qt6gtk2-style/qgtkpainter.cpp b/src/qt6gtk2-style/qgtkpainter.cpp index 3f8afad..d8f7dce 100644 --- a/src/qt6gtk2-style/qgtkpainter.cpp +++ b/src/qt6gtk2-style/qgtkpainter.cpp @@ -1,6 +1,6 @@ /*************************************************************************** * Copyright (C) 2015 The Qt Company Ltd. * - * Copyright (C) 2016-2024 Ilya Kotov, forkotov02@ya.ru * + * Copyright (C) 2016-2025 Ilya Kotov, forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * diff --git a/src/qt6gtk2-style/qgtkpainter_p.h b/src/qt6gtk2-style/qgtkpainter_p.h index 4f249af..19b27df 100644 --- a/src/qt6gtk2-style/qgtkpainter_p.h +++ b/src/qt6gtk2-style/qgtkpainter_p.h @@ -1,6 +1,6 @@ /*************************************************************************** * Copyright (C) 2015 The Qt Company Ltd. * - * Copyright (C) 2016-2024 Ilya Kotov, forkotov02@ya.ru * + * Copyright (C) 2016-2025 Ilya Kotov, forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * diff --git a/src/qt6gtk2-style/qgtkstyle.cpp b/src/qt6gtk2-style/qgtkstyle.cpp index 9bb5b9c..3164e2c 100644 --- a/src/qt6gtk2-style/qgtkstyle.cpp +++ b/src/qt6gtk2-style/qgtkstyle.cpp @@ -1,6 +1,6 @@ /*************************************************************************** * Copyright (C) 2015 The Qt Company Ltd. * - * Copyright (C) 2016-2024 Ilya Kotov, forkotov02@ya.ru * + * Copyright (C) 2016-2025 Ilya Kotov, forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -1806,8 +1806,14 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom // and http://live.gnome.org/GnomeArt/Tutorials/GtkThemes/GtkComboBoxEntry if (const QStyleOptionComboBox *comboBox = qstyleoption_cast<const QStyleOptionComboBox *>(option)) { bool sunken = comboBox->state & State_On; // play dead, if combobox has no items + +#if (QT_VERSION >= QT_VERSION_CHECK(6, 9, 0)) + QCachedPainter p(painter, QStringLiteral("cb-%0-%1").arg(sunken).arg(comboBox->editable), option); + gtkPainter->reset(painter); +#else BEGIN_STYLE_PIXMAPCACHE(QString::fromLatin1("cb-%0-%1").arg(sunken).arg(comboBox->editable)); gtkPainter->reset(p); +#endif gtkPainter->setUsePixmapCache(false); // cached externally bool isEnabled = (comboBox->state & State_Enabled); @@ -2004,7 +2010,11 @@ void QGtkStyle::drawComplexControl(ComplexControl control, const QStyleOptionCom style, arrowPath.toString() + QString::number(option->direction)); } } - END_STYLE_PIXMAPCACHE; +#if (QT_VERSION >= QT_VERSION_CHECK(6, 9, 0)) + p.finish(); +#else + END_STYLE_PIXMAPCACHE +#endif } break; #endif // QT_NO_COMBOBOX diff --git a/src/qt6gtk2-style/qgtkstyle_p.cpp b/src/qt6gtk2-style/qgtkstyle_p.cpp index d8a0597..e85e5ea 100644 --- a/src/qt6gtk2-style/qgtkstyle_p.cpp +++ b/src/qt6gtk2-style/qgtkstyle_p.cpp @@ -1,6 +1,6 @@ /*************************************************************************** * Copyright (C) 2015 The Qt Company Ltd. * - * Copyright (C) 2016-2024 Ilya Kotov, forkotov02@ya.ru * + * Copyright (C) 2016-2025 Ilya Kotov, forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -286,7 +286,7 @@ void QGtkStylePrivate::initGtkWidgets() const if (!gtkWidgetMap()->contains("GtkButton")) { GtkWidget *gtkButton = gtk_button_new(); addWidget(gtkButton); - g_signal_connect(gtkButton, "style-set", G_CALLBACK(gtkStyleSetCallback), 0); + g_signal_connect(gtkButton, "style-set", G_CALLBACK(gtkStyleSetCallback), nullptr); addWidget((GtkWidget*)gtk_tool_button_new(nullptr, "Qt")); addWidget(gtk_arrow_new(GTK_ARROW_DOWN, GTK_SHADOW_NONE)); addWidget(gtk_hbutton_box_new()); diff --git a/src/qt6gtk2-style/qgtkstyle_p.h b/src/qt6gtk2-style/qgtkstyle_p.h index aa7dfa3..cf07f83 100644 --- a/src/qt6gtk2-style/qgtkstyle_p.h +++ b/src/qt6gtk2-style/qgtkstyle_p.h @@ -1,6 +1,6 @@ /*************************************************************************** * Copyright (C) 2015 The Qt Company Ltd. * - * Copyright (C) 2016-2024 Ilya Kotov, forkotov02@ya.ru * + * Copyright (C) 2016-2025 Ilya Kotov, forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * diff --git a/src/qt6gtk2-style/qgtkstyle_p_p.h b/src/qt6gtk2-style/qgtkstyle_p_p.h index 5e881ec..0f86c2d 100644 --- a/src/qt6gtk2-style/qgtkstyle_p_p.h +++ b/src/qt6gtk2-style/qgtkstyle_p_p.h @@ -1,6 +1,6 @@ /*************************************************************************** * Copyright (C) 2015 The Qt Company Ltd. * - * Copyright (C) 2016-2024 Ilya Kotov, forkotov02@ya.ru * + * Copyright (C) 2016-2025 Ilya Kotov, forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * diff --git a/src/qt6gtk2-style/qstylehelper.cpp b/src/qt6gtk2-style/qstylehelper.cpp index aa88cc7..f652cf7 100644 --- a/src/qt6gtk2-style/qstylehelper.cpp +++ b/src/qt6gtk2-style/qstylehelper.cpp @@ -1,6 +1,6 @@ /*************************************************************************** * Copyright (C) 2015 The Qt Company Ltd. * - * Copyright (C) 2016-2024 Ilya Kotov, forkotov02@ya.ru * + * Copyright (C) 2016-2025 Ilya Kotov, forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -219,7 +219,12 @@ void drawDial(const QStyleOptionSlider *option, QPainter *painter) } // Cache dial background + +#if (QT_VERSION >= QT_VERSION_CHECK(6, 9, 0)) + QCachedPainter p(painter, QLatin1StringView("qdial"), option); +#else BEGIN_STYLE_PIXMAPCACHE(QString::fromLatin1("qdial")); +#endif p->setRenderHint(QPainter::Antialiasing); const qreal d_ = r / 6; @@ -279,7 +284,11 @@ void drawDial(const QStyleOptionSlider *option, QPainter *painter) p->drawEllipse(br.adjusted(-1, -1, 1, 1)); } +#if (QT_VERSION >= QT_VERSION_CHECK(6, 9, 0)) + p.finish(); +#else END_STYLE_PIXMAPCACHE +#endif QPointF dp = calcRadialPos(option, qreal(0.70)); buttonColor = buttonColor.lighter(104); diff --git a/src/qt6gtk2-style/qstylehelper_p.h b/src/qt6gtk2-style/qstylehelper_p.h index 1aedbad..52c7b42 100644 --- a/src/qt6gtk2-style/qstylehelper_p.h +++ b/src/qt6gtk2-style/qstylehelper_p.h @@ -1,6 +1,6 @@ /*************************************************************************** * Copyright (C) 2015 The Qt Company Ltd. * - * Copyright (C) 2016-2024 Ilya Kotov, forkotov02@ya.ru * + * Copyright (C) 2016-2025 Ilya Kotov, forkotov02@ya.ru * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * |
