summaryrefslogtreecommitdiffstats
path: root/archiveview.cpp
diff options
context:
space:
mode:
authorArno <am@disconnect.de>2013-07-12 11:22:17 +0200
committerArno <am@disconnect.de>2013-07-12 11:22:17 +0200
commitcbba8c474d5e90c4af05783e012415102f162c0e (patch)
tree8b1dc2972beb70d0bbc16e7165d23638b22be1bf /archiveview.cpp
parent96df0c7b20a6f3e8c118d373f52193f71ab4b521 (diff)
downloadSheMov-cbba8c474d5e90c4af05783e012415102f162c0e.tar.gz
SheMov-cbba8c474d5e90c4af05783e012415102f162c0e.tar.bz2
SheMov-cbba8c474d5e90c4af05783e012415102f162c0e.zip
Use MappingEditorWidget in NewMovieWizard
Diffstat (limited to 'archiveview.cpp')
-rw-r--r--archiveview.cpp15
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()){