Salome HOME
debug
authorasl <asl@opencascade.com>
Wed, 20 Jul 2005 11:28:10 +0000 (11:28 +0000)
committerasl <asl@opencascade.com>
Wed, 20 Jul 2005 11:28:10 +0000 (11:28 +0000)
src/Qtx/QtxListResourceEdit.cxx
src/Qtx/QtxResourceMgr.cxx

index bb6bfccaf5944f2d9ef384e79a47a9e9d701b963..de13a8e598e77ba4e15024de4b5d79a7093a909e 100644 (file)
@@ -16,7 +16,7 @@
 #include <qobjectlist.h>
 #include <qcolordialog.h>
 #include <qwidgetstack.h>
-#include <qpushbutton.h>
+#include <qtoolbutton.h>
 #include <qfontdialog.h>
 
 #include "QtxIntSpinBox.h"
@@ -819,7 +819,13 @@ QtxListResourceEdit::FontItem::FontItem( const QString& title, QtxResourceEdit*
 {
   new QLabel( title, this );
   myFontPrs = new QLabel( "", this );
-  QPushButton* selFont = new QPushButton( "..", this );
+  myFontPrs->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+  myFontPrs->setAutoResize( true );
+  myFontPrs->setAlignment( Qt::AlignLeft );
+  
+  QToolButton* selFont = new QToolButton( this );
+  selFont->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ) );
+  selFont->setText( "..." );
   connect( selFont, SIGNAL( clicked() ), this, SLOT( onSelectFont() ) );
 }
 
index 917037bb47a1b457793d47197e23939d23afa50e..e23905a24dcb28b3761cfb211587d7c1568eddfc 100644 (file)
@@ -758,8 +758,8 @@ bool QtxResourceMgr::value( const QString& sect, const QString& name, QColor& cV
 
 bool QtxResourceMgr::value( const QString& sect, const QString& name, QFont& fVal ) const
 {
-  QString val = stringValue( sect, name, "" ).stripWhiteSpace();
-  QStringList font_values = QStringList::split( val, "," );
+  QString val = stringValue( sect, name, "" );
+  QStringList font_values = QStringList::split( ",", val );
   if( font_values.count()<2 || font_values.count()>4 )
     return false;
   
@@ -768,13 +768,14 @@ bool QtxResourceMgr::value( const QString& sect, const QString& name, QFont& fVa
   int pSize = -1;
   for( int i=1, n=font_values.count(); i<n; i++ )
   {
-    if( !isBold && font_values[i].lower()=="bold" )
+    QString curval = font_values[i].stripWhiteSpace().lower();
+    if( !isBold && curval=="bold" )
       isBold = true;
-    else if( !isItalic && font_values[i].lower()=="italic" )
+    else if( !isItalic && curval=="italic" )
       isItalic = true;
     else if( pSize<0 )
     {
-      pSize = font_values[i].toInt( &isOk );
+      pSize = curval.toInt( &isOk );
       if( !isOk )
         pSize = -1;
     }