Changeset View
Changeset View
Standalone View
Standalone View
kstyle/breezestyle.cpp
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 189 Lines • ▼ Show 20 Line(s) | 188 | dbus.connect( QString(), | |||
---|---|---|---|---|---|
190 | QStringLiteral( "org.kde.Breeze.Style" ), | 190 | QStringLiteral( "org.kde.Breeze.Style" ), | ||
191 | QStringLiteral( "reparseConfiguration" ), this, SLOT(configurationChanged()) ); | 191 | QStringLiteral( "reparseConfiguration" ), this, SLOT(configurationChanged()) ); | ||
192 | 192 | | |||
193 | dbus.connect( QString(), | 193 | dbus.connect( QString(), | ||
194 | QStringLiteral( "/BreezeDecoration" ), | 194 | QStringLiteral( "/BreezeDecoration" ), | ||
195 | QStringLiteral( "org.kde.Breeze.Style" ), | 195 | QStringLiteral( "org.kde.Breeze.Style" ), | ||
196 | QStringLiteral( "reparseConfiguration" ), this, SLOT(configurationChanged()) ); | 196 | QStringLiteral( "reparseConfiguration" ), this, SLOT(configurationChanged()) ); | ||
197 | #if !BREEZE_USE_KDE4 | 197 | #if !BREEZE_USE_KDE4 | ||
198 | #if QT_VERSION < 0x050D00 // Check if Qt version < 5.13 | ||||
ngraham: You can make it more readable like this:
`#if QT_VERSION < QT_VERSION_CHECK(5,13,0)` | |||||
199 | this->addEventFilter(qApp); | ||||
200 | #else | ||||
198 | connect(qApp, &QApplication::paletteChanged, this, &Style::configurationChanged); | 201 | connect(qApp, &QApplication::paletteChanged, this, &Style::configurationChanged); | ||
199 | #endif | 202 | #endif | ||
203 | #endif | ||||
200 | // call the slot directly; this initial call will set up things that also | 204 | // call the slot directly; this initial call will set up things that also | ||
201 | // need to be reset when the system palette changes | 205 | // need to be reset when the system palette changes | ||
202 | loadConfiguration(); | 206 | loadConfiguration(); | ||
203 | 207 | | |||
204 | } | 208 | } | ||
205 | 209 | | |||
206 | //______________________________________________________________ | 210 | //______________________________________________________________ | ||
207 | Style::~Style() | 211 | Style::~Style() | ||
▲ Show 20 Lines • Show All 811 Lines • ▼ Show 20 Line(s) | |||||
1019 | bool Style::eventFilter( QObject *object, QEvent *event ) | 1023 | bool Style::eventFilter( QObject *object, QEvent *event ) | ||
1020 | { | 1024 | { | ||
1021 | 1025 | | |||
1022 | if( auto dockWidget = qobject_cast<QDockWidget*>( object ) ) { return eventFilterDockWidget( dockWidget, event ); } | 1026 | if( auto dockWidget = qobject_cast<QDockWidget*>( object ) ) { return eventFilterDockWidget( dockWidget, event ); } | ||
1023 | else if( auto subWindow = qobject_cast<QMdiSubWindow*>( object ) ) { return eventFilterMdiSubWindow( subWindow, event ); } | 1027 | else if( auto subWindow = qobject_cast<QMdiSubWindow*>( object ) ) { return eventFilterMdiSubWindow( subWindow, event ); } | ||
1024 | #if QT_VERSION >= 0x050000 | 1028 | #if QT_VERSION >= 0x050000 | ||
1025 | else if( auto commandLinkButton = qobject_cast<QCommandLinkButton*>( object ) ) { return eventFilterCommandLinkButton( commandLinkButton, event ); } | 1029 | else if( auto commandLinkButton = qobject_cast<QCommandLinkButton*>( object ) ) { return eventFilterCommandLinkButton( commandLinkButton, event ); } | ||
1026 | #endif | 1030 | #endif | ||
1031 | #if QT_VERSION < 0x050D00 // Check if Qt version < 5.13 | ||||
1032 | else if( object == qApp && event->type() == QEvent::ApplicationPaletteChange ) { configurationChanged(); } | ||||
1033 | #endif | ||||
1027 | // cast to QWidget | 1034 | // cast to QWidget | ||
1028 | QWidget *widget = static_cast<QWidget*>( object ); | 1035 | QWidget *widget = static_cast<QWidget*>( object ); | ||
1029 | if( widget->inherits( "QAbstractScrollArea" ) || widget->inherits( "KTextEditor::View" ) ) { return eventFilterScrollArea( widget, event ); } | 1036 | if( widget->inherits( "QAbstractScrollArea" ) || widget->inherits( "KTextEditor::View" ) ) { return eventFilterScrollArea( widget, event ); } | ||
1030 | else if( widget->inherits( "QComboBoxPrivateContainer" ) ) { return eventFilterComboBoxContainer( widget, event ); } | 1037 | else if( widget->inherits( "QComboBoxPrivateContainer" ) ) { return eventFilterComboBoxContainer( widget, event ); } | ||
1031 | 1038 | | |||
1032 | // fallback | 1039 | // fallback | ||
1033 | return ParentStyleClass::eventFilter( object, event ); | 1040 | return ParentStyleClass::eventFilter( object, event ); | ||
1034 | 1041 | | |||
▲ Show 20 Lines • Show All 6232 Lines • Show Last 20 Lines |
You can make it more readable like this:
#if QT_VERSION < QT_VERSION_CHECK(5,13,0)