From: apo Date: Fri, 13 Jan 2006 06:29:27 +0000 (+0000) Subject: Adjust to OCC_development_generic_2006 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=32d8305bf53162abfa7310097689bb1ad3eea1fd;p=modules%2Fgui.git Adjust to OCC_development_generic_2006 --- diff --git a/src/CAF/CAF_Tools.cxx b/src/CAF/CAF_Tools.cxx index 41b56f6e1..c32d4a27e 100755 --- a/src/CAF/CAF_Tools.cxx +++ b/src/CAF/CAF_Tools.cxx @@ -29,7 +29,26 @@ */ QString CAF_Tools::toQString ( const TCollection_ExtendedString& src ) { - return QString( (const QChar*)src.ToExtString(), src.Length() ); + return QString( (const QChar*)src.ToExtString(), src.Length() ); +} + +/*! + Converts TCollection_AsciiString'src' to Qt string. [ static ] +*/ +QString CAF_Tools::toQString( const TCollection_AsciiString& src ) +{ + return QString( src.ToCString() ); +} + +/*! + Converts Qt string to TCollection_AsciiString. [ static ] +*/ +TCollection_AsciiString CAF_Tools::toAsciiString( const QString& src ) +{ + TCollection_AsciiString res; + if ( !src.isEmpty() ) + res = TCollection_AsciiString( (char*)src.latin1() ); + return res; } /*! @@ -37,8 +56,24 @@ QString CAF_Tools::toQString ( const TCollection_ExtendedString& src ) */ TCollection_ExtendedString CAF_Tools::toExtString ( const QString& src ) { - TCollection_ExtendedString result; - for ( int i = 0; i < (int)src.length(); i++ ) - result.Insert( i + 1, src[ i ].unicode() ); - return result; + TCollection_ExtendedString result; + for ( int i = 0; i < (int)src.length(); i++ ) + result.Insert( i + 1, src[ i ].unicode() ); + return result; +} + +Quantity_Color CAF_Tools::color( const QColor& c ) +{ + Quantity_Color aColor; + if ( c.isValid() ) + aColor = Quantity_Color( c.red() / 255., c.green() / 255., + c.blue() / 255., Quantity_TOC_RGB ); + return aColor; +} + +QColor CAF_Tools::color( const Quantity_Color& c ) +{ + return QColor ( int( c.Red() * 255 ), + int( c.Green() * 255 ), + int( c.Blue() * 255 ) ); } diff --git a/src/CAF/CAF_Tools.h b/src/CAF/CAF_Tools.h index 8af84f9fe..e04d1c9d8 100755 --- a/src/CAF/CAF_Tools.h +++ b/src/CAF/CAF_Tools.h @@ -26,13 +26,24 @@ #include +#include + +#include + +#include #include class CAF_EXPORT CAF_Tools : public SUIT_Tools { public: + static QString toQString( const TCollection_AsciiString& ); static QString toQString( const TCollection_ExtendedString& ); + static TCollection_ExtendedString toExtString( const QString& ); + static TCollection_AsciiString toAsciiString( const QString& ); + + static Quantity_Color color( const QColor& ); + static QColor color( const Quantity_Color& ); }; #endif diff --git a/src/DDS/DDS_DicGroup.cxx b/src/DDS/DDS_DicGroup.cxx index 40f42a317..ac7f4ad6b 100644 --- a/src/DDS/DDS_DicGroup.cxx +++ b/src/DDS/DDS_DicGroup.cxx @@ -110,7 +110,7 @@ void DDS_DicGroup::FillDataMap( const LDOM_Element& theComponentData, const LDOM Handle(DDS_DicItem) aDicItem = new DDS_DicItem(); aDicItem->myComponent = this; - aDicItem->FillDataMap( anID, aQuantity, theDocElement, unitSystems ); + aDicItem->FillDataMap( anID, aQuantity, theComponentData, theDocElement, unitSystems ); myDataMap.Add( anID, aDicItem ); } } diff --git a/src/DDS/DDS_DicItem.cxx b/src/DDS/DDS_DicItem.cxx index 68e19dfd2..fd59f3cd6 100644 --- a/src/DDS/DDS_DicItem.cxx +++ b/src/DDS/DDS_DicItem.cxx @@ -309,7 +309,8 @@ Standard_Real DDS_DicItem::FromSI( const Standard_Real theVal, const UnitSystem& Parse record in XML file and retrieve information relevant for this data dic item */ void DDS_DicItem::FillDataMap( TCollection_AsciiString theID, const LDOM_Element& theDatum, - const LDOM_Element& theDocElement, const TColStd_SequenceOfAsciiString& theSystems ) + const LDOM_Element& theCompElement, const LDOM_Element& theDocElement, + const TColStd_SequenceOfAsciiString& theSystems ) { TCollection_AsciiString aLabel = theDatum.getAttribute( DDS_Dictionary::KeyWord( "DATUM_LABEL" ) ); TCollection_AsciiString aFormat = theDatum.getAttribute( DDS_Dictionary::KeyWord( "DATUM_FORMAT" ) ); @@ -462,32 +463,43 @@ void DDS_DicItem::FillDataMap( TCollection_AsciiString theID, const LDOM_Element LDOMString aListId = aListRef.getAttribute( DDS_Dictionary::KeyWord( "VLR_LIST" ) ); aDefV = aListRef.getAttribute( DDS_Dictionary::KeyWord( "VD_DEFV" ) ); aDefV.RemoveAll( ' ' ); - for ( LDOM_Element aListItem = theDocElement.GetChildByTagName( DDS_Dictionary::KeyWord( "VALUE_LIST" ) ); - aListItem != NULL; aListItem = aListItem.GetSiblingByTagName() ) + LDOM_Element foundListItem; + for ( LDOM_Element aListItem = theCompElement.GetChildByTagName( DDS_Dictionary::KeyWord( "VALUE_LIST" ) ); + aListItem != NULL && foundListItem == NULL; aListItem = aListItem.GetSiblingByTagName() ) { if ( aListItem.getAttribute( DDS_Dictionary::KeyWord( "VALUE_LIST_ID" ) ).equals( aListId ) ) + foundListItem = aListItem; + + } + for ( LDOM_Element aLstItem = theDocElement.GetChildByTagName( DDS_Dictionary::KeyWord( "VALUE_LIST" ) ); + aLstItem != NULL && foundListItem == NULL; aLstItem = aLstItem.GetSiblingByTagName() ) + { + if ( aLstItem.getAttribute( DDS_Dictionary::KeyWord( "VALUE_LIST_ID" ) ).equals( aListId ) ) + foundListItem = aLstItem; + } + + if ( foundListItem != NULL ) + { + // The appropriate list of values is found: store the list name + aListName = foundListItem.getAttribute( DDS_Dictionary::KeyWord( "VALUE_LIST_NAME" ) ); + // Iteration through the list of values + LDOM_Element aListItemValue = foundListItem.GetChildByTagName( DDS_Dictionary::KeyWord( "VALUE_LIST_VALUE" ) ); + while ( aListItemValue != NULL ) { - // The appropriate list of values is found: store the list name - aListName = aListItem.getAttribute( DDS_Dictionary::KeyWord( "VALUE_LIST_NAME" ) ); - // Iteration through the list of values - LDOM_Element aListItemValue = aListItem.GetChildByTagName( DDS_Dictionary::KeyWord( "VALUE_LIST_VALUE" ) ); - while ( aListItemValue != NULL ) + // read value ID + TCollection_AsciiString aListValueID = aListItemValue.getAttribute( DDS_Dictionary::KeyWord( "VALUE_LIST_VALUEID" ) ); + if ( aListValueID.IsIntegerValue() ) { - // read value ID - TCollection_AsciiString aListValueID = aListItemValue.getAttribute( DDS_Dictionary::KeyWord( "VALUE_LIST_VALUEID" ) ); - if ( aListValueID.IsIntegerValue() ) + // Read the text in the element "value" + LDOM_Text aListItemTxt = (const LDOM_Text&)aListItemValue.getFirstChild(); + if ( !aListItemTxt.isNull() ) { - // Read the text in the element "value" - LDOM_Text aListItemTxt = (const LDOM_Text&)aListItemValue.getFirstChild(); - if ( !aListItemTxt.isNull() ) - { - // adding ID and text value to sequence - aSeqOfValueID.Append( aListValueID.IntegerValue() ); - aSeqOfValue.Append( aListItemTxt.getData() ); - // adding icon file name (optional) to sequence - TCollection_ExtendedString aListValueIcon = aListItemValue.getAttribute( DDS_Dictionary::KeyWord( "VALUE_LIST_VALUEICON" ) ); - aSeqOfValueIconName.Append( aListValueIcon ); - } + // adding ID and text value to sequence + aSeqOfValueID.Append( aListValueID.IntegerValue() ); + aSeqOfValue.Append( aListItemTxt.getData() ); + // adding icon file name (optional) to sequence + TCollection_ExtendedString aListValueIcon = aListItemValue.getAttribute( DDS_Dictionary::KeyWord( "VALUE_LIST_VALUEICON" ) ); + aSeqOfValueIconName.Append( aListValueIcon ); } aListItemValue = aListItemValue.GetSiblingByTagName(); } diff --git a/src/DDS/DDS_DicItem.h b/src/DDS/DDS_DicItem.h index d57eaf068..871149407 100644 --- a/src/DDS/DDS_DicItem.h +++ b/src/DDS/DDS_DicItem.h @@ -141,8 +141,8 @@ private: void operator=( const DDS_DicItem& ); // Assignment operator - void FillDataMap( TCollection_AsciiString, - const LDOM_Element&,const LDOM_Element&, + void FillDataMap( TCollection_AsciiString, const LDOM_Element&, + const LDOM_Element&, const LDOM_Element&, const TColStd_SequenceOfAsciiString& ); // prepares formants for each unit systems diff --git a/src/GLViewer/GLViewer_Drawer.cxx b/src/GLViewer/GLViewer_Drawer.cxx index 841fb6b84..3ebadab54 100644 --- a/src/GLViewer/GLViewer_Drawer.cxx +++ b/src/GLViewer/GLViewer_Drawer.cxx @@ -33,6 +33,8 @@ #include #endif +#include + #include #include @@ -846,3 +848,224 @@ bool GLViewer_Drawer::translateToEMF( HDC hDC, GLViewer_CoordSystem* aViewerCS, return result; } #endif + +//====================================================================== +// Function: drawRectangle +// Purpose : +//======================================================================= +void GLViewer_Drawer::drawRectangle( GLViewer_Rect* rect, GLfloat lineWidth, GLfloat gap, + QColor color, bool filled, QColor fillingColor ) +{ + if( !rect ) + return; + + float x1 = rect->left() - gap; + float x2 = rect->right() + gap; + float y1 = rect->bottom() - gap; + float y2 = rect->top() + gap; + + if( filled ) + { + glColor3f( ( GLfloat )fillingColor.red() / 255, + ( GLfloat )fillingColor.green() / 255, + ( GLfloat )fillingColor.blue() / 255 ); + glBegin( GL_POLYGON ); + glVertex2f( x1, y1 ); + glVertex2f( x1, y2 ); + glVertex2f( x2, y2 ); + glVertex2f( x2, y1 ); + glEnd(); + } + + glColor3f( ( GLfloat )color.red() / 255, + ( GLfloat )color.green() / 255, + ( GLfloat )color.blue() / 255 ); + glLineWidth( lineWidth ); + + glBegin( GL_LINE_LOOP ); + glVertex2f( x1, y1 ); + glVertex2f( x1, y2 ); + glVertex2f( x2, y2 ); + glVertex2f( x2, y1 ); + glEnd(); +} + +//====================================================================== +// Function: drawContour +// Purpose : +//======================================================================= +void GLViewer_Drawer::drawContour( const GLViewer_PntList& pntList, QColor color, GLfloat lineWidth ) +{ + glColor3f( ( GLfloat )color.red() / 255, + ( GLfloat )color.green() / 255, + ( GLfloat )color.blue() / 255 ); + glLineWidth( lineWidth ); + + glBegin( GL_LINES ); + QValueList::const_iterator it = pntList.begin(); + for( ; it != pntList.end(); ++it ) + glVertex2f( (*it).x(), (*it).y() ); + glEnd(); +} + +//====================================================================== +// Function: drawContour +// Purpose : +//======================================================================= +void GLViewer_Drawer::drawContour( GLViewer_Rect* rect, QColor color, GLfloat lineWidth, + GLushort pattern, bool isStripe ) +{ + float x1 = rect->left(); + float x2 = rect->right(); + float y1 = rect->bottom(); + float y2 = rect->top(); + + glColor3f( ( GLfloat )color.red() / 255, + ( GLfloat )color.green() / 255, + ( GLfloat )color.blue() / 255 ); + glLineWidth( lineWidth ); + + if ( isStripe ) + { + glEnable( GL_LINE_STIPPLE ); + glLineStipple( 1, pattern ); + } + + glBegin( GL_LINE_LOOP ); + + glVertex2f( x1, y1 ); + glVertex2f( x1, y2 ); + glVertex2f( x2, y2 ); + glVertex2f( x2, y1 ); + + glEnd(); + glDisable( GL_LINE_STIPPLE ); +} + +//====================================================================== +// Function: drawPolygon +// Purpose : +//======================================================================= +void GLViewer_Drawer::drawPolygon( const GLViewer_PntList& pntList, QColor color ) +{ + glColor3f( ( GLfloat )color.red() / 255, + ( GLfloat )color.green() / 255, + ( GLfloat )color.blue() / 255 ); + glBegin( GL_POLYGON ); + QValueList::const_iterator it = pntList.begin(); + for( ; it != pntList.end(); ++it ) + glVertex2f( (*it).x(), (*it).y() ); + glEnd(); +} + +//====================================================================== +// Function: drawPolygon +// Purpose : +//======================================================================= +void GLViewer_Drawer::drawPolygon( GLViewer_Rect* rect, QColor color, + GLushort pattern, bool isStripe ) +{ + float x1 = rect->left(); + float x2 = rect->right(); + float y1 = rect->bottom(); + float y2 = rect->top(); + glColor3f( ( GLfloat )color.red() / 255, + ( GLfloat )color.green() / 255, + ( GLfloat )color.blue() / 255 ); + + if ( isStripe ) + { + glEnable( GL_LINE_STIPPLE ); + glLineStipple( 1, pattern ); + } + glBegin( GL_POLYGON ); + + glVertex2f( x1, y1 ); + glVertex2f( x1, y2 ); + glVertex2f( x2, y2 ); + glVertex2f( x2, y1 ); + + glEnd(); + glDisable( GL_LINE_STIPPLE ); +} + +//====================================================================== +// Function: drawVertex +// Purpose : +//======================================================================= +GLubyte rasterVertex[5] = { 0x70, 0xf8, 0xf8, 0xf8, 0x70 }; +void GLViewer_Drawer::drawVertex( GLfloat x, GLfloat y, QColor color ) +{ + glColor3f( ( GLfloat )color.red() / 255, ( GLfloat )color.green() / 255, ( GLfloat )color.blue() / 255 ); + glRasterPos2f( x, y ); + glBitmap( 5, 5, 2, 2, 0, 0, rasterVertex ); +} + +//====================================================================== +// Function: drawCross +// Purpose : +//======================================================================= +GLubyte rasterCross[7] = { 0x82, 0x44, 0x28, 0x10, 0x28, 0x44, 0x82 }; +void GLViewer_Drawer::drawCross( GLfloat x, GLfloat y, QColor color ) +{ + glColor3f( ( GLfloat )color.red() / 255, ( GLfloat )color.green() / 255, ( GLfloat )color.blue() / 255 ); + glRasterPos2f( x, y ); + glBitmap( 7, 7, 3, 3, 0, 0, rasterCross ); +} + +//====================================================================== +// Function: drawArrow +// Purpose : +//======================================================================= +void GLViewer_Drawer::drawArrow( const GLfloat red, const GLfloat green, const GLfloat blue, + GLfloat lineWidth, + GLfloat staff, GLfloat length, GLfloat width, + GLfloat x, GLfloat y, GLfloat angle, GLboolean filled ) +{ + GLfloat vx1 = x; + GLfloat vy1 = y + staff + length; + GLfloat vx2 = vx1 - width / 2; + GLfloat vy2 = vy1 - length; + GLfloat vx3 = vx1 + width / 2; + GLfloat vy3 = vy1 - length; + + gp_Pnt2d p0( x, y ); + gp_Pnt2d p1( vx1, vy1 ); + gp_Pnt2d p2( vx2, vy2 ); + gp_Pnt2d p3( vx3, vy3 ); + + p1.Rotate( p0, angle ); + p2.Rotate( p0, angle ); + p3.Rotate( p0, angle ); + + vx1 = p1.X(); vy1 = p1.Y(); + vx2 = p2.X(); vy2 = p2.Y(); + vx3 = p3.X(); vy3 = p3.Y(); + + glColor3f( red, green, blue ); + glLineWidth( lineWidth ); + + glBegin( GL_LINES ); + glVertex2f( x, y ); + glVertex2f( vx1, vy1 ); + glEnd(); + + filled = true; + if( !filled ) + { + glBegin( GL_LINES ); + glVertex2f( vx1, vy1 ); + glVertex2f( vx2, vy2 ); + glVertex2f( vx1, vy1 ); + glVertex2f( vx3, vy3 ); + glEnd(); + } + else + { + glBegin( GL_POLYGON ); + glVertex2f( vx1, vy1 ); + glVertex2f( vx2, vy2 ); + glVertex2f( vx3, vy3 ); + glEnd(); + } +} diff --git a/src/GLViewer/GLViewer_Drawer.h b/src/GLViewer/GLViewer_Drawer.h index 56bbdbbec..d773d3bd2 100644 --- a/src/GLViewer/GLViewer_Drawer.h +++ b/src/GLViewer/GLViewer_Drawer.h @@ -39,6 +39,7 @@ #include "GLViewer.h" #include "GLViewer_Defs.h" +#include "GLViewer_Geom.h" class GLViewer_Object; class GLViewer_Rect; @@ -368,6 +369,20 @@ public: static void drawRectangle( GLViewer_Rect* theRect, QColor = Qt::black ); protected: + //! Draw basic primitives: rectangle, contour, polygon, vertex, cross, arrow + //* with predefined color + static void drawRectangle( GLViewer_Rect*, GLfloat, GLfloat = 0, QColor = Qt::black, + bool = false, QColor = Qt::white ); + static void drawContour( GLViewer_Rect*, QColor, GLfloat, GLushort, bool ); + static void drawContour( const GLViewer_PntList&, QColor, GLfloat ); + static void drawPolygon( GLViewer_Rect*, QColor, GLushort, bool ); + static void drawPolygon( const GLViewer_PntList&, QColor ); + static void drawVertex( GLfloat, GLfloat, QColor ); + static void drawCross( GLfloat, GLfloat, QColor ); + static void drawArrow( const GLfloat red, const GLfloat green, const GLfloat blue, + GLfloat, GLfloat, GLfloat, GLfloat, + GLfloat, GLfloat, GLfloat, GLboolean = GL_FALSE ); + //! Draw object text virtual void drawText( GLViewer_Object* theObject ); diff --git a/src/Qtx/QtxActionMenuMgr.cxx b/src/Qtx/QtxActionMenuMgr.cxx index d49bbf482..7782a7b57 100644 --- a/src/Qtx/QtxActionMenuMgr.cxx +++ b/src/Qtx/QtxActionMenuMgr.cxx @@ -143,7 +143,7 @@ myMenu( mw ) QtxActionMenuMgr::~QtxActionMenuMgr() { - for ( NodeListIterator it( myRoot.children ); it.current(); ++it ) + for ( NodeListIterator it( myRoot.children ); it.current() && myMenu; ++it ) { QAction* a = itemAction( it.current()->id ); if ( !a ) diff --git a/src/Qtx/QtxActionMgr.h b/src/Qtx/QtxActionMgr.h index 4cd9f2e38..60fc342c0 100644 --- a/src/Qtx/QtxActionMgr.h +++ b/src/Qtx/QtxActionMgr.h @@ -26,6 +26,7 @@ #include #include +#include class QAction; class QDomNode; @@ -81,7 +82,8 @@ protected: int generateId() const; private: - typedef QMap ActionMap; + typedef QGuardedPtr ActionPtr; + typedef QMap ActionMap; private: bool myUpdate; diff --git a/src/Qtx/QtxListResourceEdit.cxx b/src/Qtx/QtxListResourceEdit.cxx index 75e74e998..60a5fbe4c 100644 --- a/src/Qtx/QtxListResourceEdit.cxx +++ b/src/Qtx/QtxListResourceEdit.cxx @@ -168,6 +168,8 @@ void QtxListResourceEdit::updateState() myStack->show(); else myStack->hide(); + + myList->setShown( myList->count() > 1 ); } void QtxListResourceEdit::updateVisible() diff --git a/src/Qtx/QtxMRUAction.h b/src/Qtx/QtxMRUAction.h index 12a87e024..debd6bdfb 100755 --- a/src/Qtx/QtxMRUAction.h +++ b/src/Qtx/QtxMRUAction.h @@ -38,9 +38,11 @@ class QTX_EXPORT QtxMRUAction : public QtxAction { Q_OBJECT + Q_PROPERTY( int visibleCount READ visibleCount WRITE setVisibleCount ) + public: - typedef enum { Items, SubMenu } PopupMode; - typedef enum { MoveFirst, MoveLast, AddFirst, AddLast } InsertMode; + enum { Items, SubMenu }; + enum { MoveFirst, MoveLast, AddFirst, AddLast }; public: QtxMRUAction( QObject* = 0, const char* = 0 ); diff --git a/src/Qtx/QtxResourceEdit.cxx b/src/Qtx/QtxResourceEdit.cxx index e1c9e7538..e499236ff 100644 --- a/src/Qtx/QtxResourceEdit.cxx +++ b/src/Qtx/QtxResourceEdit.cxx @@ -35,8 +35,13 @@ QtxResourceEdit::QtxResourceEdit( QtxResourceMgr* mgr ) QtxResourceEdit::~QtxResourceEdit() { + ItemMap items; for ( ItemMap::ConstIterator it = myItems.begin(); it != myItems.end(); ++it ) - delete it.data(); + items.insert( it.key(), it.data() ); + + for ( ItemMap::ConstIterator itr = items.begin(); itr != items.end(); ++itr ) + if ( myItems.contains( itr.key() ) ) + delete itr.data(); } QtxResourceMgr* QtxResourceEdit::resourceMgr() const diff --git a/src/SUIT/SUIT_DataOwner.h b/src/SUIT/SUIT_DataOwner.h index 8f8caadff..cbc5b8464 100755 --- a/src/SUIT/SUIT_DataOwner.h +++ b/src/SUIT/SUIT_DataOwner.h @@ -25,6 +25,7 @@ #include #ifdef WIN32 +#pragma warning( disable:4251 ) #pragma warning( disable:4275 ) #endif @@ -81,6 +82,7 @@ private: }; #ifdef WIN32 +#pragma warning( default:4251 ) #pragma warning( default:4275 ) #endif diff --git a/src/Style/SalomeStyle.cxx b/src/Style/SalomeStyle.cxx index bcdc6f1ac..8126eb8ec 100644 --- a/src/Style/SalomeStyle.cxx +++ b/src/Style/SalomeStyle.cxx @@ -422,33 +422,33 @@ void SalomeStyle::drawPrimitive( PrimitiveElement pe, QPainter* p, const QRect& drawGradient( p, rr, act ? cg.highlight() : cg.dark(), col, horiz ? LeftToRight : UpToDown, linear ); - - QRect rt = rr; - if ( flags & Style_Horizontal ) - rt.addCoords( 0, 20, 0, 0 ); - else - rt.addCoords( 0, 0, -20, 0 ); - - int textW = flags & Style_Horizontal ? rt.height() : rt.width(); - int textH = flags & Style_Horizontal ? rt.width() : rt.height(); - - QString title = titleText( wnd->caption(), textW, p->fontMetrics() ); - - if ( wnd ) - { - QColorGroup cgroup = wnd->isActiveWindow() ? wnd->palette().active() : wnd->palette().inactive(); - p->setPen( cgroup.highlightedText() ); - - if ( flags & Style_Horizontal ) - { - p->rotate( 270.0 ); - p->translate( -(rt.height()+rt.y()), (rt.width()-rt.x()) ); - p->drawText( 0, 0, title ); - } - else - p->drawText( 2, 2, textW, textH, AlignLeft, title ); - } - } + + QRect rt = rr; + if ( flags & Style_Horizontal ) + rt.addCoords( 0, 20, 0, 0 ); + else + rt.addCoords( 0, 0, -20, 0 ); + + int textW = flags & Style_Horizontal ? rt.height() : rt.width(); + int textH = flags & Style_Horizontal ? rt.width() : rt.height(); + + QString title = titleText( wnd->caption(), textW, p->fontMetrics() ); + + if ( wnd ) + { + QColorGroup cgroup = wnd->isActiveWindow() ? wnd->palette().active() : wnd->palette().inactive(); + p->setPen( cgroup.highlightedText() ); + + if ( flags & Style_Horizontal ) + { + p->rotate( 270.0 ); + p->translate( -(rt.height()+rt.y()), (rt.width()-rt.x()) ); + p->drawText( 0, 0, title ); + } + else + p->drawText( 2, 2, textW, textH, AlignLeft, title ); + } + } break; } @@ -1013,10 +1013,10 @@ void SalomeStyle::drawControl( ControlElement element, QPainter* p, const QWidge r2.setRect( r2.left(), r2.top(), r2.width() - 2, r2.height() - 1 ); p->setPen( cg.foreground() ); - drawGradient( p, QRect( r2.left(), r2.top(), r2.width(), r2.height() - 1 ), - selected ? cg.highlight() : cg.dark(), cg.background(), UpToDown, linear ); + drawGradient( p, QRect( r2.left(), r2.top(), r2.width(), r2.height() - 1 ), + selected ? cg.highlight() : cg.dark(), cg.background(), UpToDown, linear ); -// p->fillRect( r2.left(), r2.top(), r2.width(), r2.height() - 1, selected ? cg.highlight() : cg.background() ); +// p->fillRect( r2.left(), r2.top(), r2.width(), r2.height() - 1, selected ? cg.highlight() : cg.background() ); p->drawRect( r2.left(), r2.top(), r2.width(), r2.height() - 1 ); if ( selected ) @@ -1028,15 +1028,15 @@ void SalomeStyle::drawControl( ControlElement element, QPainter* p, const QWidge break; } - - case CE_TabBarLabel: - { - QColorGroup tmp( cg ); - if ( flags & Style_Selected ) - tmp.setColor( QColorGroup::Foreground, tmp.highlightedText() ); - PARENT_STYLE::drawControl( element, p, widget, r, tmp, flags, opt ); - } - break; + + case CE_TabBarLabel: + { + QColorGroup tmp( cg ); + if ( flags & Style_Selected ) + tmp.setColor( QColorGroup::Foreground, tmp.highlightedText() ); + PARENT_STYLE::drawControl( element, p, widget, r, tmp, flags, opt ); + } + break; case CE_PushButton: {