![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
The QGtk3Interface class centralizes communication with the GTK3 library. More...
#include <qgtk3interface_p.h>
Public Types | |
enum class | QGtkWidget { gtk_menu_bar , gtk_menu , gtk_button , gtk_button_box , gtk_check_button , gtk_radio_button , gtk_frame , gtk_statusbar , gtk_entry , gtk_popup , gtk_notebook , gtk_toolbar , gtk_tree_view , gtk_combo_box , gtk_combo_box_text , gtk_progress_bar , gtk_fixed , gtk_separator_menu_item , gtk_Default , gtk_offscreen_window } |
enum class | QGtkColorSource { Foreground , Background , Text , Base , Border } |
enum class | QGtkColorDefault { Foreground , Background , Border } |
Public Member Functions | |
QGtk3Interface (QGtk3Storage *) | |
~QGtk3Interface () | |
QBrush | brush (QGtkWidget wtype, QGtkColorSource source, GtkStateFlags state) const |
Create a QBrush from a GTK widget. | |
QImage | standardPixmap (QPlatformTheme::StandardPixmap standardPixmap) const |
Returns a QImage corresponding to. | |
QFont | font (QPlatformTheme::Font type) const |
Return a GTK styled font. | |
QIcon | fileIcon (const QFileInfo &fileInfo) const |
Returns a GTK styled file icon for. | |
QString | themeName () const |
Returns the name of the current GTK theme. | |
Qt::ColorScheme | colorSchemeByColors () const |
Determine color scheme by colors. |
Static Public Member Functions | |
static int | toGtkState (const QString &state) |
Converts a string into the GtkStateFlags enum. | |
static const QLatin1String | fromGtkState (GtkStateFlags state) |
Returns. |
The QGtk3Interface class centralizes communication with the GTK3 library.
By encapsulating all GTK version specific syntax and conversions, it makes Qt's GTK theme independent from GTK versions.
Definition at line 54 of file qgtk3interface_p.h.
|
strong |
Enumerator | |
---|---|
Foreground | |
Background | |
Border |
Definition at line 123 of file qgtk3interface_p.h.
|
strong |
Enumerator | |
---|---|
Foreground | |
Background | |
Text | |
Base | |
Border |
Definition at line 102 of file qgtk3interface_p.h.
|
strong |
Definition at line 69 of file qgtk3interface_p.h.
QGtk3Interface::QGtk3Interface | ( | QGtk3Storage * | s | ) |
Definition at line 30 of file qgtk3interface.cpp.
References QGtk3Storage::handleThemeChange(), and m_storage.
QGtk3Interface::~QGtk3Interface | ( | ) |
Definition at line 57 of file qgtk3interface.cpp.
References m_storage.
QBrush QGtk3Interface::brush | ( | QGtkWidget | wtype, |
QGtkColorSource | source, | ||
GtkStateFlags | state ) const |
Create a QBrush from a GTK widget.
Returns a QBrush corresponding to GTK widget type
wtype |
param source and
state. |
Brush height and width is ignored in GTK3, because brush assets (e.g. 9-patches) can't be accessed by the GTK3 API. It's therefore unknown, if the brush relates only to colors, or to a pixmap based style.
Definition at line 470 of file qgtk3interface.cpp.
Qt::ColorScheme QGtk3Interface::colorSchemeByColors | ( | ) | const |
Determine color scheme by colors.
Returns the color scheme of the current GTK theme, heuristically determined by the lightness difference between default background and foreground colors.
Definition at line 504 of file qgtk3interface.cpp.
Returns a GTK styled file icon for.
fileInfo. |
Definition at line 666 of file qgtk3interface.cpp.
QFont QGtk3Interface::font | ( | QPlatformTheme::Font | type | ) | const |
Return a GTK styled font.
Returns the QFont corresponding to
type | by reading the corresponding GTK widget type's font. |
Definition at line 607 of file qgtk3interface.cpp.
|
static |
Returns.
state | converted into a string. |
Definition at line 106 of file qgtk3interface.cpp.
QImage QGtk3Interface::standardPixmap | ( | QPlatformTheme::StandardPixmap | standardPixmap | ) | const |
Returns a QImage corresponding to.
standardPixmap. |
A QImage (not a QPixmap) is returned so it can be cached and re-scaled in case the pixmap is requested multiple times with different resolutions.
Definition at line 160 of file qgtk3interface.cpp.
QString QGtk3Interface::themeName | ( | ) | const |
Returns the name of the current GTK theme.
Definition at line 481 of file qgtk3interface.cpp.
|
static |
Converts a string into the GtkStateFlags enum.
Converts a string formatted GTK color
state | into an enum value. Returns an integer corresponding to GtkStateFlags. Returns -1 if |
state | does not correspond to a valid enum key. |
Definition at line 75 of file qgtk3interface.cpp.