diff options
author | Arno <am@disconnect.de> | 2012-02-24 20:35:27 +0100 |
---|---|---|
committer | Arno <am@disconnect.de> | 2012-02-24 20:35:27 +0100 |
commit | b8e16c3bddb706ecc195e86eaafb89ed90f9bfc3 (patch) | |
tree | b14578ba8f801f701777b73d3dbb22730570585a /shemov.cpp | |
parent | e82af6117dfcf4ccbebb712caaf1b8f9c68599ba (diff) | |
download | SheMov-b8e16c3bddb706ecc195e86eaafb89ed90f9bfc3.tar.gz SheMov-b8e16c3bddb706ecc195e86eaafb89ed90f9bfc3.tar.bz2 SheMov-b8e16c3bddb706ecc195e86eaafb89ed90f9bfc3.zip |
Implement MappingTreeWidget
This is a rather large commit. It implements MappingTreeWidget using
MappingTreeModel unsurprisingly this uncovered some exciting bugs.
Fixes the following bugs in MappingTreeModel:
* use insertRows() and removeRows() when addings children, because
dataChanged() won't do it.
* don't use a prepared QSqlQuery when fetching children recursively.
This won't work because the query is still active when we invoke
ourselves again. Put the query on the stack instead
* Keep the model sorted.
Also add an entry for a MappingTreeEditor to the File-Menu.
Diffstat (limited to 'shemov.cpp')
-rw-r--r-- | shemov.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -53,6 +53,7 @@ #include "mappingtableeditor.h" #include "mappingtablemodel.h" #include "dbanalyzer.h" +#include "mappingtreewidget.h" SheMov::SheMov(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(parent, flags), mOpenWithGroupFS(0), mOpenWithGroupAV(0) { //application icon @@ -328,6 +329,9 @@ void SheMov::createActions(){ connect(mConsistencyA, SIGNAL(triggered()), this, SLOT(checkConsistency())); mAnalyzerA = new QAction(QIcon(":/higheels.png"), tr("Analyze Db..."), this); connect(mAnalyzerA, SIGNAL(triggered()), this, SLOT(analyzeDb())); + mMappingEditorA = new QAction(tr("Mapping editor..."), this); + connect(mMappingEditorA, SIGNAL(triggered()), this, SLOT(mappingEditor())); + //connnect mQuitA = new QAction(tr("Quit"), this); mQuitA->setShortcut(tr("CTRL+q")); @@ -608,6 +612,7 @@ void SheMov::createMenus(){ fileMenu->addAction(mNewMovieWizardA); fileMenu->addAction(mConsistencyA); fileMenu->addAction(mAnalyzerA); + fileMenu->addAction(mMappingEditorA); //fileMenu->addAction(mShowNoCoverDialogA); fileMenu->addSeparator(); fileMenu->addAction(mQuitA); @@ -1015,3 +1020,12 @@ void SheMov::editMappings(QString table){ MappingTableEditor ed(table, this); ed.exec(); } + +void SheMov::mappingEditor(){ + QDialog dlg(this); + QHBoxLayout *dlgLayout = new QHBoxLayout; + MappingTreeWidget *mtw = new MappingTreeWidget; + dlgLayout->addWidget(mtw); + dlg.setLayout(dlgLayout); + dlg.exec(); +} |