QmlDesigner: refactor StyledOutputpanePlaceHolder a bit

Change-Id: Icd0c960a0f20e6cfcf237033d96a50062d9ea535
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
This commit is contained in:
Tim Jenssen
2016-01-21 12:21:29 +01:00
parent 265fa13bdb
commit a20c13d608
2 changed files with 3 additions and 7 deletions

View File

@@ -46,14 +46,10 @@ void StyledOutputpanePlaceHolder::childEvent(QChildEvent *event)
Core::OutputPanePlaceHolder::childEvent(event);
if (event->type() == QEvent::ChildAdded) {
QWidget *child = qobject_cast<QWidget*>(event->child());
if (child) {
if (QWidget *child = qobject_cast<QWidget*>(event->child())) {
QList<QTabWidget*> widgets = child->findChildren<QTabWidget*>();
if (!widgets.isEmpty()) {
widgets.first()->parentWidget()->ensurePolished();
if (!widgets.isEmpty())
widgets.first()->parentWidget()->setStyleSheet(m_customStylesheet);
}
}
} else if (event->type() == QEvent::ChildRemoved) {
QWidget *child = qobject_cast<QWidget*>(event->child());

View File

@@ -37,7 +37,7 @@ public:
explicit StyledOutputpanePlaceHolder(Core::IMode *mode, QSplitter *parent = 0);
protected:
void childEvent(QChildEvent *event);
void childEvent(QChildEvent *event) override;;
private:
QString m_customStylesheet;