mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-23 10:22:55 +00:00
remove redundant check in QApplication::style()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
9e89650bef
commit
ad9087f180
1 changed files with 18 additions and 20 deletions
|
@ -832,26 +832,24 @@ QStyle *QApplication::style()
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (!QApplicationPrivate::app_style) {
|
||||
QString style;
|
||||
if (!QApplicationPrivate::styleOverride.isEmpty()) {
|
||||
style = QApplicationPrivate::styleOverride;
|
||||
} else {
|
||||
style = QApplicationPrivate::desktopStyleKey();
|
||||
}
|
||||
QString style;
|
||||
if (!QApplicationPrivate::styleOverride.isEmpty()) {
|
||||
style = QApplicationPrivate::styleOverride;
|
||||
} else {
|
||||
style = QApplicationPrivate::desktopStyleKey();
|
||||
}
|
||||
|
||||
QApplicationPrivate::app_style = QStyleFactory::create(style);
|
||||
if (!QApplicationPrivate::app_style) {
|
||||
foreach (const QString &style, QStyleFactory::keys()) {
|
||||
if ((QApplicationPrivate::app_style = QStyleFactory::create(style)))
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!QApplicationPrivate::app_style) {
|
||||
Q_ASSERT(!"No styles available!");
|
||||
return 0;
|
||||
QApplicationPrivate::app_style = QStyleFactory::create(style);
|
||||
if (!QApplicationPrivate::app_style) {
|
||||
foreach (const QString &style, QStyleFactory::keys()) {
|
||||
if ((QApplicationPrivate::app_style = QStyleFactory::create(style)))
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!QApplicationPrivate::app_style) {
|
||||
Q_ASSERT(!"No styles available!");
|
||||
return nullptr;
|
||||
}
|
||||
// take ownership of the style
|
||||
QApplicationPrivate::app_style->setParent(qApp);
|
||||
|
||||
|
@ -984,9 +982,9 @@ void QApplication::setStyle(QStyle *style)
|
|||
QStyle* QApplication::setStyle(const QString& style)
|
||||
{
|
||||
QStyle *s = QStyleFactory::create(style);
|
||||
if (!s)
|
||||
return 0;
|
||||
|
||||
if (!s) {
|
||||
return nullptr;
|
||||
}
|
||||
setStyle(s);
|
||||
return s;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue