8#include <QGuiApplication>
9#include <qpa/qwindowsysteminterface.h>
14#if QT_CONFIG(xcb_xlib)
27 GtkSettings *
settings = gtk_settings_get_default();
35 gchararray
value = gtkSetting<gchararray>(propertyName);
42 GLogLevelFlags log_level,
44 gpointer unused_data) {
48 if (g_strcmp0(
message,
"GtkDialog mapped without a transient parent. "
49 "This is discouraged.") != 0) {
51 g_log_default_handler(log_domain, log_level,
message, unused_data);
61 gdk_set_allowed_backends(
"wayland,x11");
63 gdk_set_allowed_backends(
"x11,wayland");
65#if QT_CONFIG(xcb_xlib)
68 int (*oldErrorHandler)(
Display *, XErrorEvent *) = XSetErrorHandler(
nullptr);
71 gtk_init(
nullptr,
nullptr);
73#if QT_CONFIG(xcb_xlib)
74 XSetErrorHandler(oldErrorHandler);
80 g_type_ensure(PANGO_TYPE_FONT_FAMILY);
81 g_type_ensure(PANGO_TYPE_FONT_FACE);
86#define SETTING_CONNECT(setting) g_signal_connect(settings, "notify::" setting, G_CALLBACK(notifyThemeChanged), nullptr)
87 auto notifyThemeChanged = [] {
91 GtkSettings *
settings = gtk_settings_get_default();
105#undef SETTING_CONNECT
112 const char *gtk_long_press_time =
"gtk-long-press-time";
113 static bool found = g_object_class_find_property(G_OBJECT_GET_CLASS(gtk_settings_get_default()), gtk_long_press_time);
116 return QVariant(gtkSetting<guint>(gtk_long_press_time));
123 return QVariant(gtkSetting<gint>(
"gtk-cursor-blink-time"));
125 return QVariant(gtkSetting<gint>(
"gtk-double-click-distance"));
127 return QVariant(gtkSetting<gint>(
"gtk-double-click-time"));
135 return QVariant(gtkSetting<guint>(
"gtk-entry-password-hint-timeout"));
137 return QVariant(gtkSetting<gint>(
"gtk-dnd-drag-threshold"));
145 int s = gtkSetting<gint>(
"gtk-cursor-theme-size");
166 return m_storage->colorScheme();
175 return useNativeFileDialog();
189 if (!useNativeFileDialog())
209bool QGtk3Theme::useNativeFileDialog()
219 return gtk_check_version(3, 15, 5) ==
nullptr;
225 return m_storage->palette(
type);
231 return m_storage->standardPixmap(
sp,
size);
237 return m_storage->font(
type);
241 QPlatformTheme::IconOptions iconOptions)
const
245 return m_storage->fileIcon(fileInfo);
\inmodule QtCore \reentrant
virtual QString gtkFontName() const
QVariant themeHint(ThemeHint hint) const override
QIcon fileIcon(const QFileInfo &fileInfo, QPlatformTheme::IconOptions iconOptions={ }) const override
Return an icon for fileInfo, observing iconOptions.
Qt::ColorScheme colorScheme() const override
bool usePlatformNativeDialog(DialogType type) const override
virtual QVariant themeHint(ThemeHint hint) const override
QPlatformDialogHelper * createPlatformDialogHelper(DialogType type) const override
QPlatformMenuItem * createPlatformMenuItem() const override
const QPalette * palette(Palette type=SystemPalette) const override
QPlatformMenu * createPlatformMenu() const override
virtual QString gtkFontName() const override
QPixmap standardPixmap(StandardPixmap sp, const QSizeF &size) const override
const QFont * font(Font type=SystemFont) const override
QString platformName
The name of the underlying platform plugin.
The QIcon class provides scalable icons in different modes and states.
The QPalette class contains color groups for each widget state.
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
static void handleThemeChange(QWindow *window=nullptr)
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
void gtkMessageHandler(const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer unused_data)
static T gtkSetting(const gchar *propertyName)
static QVariant gtkGetLongPressTime()
#define SETTING_CONNECT(setting)
GLsizei const GLfloat * v
[13]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint GLsizei const GLchar * message
static QT_BEGIN_NAMESPACE QVariant hint(QPlatformIntegration::StyleHint h)
QSettings settings("MySoft", "Star Runner")
[0]