Changeset View
Changeset View
Standalone View
Standalone View
kstyle/demo/oxygendemodialog.cpp
Show First 20 Lines • Show All 73 Lines • ▼ Show 20 Line(s) | 56 | { | |||
---|---|---|---|---|---|
74 | 74 | | |||
75 | // customize button box | 75 | // customize button box | ||
76 | _enableCheckBox = new QCheckBox( i18n( "Enabled" ) ); | 76 | _enableCheckBox = new QCheckBox( i18n( "Enabled" ) ); | ||
77 | _enableCheckBox->setChecked( true ); | 77 | _enableCheckBox->setChecked( true ); | ||
78 | connect( _enableCheckBox, SIGNAL(toggled(bool)), SLOT(toggleEnable(bool)) ); | 78 | connect( _enableCheckBox, SIGNAL(toggled(bool)), SLOT(toggleEnable(bool)) ); | ||
79 | buttonBox->addButton( _enableCheckBox, QDialogButtonBox::ResetRole ); | 79 | buttonBox->addButton( _enableCheckBox, QDialogButtonBox::ResetRole ); | ||
80 | 80 | | |||
81 | _rightToLeftCheckBox = new QCheckBox( i18n( "Right to left layout" ) ); | 81 | _rightToLeftCheckBox = new QCheckBox( i18n( "Right to left layout" ) ); | ||
82 | _rightToLeftCheckBox->setChecked( qApp->isRightToLeft() ); | ||||
82 | connect( _rightToLeftCheckBox, SIGNAL(toggled(bool)), SLOT(toggleRightToLeft(bool)) ); | 83 | connect( _rightToLeftCheckBox, SIGNAL(toggled(bool)), SLOT(toggleRightToLeft(bool)) ); | ||
84 | #if QT_VERSION >= 0x050400 | ||||
85 | connect( qApp, SIGNAL(layoutDirectionChanged(Qt::LayoutDirection)), SLOT(layoutDirectionChanged(Qt::LayoutDirection)) ); | ||||
86 | #endif | ||||
83 | buttonBox->addButton( _rightToLeftCheckBox, QDialogButtonBox::ResetRole ); | 87 | buttonBox->addButton( _rightToLeftCheckBox, QDialogButtonBox::ResetRole ); | ||
84 | 88 | | |||
85 | #ifdef HAVE_SCHEME_CHOOSER | 89 | #ifdef HAVE_SCHEME_CHOOSER | ||
86 | WidgetStyleChooser *styleChooser = new WidgetStyleChooser(this); | 90 | WidgetStyleChooser *styleChooser = new WidgetStyleChooser(this); | ||
87 | styleChooser->setFlat( true ); | 91 | styleChooser->setFlat( true ); | ||
88 | styleChooser->createStyleSelectionMenu( i18n( "Style" ) ); | 92 | styleChooser->createStyleSelectionMenu( i18n( "Style" ) ); | ||
89 | buttonBox->addButton( styleChooser, QDialogButtonBox::ResetRole ); | 93 | buttonBox->addButton( styleChooser, QDialogButtonBox::ResetRole ); | ||
90 | 94 | | |||
▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Line(s) | 148 | { | |||
148 | page->setHeader( i18n("Shows the appearance of various framed widgets") ); | 152 | page->setHeader( i18n("Shows the appearance of various framed widgets") ); | ||
149 | pageWidget->addPage( page ); | 153 | pageWidget->addPage( page ); | ||
150 | _widgets.append( widget ); | 154 | _widgets.append( widget ); | ||
151 | } | 155 | } | ||
152 | 156 | | |||
153 | // mdi | 157 | // mdi | ||
154 | { | 158 | { | ||
155 | page = new KPageWidgetItem( widget = new MdiDemoWidget() ); | 159 | page = new KPageWidgetItem( widget = new MdiDemoWidget() ); | ||
156 | page->setName( i18n( "MDI Windows" ) ); | 160 | page->setName( i18n( "MDI Windows & Menus" ) ); | ||
157 | setPageIcon( page, QStringLiteral( "preferences-system-windows" ) ); | 161 | setPageIcon( page, QStringLiteral( "preferences-system-windows" ) ); | ||
158 | page->setHeader( i18n( "Shows the appearance of MDI windows" ) ); | 162 | page->setHeader( i18n( "Shows the appearance of MDI windows" ) ); | ||
159 | pageWidget->addPage( page ); | 163 | pageWidget->addPage( page ); | ||
160 | _widgets.append( widget ); | 164 | _widgets.append( widget ); | ||
161 | } | 165 | } | ||
162 | 166 | | |||
163 | // sliders | 167 | // sliders | ||
164 | { | 168 | { | ||
▲ Show 20 Lines • Show All 63 Lines • ▼ Show 20 Line(s) | 230 | { | |||
228 | pageWidget->currentPage()->widget()->setEnabled( value ); | 232 | pageWidget->currentPage()->widget()->setEnabled( value ); | ||
229 | } | 233 | } | ||
230 | 234 | | |||
231 | //_______________________________________________________________ | 235 | //_______________________________________________________________ | ||
232 | void DemoDialog::toggleRightToLeft( bool value ) | 236 | void DemoDialog::toggleRightToLeft( bool value ) | ||
233 | { qApp->setLayoutDirection( value ? Qt::RightToLeft:Qt::LeftToRight ); } | 237 | { qApp->setLayoutDirection( value ? Qt::RightToLeft:Qt::LeftToRight ); } | ||
234 | 238 | | |||
235 | //_______________________________________________________________ | 239 | //_______________________________________________________________ | ||
240 | void DemoDialog::layoutDirectionChanged( Qt::LayoutDirection direction ) | ||||
241 | { _rightToLeftCheckBox->setChecked( direction == Qt::RightToLeft ); } | ||||
242 | | ||||
243 | //_______________________________________________________________ | ||||
236 | void DemoDialog::closeEvent( QCloseEvent* event ) | 244 | void DemoDialog::closeEvent( QCloseEvent* event ) | ||
237 | { | 245 | { | ||
238 | emit abortSimulations(); | 246 | emit abortSimulations(); | ||
239 | QDialog::closeEvent( event ); | 247 | QDialog::closeEvent( event ); | ||
240 | } | 248 | } | ||
241 | 249 | | |||
242 | //_______________________________________________________________ | 250 | //_______________________________________________________________ | ||
243 | void DemoDialog::hideEvent( QHideEvent* event ) | 251 | void DemoDialog::hideEvent( QHideEvent* event ) | ||
Show All 16 Lines |