1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-10-04 17:41:42 +02:00

Try a different QtCurve hack that intercepts QProxyStyle::polish to

avoid infinite loop.
This commit is contained in:
Teo Mrnjavac
2012-08-06 19:22:30 +02:00
parent cae8bb1529
commit 3fe83964b0
3 changed files with 33 additions and 2 deletions

View File

@@ -213,7 +213,19 @@ TomahawkWindow::saveSettings()
void
TomahawkWindow::applyPlatformTweaks()
{
qApp->setStyle( new ProxyStyle() );
// HACK: QtCurve causes an infinite loop on startup. This is because
// setStyle calls setPalette, which calls ensureBaseStyle, which loads
// QtCurve. QtCurve calls setPalette, which creates an infinite loop.
// We could simply not use ProxyStyle under QtCurve, but that would
// make the whole UI look like crap.
// Instead, we tell ProxyStyle that it's running under QtCurve, so it
// can intercept QStyle::polish (which in the base implementation does
// nothing and in QtCurve does evil things), and avoid forwarding it
// to QtCurve.
bool isQtCurve = false;
if( QString( qApp->style()->metaObject()->className() ).toLower().contains( "qtcurve" ) )
isQtCurve = true;
qApp->setStyle( new ProxyStyle( isQtCurve ) );
#ifdef Q_OS_MAC
setUnifiedTitleAndToolBarOnMac( true );