diff options
author | Arno <am@disconnect.de> | 2013-07-12 11:22:17 +0200 |
---|---|---|
committer | Arno <am@disconnect.de> | 2013-07-12 11:22:17 +0200 |
commit | cbba8c474d5e90c4af05783e012415102f162c0e (patch) | |
tree | 8b1dc2972beb70d0bbc16e7165d23638b22be1bf /archiveview.cpp | |
parent | 96df0c7b20a6f3e8c118d373f52193f71ab4b521 (diff) | |
download | SheMov-cbba8c474d5e90c4af05783e012415102f162c0e.tar.gz SheMov-cbba8c474d5e90c4af05783e012415102f162c0e.tar.bz2 SheMov-cbba8c474d5e90c4af05783e012415102f162c0e.zip |
Use MappingEditorWidget in NewMovieWizard
Diffstat (limited to 'archiveview.cpp')
-rw-r--r-- | archiveview.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/archiveview.cpp b/archiveview.cpp index 1d0502a..2521113 100644 --- a/archiveview.cpp +++ b/archiveview.cpp @@ -395,10 +395,10 @@ QWidget *FileTypeDelegate::createEditor(QWidget *parent, const QStyleOptionViewI /* Mapping Editor Widget */ -MappingEditorWidget::MappingEditorWidget(const QString &caption, QWidget *parent) : QWidget(parent){ +MappingEditorWidget::MappingEditorWidget(const QString &caption, QWidget *parent) : QWidget(parent), mCaption(caption){ // the view mModel = new QStandardItemModel(this); - mModel->setHorizontalHeaderLabels(QStringList() << caption); + mModel->setHorizontalHeaderItem(0, new QStandardItem(mCaption)); mProxy = new QSortFilterProxyModel(this); mProxy->setSourceModel(mModel); QVBoxLayout *viewLayout = new QVBoxLayout; @@ -420,10 +420,11 @@ MappingEditorWidget::MappingEditorWidget(const QString &caption, QWidget *parent // edit buttons QHBoxLayout *editButtonLayout = new QHBoxLayout; - mRemove = new QPushButton(tr("Remove")); + editButtonLayout->addStretch(); + mRemove = new QPushButton(tr("&Remove")); connect(mRemove, SIGNAL(clicked()), this, SLOT(removeItem())); editButtonLayout->addWidget(mRemove); - mAdd = new QPushButton(tr("Add")); + mAdd = new QPushButton(tr("&Add")); connect(mAdd, SIGNAL(clicked()), this, SLOT(addItem())); editButtonLayout->addWidget(mAdd); @@ -456,6 +457,12 @@ QStringList MappingEditorWidget::items() const{ return retval; } +void MappingEditorWidget::clear(){ + mModel->clear(); + mModel->setHorizontalHeaderItem(0, new QStandardItem(mCaption)); + mEditor->clear(); +} + void MappingEditorWidget::addItem(){ QString itemName = mEditor->text(); if(itemName.isEmpty()){ |