src/settingseditor/settingseditor.cpp

changeset 285
99af8bf63d10
parent 282
f2dc3bbecbfa
child 286
04478da357d0
equal deleted inserted replaced
284:9266239cf72b 285:99af8bf63d10
8 8
9 SettingsEditor::SettingsEditor( 9 SettingsEditor::SettingsEditor(
10 const uiutilities::KeySequenceMap& defaultKeyboardShortcuts, 10 const uiutilities::KeySequenceMap& defaultKeyboardShortcuts,
11 QWidget* parent 11 QWidget* parent
12 ) : 12 ) :
13 QDialog{parent}, 13 QMdiSubWindow{parent},
14 ui{*new Ui_SettingsEditor}, 14 ui{*new Ui_SettingsEditor},
15 libraries{this}, 15 libraries{this},
16 librariesEditor{this}, 16 librariesEditor{this},
17 defaultKeyboardShortcuts{defaultKeyboardShortcuts} 17 defaultKeyboardShortcuts{defaultKeyboardShortcuts}
18 { 18 {
19 this->ui.setupUi(this); 19 QWidget* widget = new QWidget{this};
20 this->ui.setupUi(widget);
21 this->setWidget(widget);
20 this->ui.keyboardShortcutsView->setModel(new KeyboardShortcutsEditor{parent, this}); 22 this->ui.keyboardShortcutsView->setModel(new KeyboardShortcutsEditor{parent, this});
21 this->ui.viewModeButtonGroup->setId(this->ui.viewModeTabs, int{QMdiArea::TabbedView}); 23 this->ui.viewModeButtonGroup->setId(this->ui.viewModeTabs, int{QMdiArea::TabbedView});
22 this->ui.viewModeButtonGroup->setId(this->ui.viewModeSubWindows, int{QMdiArea::SubWindowView}); 24 this->ui.viewModeButtonGroup->setId(this->ui.viewModeSubWindows, int{QMdiArea::SubWindowView});
23 this->loadLocales(); 25 this->loadLocales();
24 this->loadSettings(); 26 this->loadSettings();
25 this->setWindowTitle(tr("Settings")); 27 this->setWindowTitle(tr("Settings"));
28 this->setWindowIcon(QIcon{":/icons/settings-outline.png"});
26 this->librariesEditor.setModel(&libraries); 29 this->librariesEditor.setModel(&libraries);
27 QVBoxLayout* layout = new QVBoxLayout{this}; 30 QVBoxLayout* layout = new QVBoxLayout{this};
28 layout->addWidget(&librariesEditor); 31 layout->addWidget(&librariesEditor);
29 this->ui.tabLdrawLibraries->setLayout(layout); 32 this->ui.tabLdrawLibraries->setLayout(layout);
30 connect(this->ui.buttonBox, &QDialogButtonBox::clicked, 33 connect(this->ui.buttonBox, &QDialogButtonBox::clicked,

mercurial