*** formpreviewview.cpp --- formpreviewview.cpp *************** *** 36,47 **** --- 36,48 ---- #include #include #include #include #include #include + #include QT_BEGIN_NAMESPACE #if defined(Q_CC_SUN) || defined(Q_CC_HPACC) || defined(Q_CC_XLC) int qHash(const QUiTranslatableStringValue &tsv) #else *************** *** 342,354 **** --- 343,374 ---- foreach (QWidget *w, a->associatedWidgets()) highlightWidget(w, on); } static void highlightWidget(QWidget *w, bool on) { + QVariant bak = w->property(PALETTE_BACKUP_PROP); + + QWidget *currWidget = w; + QObject *po = currWidget->parent(); + while (currWidget && po) + { + // If the parent widget is a stacked widget set the current widget + // as current in the QStackedWidget. + if(QStackedWidget *qsw = qobject_cast(po)) + { + qsw->setCurrentWidget(currWidget); + } + + if(currWidget = qobject_cast(po)) + { + po = currWidget->parent(); + } + } + if (on) { if (!bak.isValid()) { QPalette pal = qApp->palette(); foreach (QObject *co, w->children()) if (QWidget *cw = qobject_cast(co)) cw->setPalette(cw->palette().resolve(pal));