#include "QtxListResourceEdit.h"
#include <qhbox.h>
+#include <qvbox.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qlistbox.h>
: QFrame( parent ),
QtxResourceEdit( mgr )
{
- QHBoxLayout* main = new QHBoxLayout( this, 0, 5 );
+ QVBoxLayout* main = new QVBoxLayout( this, 0, 5 );
+ QGroupBox* base = new QGroupBox( 1, Qt::Vertical, "", this );
+ base->setFrameStyle( QFrame::NoFrame );
+ base->setInsideMargin( 0 );
+ main->addWidget( base );
- myList = new QListBox( this );
- myStack = new QWidgetStack( this );
+ myList = new QListBox( base );
+ myStack = new QWidgetStack( base );
- myList->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) );
+ myList->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Preferred ) );
myStack->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred ) );
- main->addWidget( myList );
- main->addWidget( myStack );
-
myList->setSelectionMode( QListBox::Single );
connect( myList, SIGNAL( selectionChanged() ), this, SLOT( onSelectionChanged() ) );
Item( edit, pItem )
{
QVBoxLayout* main = new QVBoxLayout( this );
- myMainFrame = new QGroupBox( 1, Qt::Horizontal, "", this );
- myMainFrame->setFrameStyle( QFrame::NoFrame );
- myMainFrame->setInsideMargin( 5 );
+ QVBox* vbox = new QVBox( this );
+ vbox->setMargin( 5 );
+ myMainFrame = vbox;
main->addWidget( myMainFrame );
+ main->addStretch( 1 );
}
QtxListResourceEdit::Tab::~Tab()
case String:
item = new StringItem( title, resourceEdit(), this, this );
break;
- case List:
+ case Selector:
item = new ListItem( title, resourceEdit(), this, this );
break;
- case RealSpin:
+ case DblSpin:
item = new DoubleSpinItem( title, resourceEdit(), this, this );
break;
- case IntegerSpin:
+ case IntSpin:
item = new IntegerSpinItem( title, resourceEdit(), this, this );
break;
- case RealEdit:
+ case Double:
item = new DoubleEditItem( title, resourceEdit(), this, this );
break;
- case IntegerEdit:
+ case Integer:
item = new IntegerEditItem( title, resourceEdit(), this, this );
break;
case Space:
QtxListResourceEdit::ListItem::ListItem( const QString& title, QtxResourceEdit* edit,
Item* pItem, QWidget* parent )
-: PrefItem( List, edit, pItem, parent )
+: PrefItem( Selector, edit, pItem, parent )
{
new QLabel( title, this );
myList = new QComboBox( false, this );
- myList->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred ) );
+ myList->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
}
QtxListResourceEdit::ListItem::~ListItem()
: PrefItem( Bool, edit, pItem, parent )
{
myState = new QCheckBox( title, this );
- myState->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred ) );
+ myState->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
}
QtxListResourceEdit::StateItem::~StateItem()
{
new QLabel( title, this );
myString = new QLineEdit( this );
- myString->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred ) );
+ myString->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
}
QtxListResourceEdit::StringItem::~StringItem()
*/
QtxListResourceEdit::IntegerEditItem::IntegerEditItem( const QString& title, QtxResourceEdit* edit, Item* pItem, QWidget* parent )
-: PrefItem( IntegerEdit, edit, pItem, parent )
+: PrefItem( Integer, edit, pItem, parent )
{
new QLabel( title, this );
myInteger = new QLineEdit( this );
myInteger->setValidator( new QIntValidator( myInteger ) );
- myInteger->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred ) );
+ myInteger->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
}
QtxListResourceEdit::IntegerEditItem::~IntegerEditItem()
*/
QtxListResourceEdit::IntegerSpinItem::IntegerSpinItem( const QString& title, QtxResourceEdit* edit, Item* pItem, QWidget* parent )
-: PrefItem( IntegerSpin, edit, pItem, parent )
+: PrefItem( IntSpin, edit, pItem, parent )
{
new QLabel( title, this );
myInteger = new QtxIntSpinBox( this );
- myInteger->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred ) );
+ myInteger->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
}
QtxListResourceEdit::IntegerSpinItem::~IntegerSpinItem()
QtxListResourceEdit::DoubleEditItem::DoubleEditItem( const QString& title, QtxResourceEdit* edit,
Item* pItem, QWidget* parent )
-: PrefItem( RealEdit, edit, pItem, parent )
+: PrefItem( Double, edit, pItem, parent )
{
new QLabel( title, this );
myDouble = new QLineEdit( this );
myDouble->setValidator( new QDoubleValidator( myDouble ) );
- myDouble->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred ) );
+ myDouble->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
}
QtxListResourceEdit::DoubleEditItem::~DoubleEditItem()
QtxListResourceEdit::DoubleSpinItem::DoubleSpinItem( const QString& title, QtxResourceEdit* edit,
Item* pItem, QWidget* parent )
-: PrefItem( RealSpin, edit, pItem, parent )
+: PrefItem( DblSpin, edit, pItem, parent )
{
new QLabel( title, this );
myDouble = new QtxDblSpinBox( this );
- myDouble->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred ) );
+ myDouble->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
}
QtxListResourceEdit::DoubleSpinItem::~DoubleSpinItem()
new QLabel( title, this );
myColor = new ColorSelector( this );
- myColor->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred ) );
+ myColor->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
}
QtxListResourceEdit::ColorItem::~ColorItem()