forked from qt-creator/qt-creator
QmlDesigner: refactor StyledOutputpanePlaceHolder a bit
Change-Id: Icd0c960a0f20e6cfcf237033d96a50062d9ea535 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
This commit is contained in:
@@ -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());
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user