20 #include <QDialogButtonBox>
22 #include <QListWidget>
23 #include <QMessageBox>
26 #include <QStackedWidget>
32 : QDialog( parent, fl ), mOptsKey( settingsKey ), mInit( false )
41 settings.setValue( QString(
"/Windows/%1/geometry" ).arg(
mOptsKey ), saveGeometry() );
42 settings.setValue( QString(
"/Windows/%1/splitState" ).arg(
mOptsKey ),
mOptSplitter->saveState() );
52 layout()->setContentsMargins( 12, 12, 12, 12 );
57 mOptSplitter = findChild<QSplitter*>(
"mOptionsSplitter" );
68 disconnect( mOptButtonBox, SIGNAL( accepted() ),
this, SLOT( accept() ) );
69 connect( mOptButtonBox, SIGNAL( accepted() ),
this, SLOT( accept() ) );
70 disconnect( mOptButtonBox, SIGNAL( rejected() ),
this, SLOT( reject() ) );
71 connect( mOptButtonBox, SIGNAL( rejected() ),
this, SLOT( reject() ) );
91 restoreGeometry( settings.value( QString(
"/Windows/%1/geometry" ).arg(
mOptsKey ) ).toByteArray() );
95 settings.value( QString(
"/Windows/%1/splitState" ).arg(
mOptsKey ) ).isNull() ? 150 : 16777215 );
96 mOptSplitter->restoreState( settings.value( QString(
"/Windows/%1/splitState" ).arg(
mOptsKey ) ).toByteArray() );
97 int curIndx = settings.value( QString(
"/Windows/%1/tab" ).arg(
mOptsKey ), 0 ).toInt();
157 int snapToIconWidth = iconWidth + 32;
160 bool iconOnly = ( splitSizes.at( 0 ) <= snapToIconWidth );
162 int newWidth =
mOptListWidget->verticalScrollBar()->isVisible() ? iconWidth + 26 : iconWidth + 12;
168 if ( iconOnly && ( diffWidth ||
mOptListWidget->width() != newWidth ) )
170 splitSizes[1] = splitSizes.at( 1 ) - ( splitSizes.at( 0 ) - newWidth );
171 splitSizes[0] = newWidth;
195 QMessageBox::warning( 0,
tr(
"Missing objects" ),
196 tr(
"Base options dialog could not be initialized.\n\n"
197 "Missing some of the .ui template objects:\n" )
198 +
" mOptionsListWidget,\n mOptionsStackedWidget,\n mOptionsSplitter",