From e602f9e6f711182dc06e4447b74fba248d7fd818 Mon Sep 17 00:00:00 2001 From: nds Date: Wed, 8 Oct 2008 08:17:08 +0000 Subject: [PATCH] Merging changes from BR_V5_DEV. --- src/Qtx/QtxEvalExpr.cxx | 2 +- src/Qtx/QtxMultiAction.cxx | 59 +++++++++++- src/Qtx/QtxMultiAction.h | 1 + src/Qtx/QtxPagePrefMgr.cxx | 11 ++- src/Qtx/QtxPagePrefMgr.h | 2 + src/Qtx/QtxPathListEdit.cxx | 2 +- src/Qtx/QtxPreferenceMgr.cxx | 4 + src/Qtx/QtxPreferenceMgr.h | 1 + src/Qtx/QtxSearchTool.cxx | 2 + src/Style/Style_Salome.cxx | 178 +++++++++++++++++++++++++---------- 10 files changed, 207 insertions(+), 55 deletions(-) diff --git a/src/Qtx/QtxEvalExpr.cxx b/src/Qtx/QtxEvalExpr.cxx index f892bfb6e..279439f9b 100644 --- a/src/Qtx/QtxEvalExpr.cxx +++ b/src/Qtx/QtxEvalExpr.cxx @@ -1911,7 +1911,7 @@ int QtxEvalSetMath::priority( const QString& op, bool isBin ) const \param v2 second argument (not valid for unary postfix operations) \return error code (QtxEvalExpr::Error) */ -QtxEvalExpr::Error QtxEvalSetMath::calculate( const QString& op, QVariant&, QVariant& v2 ) const +QtxEvalExpr::Error QtxEvalSetMath::calculate( const QString& op, QVariant& v1, QVariant& v2 ) const { QtxEvalExpr::Error err = QtxEvalExpr::OK; double val = v2.toDouble(); diff --git a/src/Qtx/QtxMultiAction.cxx b/src/Qtx/QtxMultiAction.cxx index 37b8f440a..88e2b764b 100644 --- a/src/Qtx/QtxMultiAction.cxx +++ b/src/Qtx/QtxMultiAction.cxx @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -56,6 +57,57 @@ public: } }; +/*! + \class QtxMultiAction::Menu + \brief Custom menu to be used with the toolbuttons as drop down list. + \internal +*/ + +class QtxMultiAction::Menu : public QMenu +{ +public: + //! \brief Constructor + Menu( QWidget* parent = 0 ) : QMenu( parent ) {} + //! \brief Destructor + ~Menu() {}; + +protected: + //! \brief Paint the button + virtual bool event( QEvent* e ) + { + bool res = false; + switch ( e->type() ) + { + case QEvent::ToolTip: + case QEvent::WhatsThis: + case QEvent::QueryWhatsThis: + { + QHelpEvent* help = static_cast( e ); + QWidget* w = QApplication::widgetAt( help->globalPos() ); + if ( w && Qtx::isParent( w, this ) ) + { + QHelpEvent he( help->type(), w->mapFromGlobal( help->globalPos() ), help->globalPos() ); + QApplication::sendEvent( w, &he ); + res = true; + } + } + break; + case QEvent::StatusTip: + case QEvent::WhatsThisClicked: + if ( parentWidget() ) + { + QApplication::sendEvent( parentWidget(), e ); + res = true; + } + break; + default: + res = QMenu::event( e ); + break; + } + return res; + } +}; + /*! \class QtxMultiAction::Button \brief Custom button to be used in the toolbar. @@ -170,7 +222,8 @@ QtxMultiAction::~QtxMultiAction() */ void QtxMultiAction::setActiveAction( QAction* a ) { - if ( a && actions().contains( a ) && a != myCurrent && a->isEnabled() ) { + if ( a && actions().contains( a ) && a != myCurrent && a->isEnabled() ) + { myCurrent = a; updateAction(); } @@ -276,7 +329,8 @@ QWidget* QtxMultiAction::createWidget( QWidget* parent ) return 0; QToolButton* w = new Button( tb ); - w->setMenu( new QMenu( w ) ); + w->setMenu( new Menu( w ) ); + w->setMouseTracking( true ); w->setFocusPolicy( Qt::NoFocus ); w->setIconSize( tb->iconSize() ); w->setToolButtonStyle( tb->toolButtonStyle() ); @@ -352,6 +406,7 @@ void QtxMultiAction::updateButton( QToolButton* btn ) QToolButton* b = new QToolButton( pm ); b->setDefaultAction( *itr ); b->setToolTip( (*itr)->toolTip() ); + b->setStatusTip( (*itr)->statusTip() ); b->setAutoRaise( true ); b->setIconSize( btn->iconSize() ); b->setToolButtonStyle( btn->toolButtonStyle() ); diff --git a/src/Qtx/QtxMultiAction.h b/src/Qtx/QtxMultiAction.h index 07bb3e062..a4d9683bd 100644 --- a/src/Qtx/QtxMultiAction.h +++ b/src/Qtx/QtxMultiAction.h @@ -31,6 +31,7 @@ class QTX_EXPORT QtxMultiAction : public QtxActionSet { Q_OBJECT + class Menu; class Button; class Filter; diff --git a/src/Qtx/QtxPagePrefMgr.cxx b/src/Qtx/QtxPagePrefMgr.cxx index 27701557e..30a08cea6 100644 --- a/src/Qtx/QtxPagePrefMgr.cxx +++ b/src/Qtx/QtxPagePrefMgr.cxx @@ -277,6 +277,14 @@ QtxPagePrefItem::~QtxPagePrefItem() delete myListener; } +void QtxPagePrefItem::activate() +{ + QtxPreferenceItem::activate(); + + if ( widget() ) + widget()->setFocus(); +} + /*! \brief Get preference item editor widget. \return editor widget @@ -509,7 +517,8 @@ void QtxPageNamedPrefItem::setControl( QWidget* wid ) { // QtxPagePrefGroupItem* aGroup = 0;//dynamic_cast(parentItem()); // if ( !aGroup ) - widget()->layout()->addWidget( myControl ); + widget()->layout()->addWidget( myControl ); + widget()->setFocusProxy( myControl ); // else myControl->setParent( aGroup->gridBox() ); } } diff --git a/src/Qtx/QtxPagePrefMgr.h b/src/Qtx/QtxPagePrefMgr.h index 11ca33aa3..40d0dd992 100644 --- a/src/Qtx/QtxPagePrefMgr.h +++ b/src/Qtx/QtxPagePrefMgr.h @@ -97,6 +97,8 @@ public: QWidget* widget() const; + virtual void activate(); + protected: void setWidget( QWidget* ); diff --git a/src/Qtx/QtxPathListEdit.cxx b/src/Qtx/QtxPathListEdit.cxx index dee61a389..0c3adfede 100644 --- a/src/Qtx/QtxPathListEdit.cxx +++ b/src/Qtx/QtxPathListEdit.cxx @@ -516,7 +516,7 @@ bool QtxPathListEdit::validate( const bool quietMode ) if ( !quietMode && QMessageBox::information(this, tr("Warning"), tr("%1\n\nThe directory doesn't exist.\nAdd directory anyway?").arg(dir.absPath()), - tr("Yes"), tr("No"), QString::null, 1, 1) == 1) { + tr("Yes"), tr("No"), QString(), 1, 1) == 1) { myEdit->setFocus(); return false; } diff --git a/src/Qtx/QtxPreferenceMgr.cxx b/src/Qtx/QtxPreferenceMgr.cxx index 26ebbf2a3..e3212ca7e 100644 --- a/src/Qtx/QtxPreferenceMgr.cxx +++ b/src/Qtx/QtxPreferenceMgr.cxx @@ -554,6 +554,10 @@ QtxPreferenceItem* QtxPreferenceItem::findItem( const QString& title, const int return item; } +void QtxPreferenceItem::activate() +{ +} + void QtxPreferenceItem::ensureVisible() { if ( parentItem() ) diff --git a/src/Qtx/QtxPreferenceMgr.h b/src/Qtx/QtxPreferenceMgr.h index 1b99d84ad..244d6b360 100644 --- a/src/Qtx/QtxPreferenceMgr.h +++ b/src/Qtx/QtxPreferenceMgr.h @@ -89,6 +89,7 @@ public: virtual QtxResourceMgr* resourceMgr() const; virtual QtxPreferenceMgr* preferenceMgr() const; + virtual void activate(); void ensureVisible(); static int RTTI(); diff --git a/src/Qtx/QtxSearchTool.cxx b/src/Qtx/QtxSearchTool.cxx index 1f0601619..88e2bae13 100644 --- a/src/Qtx/QtxSearchTool.cxx +++ b/src/Qtx/QtxSearchTool.cxx @@ -753,6 +753,8 @@ bool QtxSearchTool::eventFilter( QObject* o, QEvent* e ) myAutoHideTimer->start(); } break; + default: + break; } return QFrame::eventFilter( o, e ); } diff --git a/src/Style/Style_Salome.cxx b/src/Style/Style_Salome.cxx index 576e1778b..50db25e12 100644 --- a/src/Style/Style_Salome.cxx +++ b/src/Style/Style_Salome.cxx @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -159,6 +160,17 @@ static const char* const minimize_xpm[] = { "............" }; +/////////////////////////////////////////////////////////// +// FOR debug purposes only!!! +// +const int DEBUG_LEVEL = 0; + +static bool checkDebugLevel( int level ) +{ + return DEBUG_LEVEL == level; +} +// +/////////////////////////////////////////////////////////// Style_Salome::Style_Salome() : QWindowsStyle() @@ -192,12 +204,22 @@ void Style_Salome::updateSettings( QApplication* app ) void Style_Salome::polish ( QApplication* app ) { + if ( checkDebugLevel(1) ) { + QWindowsStyle::polish( app ); + return; + } + QWindowsStyle::polish( app ); updateSettings( app ); } void Style_Salome::polish ( QWidget* w ) { + if ( checkDebugLevel(2) ) { + QWindowsStyle::polish( w ); + return; + } + if ( !w ) return; if ( w && hasHover() ) { @@ -214,6 +236,11 @@ void Style_Salome::polish ( QWidget* w ) void Style_Salome::unpolish( QWidget* w ) { + if ( checkDebugLevel(3) ) { + QWindowsStyle::unpolish( w ); + return; + } + if ( w && hasHover() ) { if ( qobject_cast(w) || qobject_cast(w)|| qobject_cast(w) || qobject_cast(w) || @@ -227,8 +254,13 @@ void Style_Salome::unpolish( QWidget* w ) } void Style_Salome::drawComplexControl( ComplexControl cc, const QStyleOptionComplex* opt, - QPainter* p, const QWidget* w ) const + QPainter* p, const QWidget* w ) const { + if ( checkDebugLevel(4) ) { + QWindowsStyle::drawComplexControl( cc, opt, p, w ); + return; + } + const QPalette& pal = w->palette(); switch( cc ) { case CC_SpinBox: @@ -591,6 +623,11 @@ void Style_Salome::drawComplexControl( ComplexControl cc, const QStyleOptionComp void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt, QPainter* p, const QWidget* w ) const { + if ( checkDebugLevel(5) ) { + QWindowsStyle::drawControl( ce, opt, p, w ); + return; + } + switch ( ce ) { case CE_PushButton: if (const QStyleOptionButton *btn = qstyleoption_cast(opt)) { @@ -1164,6 +1201,11 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt, } } break; + /* + case CE_ToolBoxTab: + QCommonStyle::drawControl( ce, opt, p, w ); + break; + */ case CE_HeaderSection: { bool aStateOn = opt->state & State_On; QColor aColor = getColor( Style_Model::header_clr ); @@ -1297,13 +1339,19 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt, break; } default: - QWindowsStyle::drawControl( ce, opt, p, w ); + QWindowsStyle::drawControl( ce, opt, p, w ); + break; } } void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt, QPainter* p, const QWidget* w ) const { + if ( checkDebugLevel(6) ) { + QWindowsStyle::drawPrimitive( pe, opt, p, w ); + return; + } + const QPalette& pal = opt->palette; bool doRestore = false; switch ( pe ) { @@ -1355,10 +1403,10 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt, pal.color( QPalette::Window ), getColor( Style_Model::border_bot_clr ), aBrdTopCol, aBrdBotCol, false, false, isHover, true ); - break; } - else - QWindowsStyle::drawPrimitive( pe, opt, p, w ); + else { + QWindowsStyle::drawPrimitive( pe, opt, p, w ); + } break; } case PE_IndicatorArrowRight: @@ -1462,7 +1510,7 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt, QColor aColor = getColor( Style_Model::pointer_clr ); if ( !(opt->state & State_Enabled ) ) aColor = opt->palette.mid().color(); - if ( opt->state & State_Selected && itemViewOpt && itemViewOpt->showDecorationSelected ) + if ( opt->state & State_Selected && itemViewOpt && itemViewOpt->showDecorationSelected ) aColor = opt->palette.highlightedText().color(); p->setPen( QPen( aColor ) ); @@ -1565,7 +1613,7 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt, drawHoverRect(p, opt->rect, opt->palette.color( QPalette::Window ), aRad, Style_Tools::All, true); else { Style_Tools::shadowRect( p, opt->rect, aRad, LINE_GR_MARGIN, SHADOW, - Style_Tools::All, opt->palette.color( QPalette::Base ), // getColor( Style_Model::fld_light_clr ), + Style_Tools::All, opt->palette.color( QPalette::Base ), // getColor( Style_Model::fld_light_clr ), getColor( Style_Model::fld_dark_clr ), aBrdTopCol, aBrdBotCol, getBoolValue( Style_Model::all_antialized ), false ); } @@ -1574,11 +1622,14 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt, if (const QStyleOptionFrame *panel = qstyleoption_cast(opt)) { QRect rect = panel->rect.adjusted( panel->lineWidth, panel->lineWidth, -panel->lineWidth, -panel->lineWidth); - if (panel->lineWidth > 0) // QLineEdit + if ( w->inherits("QLineEdit") && panel->lineWidth > 0 ) { drawPrimitive( PE_FrameLineEdit, panel, p, w ); - else // not QLineEdit - p->fillRect(rect, panel->palette.brush(QPalette::Base)); - } + } + else { + QColor c = panel->palette.color(QPalette::Base); c.setAlpha(255); + p->fillRect( rect, c ); // panel->palette.brush(QPalette::Base) + } + } } break; } @@ -1727,7 +1778,7 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt, light = base, light_alt = base.dark(110),//AlternateBase color dark = getColor( Style_Model::fld_dark_clr ); - //light.setAlpha( 0 ); // VSR commented: IPAL19262 + light.setAlpha( 0 ); // VSR commented: IPAL19262 QLinearGradient gr_h(r.x(), r.y(), r.right(), r.y()); gr_h.setColorAt( 0.0, dark ); gr_h.setColorAt( aMarg / r.width(), light ); @@ -1739,7 +1790,7 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt, // draw frame p->fillRect( r, base ); p->fillRect( r, gr_h ); - p->fillRect( r, gr_v ); + p->fillRect( r, gr_v ); aPal.setBrush( QPalette::Base, QBrush( light ) ); QLinearGradient gr_alt(r.x(), r.y(), r.right(), r.y()); @@ -1760,6 +1811,10 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt, int Style_Salome::pixelMetric( PixelMetric metric, const QStyleOption* opt, const QWidget* w ) const { + if ( checkDebugLevel(7) ) { + return QWindowsStyle::pixelMetric( metric, opt, w ); + } + int aRes = QWindowsStyle::pixelMetric( metric, opt, w ); switch( metric ) { case PM_SliderLength: { @@ -1787,6 +1842,10 @@ int Style_Salome::pixelMetric( PixelMetric metric, const QStyleOption* opt, QSize Style_Salome::sizeFromContents( ContentsType ct, const QStyleOption* opt, const QSize& contentsSize, const QWidget* w ) const { + if ( checkDebugLevel(8) ) { + return QWindowsStyle::sizeFromContents( ct, opt,contentsSize, w ); + } + QSize sz = QWindowsStyle::sizeFromContents( ct, opt, contentsSize, w ); switch (ct) { case CT_TabBarTab: @@ -1833,6 +1892,10 @@ QSize Style_Salome::sizeFromContents( ContentsType ct, const QStyleOption* opt, QPixmap Style_Salome::standardPixmap(StandardPixmap stPixmap, const QStyleOption *opt, const QWidget *w) const { + if ( checkDebugLevel(9) ) { + return QWindowsStyle::standardPixmap( stPixmap, opt, w ); + } + switch ( stPixmap ) { case SP_DockWidgetCloseButton: @@ -1853,6 +1916,9 @@ QIcon Style_Salome::standardIconImplementation( StandardPixmap standardIcon, const QStyleOption* opt, const QWidget* widget ) const { + if ( checkDebugLevel(10) ) { + return QWindowsStyle::standardIconImplementation( standardIcon, opt, widget ); + } /* switch ( standardIcon ) { @@ -1874,6 +1940,10 @@ QIcon Style_Salome::standardIconImplementation( StandardPixmap standardIcon, int Style_Salome::styleHint( StyleHint hint, const QStyleOption* opt, const QWidget* widget, QStyleHintReturn* returnData ) const { + if ( checkDebugLevel(11) ) { + return QWindowsStyle::styleHint( hint, opt, widget, returnData ); + } + int aRes = QWindowsStyle::styleHint( hint, opt, widget, returnData ); switch( hint ) { case SH_Table_GridLineColor: { @@ -1890,8 +1960,12 @@ int Style_Salome::styleHint( StyleHint hint, const QStyleOption* opt, const QWid } QRect Style_Salome::subControlRect( ComplexControl cc, const QStyleOptionComplex* opt, - SubControl sc, const QWidget* wid ) const + SubControl sc, const QWidget* wid ) const { + if ( checkDebugLevel(12) ) { + return QWindowsStyle::subControlRect( cc, opt, sc, wid ); + } + QRect res = QWindowsStyle::subControlRect( cc, opt, sc, wid ); switch ( cc ) { case CC_SpinBox: { @@ -1977,6 +2051,10 @@ QRect Style_Salome::subControlRect( ComplexControl cc, const QStyleOptionComplex QRect Style_Salome::subElementRect( SubElement se, const QStyleOption* opt, const QWidget* wid ) const { + if ( checkDebugLevel(13) ) { + return QWindowsStyle::subElementRect( se, opt, wid ); + } + QRect res = QWindowsStyle::subElementRect( se, opt, wid ); int aHalfRect = (int)Style_Tools::getMaxRect( res, (int)getDblValue( Style_Model::edit_rad )/2 ); int w = res.width(), h = res.height(); @@ -2010,48 +2088,48 @@ QRect Style_Salome::subElementRect( SubElement se, const QStyleOption* opt, void Style_Salome::updatePaletteColors() { QPalette aPal = QApplication::palette(); - aPal.setColor( QPalette::WindowText, getColor( Style_Model::pal_wtext_clr ) ); - aPal.setColor( QPalette::Button, getColor( Style_Model::button_clr ) ); - aPal.setColor( QPalette::Light, getColor( Style_Model::pal_light_clr ) ); - aPal.setColor( QPalette::Midlight, getColor( Style_Model::pal_light_clr ).light(115) ); - aPal.setColor( QPalette::Dark, getColor( Style_Model::pal_dark_clr ) ); - aPal.setColor( QPalette::Mid, aPal.button().color().dark(150) ); - aPal.setColor( QPalette::Text, getColor( Style_Model::pal_text_clr ) ); - //aPal.setColor( QPalette::BrightText, ); - aPal.setColor( QPalette::ButtonText, getColor( Style_Model::pal_btext_clr ) ); - aPal.setColor( QPalette::Base, getColor( Style_Model::pal_base_clr ) ); - aPal.setColor( QPalette::AlternateBase,getColor( Style_Model::pal_base_clr ).dark( 110 ) ); - aPal.setColor( QPalette::Window, getColor( Style_Model::bg_clr ) ); - //aPal.setColor( QPalette::Shadow, ); - aPal.setColor( QPalette::Highlight, getColor( Style_Model::pal_high_clr ) ); + aPal.setColor( QPalette::WindowText, getColor( Style_Model::pal_wtext_clr ) ); + aPal.setColor( QPalette::Button, getColor( Style_Model::button_clr ) ); + aPal.setColor( QPalette::Light, getColor( Style_Model::pal_light_clr ) ); + aPal.setColor( QPalette::Midlight, getColor( Style_Model::pal_light_clr ).light(115) ); + aPal.setColor( QPalette::Dark, getColor( Style_Model::pal_dark_clr ) ); + aPal.setColor( QPalette::Mid, aPal.color( QPalette::Active, QPalette::Button ).dark(150) ); + aPal.setColor( QPalette::Text, getColor( Style_Model::pal_text_clr ) ); + //aPal.setColor( QPalette::BrightText, ??? ); + aPal.setColor( QPalette::ButtonText, getColor( Style_Model::pal_btext_clr ) ); + aPal.setColor( QPalette::Base, getColor( Style_Model::pal_base_clr ) ); + aPal.setColor( QPalette::AlternateBase, getColor( Style_Model::pal_base_clr ).dark( 110 ) ); + aPal.setColor( QPalette::Window, getColor( Style_Model::bg_clr ) ); + //aPal.setColor( QPalette::Shadow, ??? ); + QColor hc = getColor( Style_Model::pal_high_clr ); + hc.setAlpha(100); + aPal.setColor( QPalette::Highlight, hc ); aPal.setColor( QPalette::HighlightedText, getColor( Style_Model::pal_high_text_clr ) ); - //aPal.setColor( QPalette::Link, Qt::blue ); - //aPal.setColor( QPalette::LinkVisited, Qt::magenta ); - - // dependence colors - aPal.setColor(QPalette::Inactive, QPalette::Button, aPal.button().color()); - aPal.setColor(QPalette::Inactive, QPalette::Window, aPal.background().color()); - aPal.setColor(QPalette::Inactive, QPalette::Light, aPal.light().color()); - aPal.setColor(QPalette::Inactive, QPalette::Dark, aPal.dark().color()); + //aPal.setColor( QPalette::Link, ??? ); + //aPal.setColor( QPalette::LinkVisited, ??? ); + + // dependant colors if (aPal.midlight() == aPal.button()) - aPal.setColor(QPalette::Midlight, aPal.button().color().light(110)); - if (aPal.background() != aPal.base()) { - aPal.setColor(QPalette::Inactive, QPalette::Highlight, aPal.color(QPalette::Inactive, QPalette::Window)); + aPal.setColor(QPalette::Inactive, QPalette::Midlight, aPal.color(QPalette::Active, QPalette::Button).light(110)); + if (aPal.window() != aPal.base()) { + QColor hc1 = aPal.color(QPalette::Inactive, QPalette::Window); + hc1.setAlpha(100); + aPal.setColor(QPalette::Inactive, QPalette::Highlight, hc1); aPal.setColor(QPalette::Inactive, QPalette::HighlightedText, aPal.color(QPalette::Inactive, QPalette::Text)); } - const QColor bg = aPal.background().color(); - const QColor fg = aPal.foreground().color(), btn = aPal.button().color(); + const QColor bg = aPal.window().color(); + const QColor fg = aPal.windowText().color(); + const QColor btn = aPal.button().color(); + QColor disabled((fg.red()+btn.red())/2,(fg.green()+btn.green())/2, (fg.blue()+btn.blue())/2); - aPal.setColorGroup(QPalette::Disabled, aPal.foreground(), aPal.button(), aPal.light(), - aPal.dark(), aPal.mid(), aPal.text(), aPal.brightText(), aPal.base(), aPal.background() ); - aPal.setColor(QPalette::Disabled, QPalette::WindowText, disabled); - aPal.setColor(QPalette::Disabled, QPalette::Text, disabled); - aPal.setColor(QPalette::Disabled, QPalette::ButtonText, disabled); - aPal.setColor(QPalette::Disabled, QPalette::Highlight, aPal.highlight().color() ); - aPal.setColor(QPalette::Disabled, QPalette::HighlightedText, aPal.highlightedText().color() ); - aPal.setColor(QPalette::Disabled, QPalette::Base, bg); + + aPal.setColor(QPalette::Disabled, QPalette::WindowText, disabled); + aPal.setColor(QPalette::Disabled, QPalette::Text, disabled); + aPal.setColor(QPalette::Disabled, QPalette::ButtonText, disabled); + aPal.setColor(QPalette::Disabled, QPalette::Base, bg); + QApplication::setPalette( aPal ); QColor aWndCol = myTTipWnd, @@ -2095,7 +2173,7 @@ void Style_Salome::updateAllWidgets( QApplication* app ) for (QWidgetList::ConstIterator it2 = all.constBegin(); it2 != all.constEnd(); ++it2) { w = *it2; if (w->windowType() != Qt::Desktop && w->testAttribute(Qt::WA_WState_Polished) - && !w->testAttribute(Qt::WA_SetStyle)) { + && !w->testAttribute(Qt::WA_SetStyle)) { QEvent e(QEvent::StyleChange); QApplication::sendEvent(w, &e); polish( w ); -- 2.39.2