#include <qobjectlist.h>
#include <qcolordialog.h>
#include <qwidgetstack.h>
-#include <qpushbutton.h>
+#include <qtoolbutton.h>
#include <qfontdialog.h>
#include "QtxIntSpinBox.h"
{
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() ) );
}
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;
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;
}