Skip to content

Commit 385bb59

Browse files
committed
Simplified 173e1d7
1 parent 6febfd2 commit 385bb59

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

src/app/qgisappstylesheet.cpp

+8-13
Original file line numberDiff line numberDiff line change
@@ -185,19 +185,14 @@ void QgisAppStyleSheet::buildStyleSheet( const QMap<QString, QVariant>& opts )
185185
}
186186

187187
// Fix selection color on loosing focus (Windows)
188-
QApplication* app = dynamic_cast<QApplication*>( QgsApplication::instance() );
189-
if ( app )
190-
{
191-
const QPalette palette = app->palette();
192-
193-
ss += QString( "QTableView {"
194-
"selection-background-color: %1;"
195-
"selection-color: %2;"
196-
"}")
197-
.arg( palette.highlight().color().name() )
198-
.arg( palette.highlightedText().color().name() );
199-
}
200-
188+
const QPalette palette = qApp->palette();
189+
190+
ss += QString( "QTableView {"
191+
"selection-background-color: %1;"
192+
"selection-color: %2;"
193+
"}")
194+
.arg( palette.highlight().color().name() )
195+
.arg( palette.highlightedText().color().name() );
201196

202197
QgsDebugMsg( QString( "Stylesheet built: %1" ).arg( ss ) );
203198

0 commit comments

Comments
 (0)