summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArno <am@disconnect.de>2010-05-23 11:03:14 +0200
committerArno <am@disconnect.de>2010-05-23 11:03:14 +0200
commit8827510ec55eda169340b5414bd60eb3ba3bfb79 (patch)
tree3168a6a1dab6c80a6187747d9e2fb2a4598da8b4
parent2380d2c97c8c95c353715c50b02a0f9fa57adc48 (diff)
downloadSheMov-8827510ec55eda169340b5414bd60eb3ba3bfb79.tar.gz
SheMov-8827510ec55eda169340b5414bd60eb3ba3bfb79.tar.bz2
SheMov-8827510ec55eda169340b5414bd60eb3ba3bfb79.zip
Bugfix: margins in ListEditor
Fix layout of AddMovieWizard. The ListEditor-Widget must have margins set to 0 to be laid out properly in a QWizardPage.
-rw-r--r--actorwidget.cpp1
-rw-r--r--addmoviewizard.cpp18
-rw-r--r--listeditor.cpp6
-rw-r--r--listmodel.h1
4 files changed, 13 insertions, 13 deletions
diff --git a/actorwidget.cpp b/actorwidget.cpp
index c887088..2a98dfd 100644
--- a/actorwidget.cpp
+++ b/actorwidget.cpp
@@ -38,6 +38,7 @@ ActorWidget::ActorWidget(QWidget *parent) : QWidget(parent) {
mainLayout->addWidget(l1);
mainLayout->addWidget(mView);
mainLayout->addLayout(buttonLayout);
+ mainLayout->setContentsMargins(0, 0, 0, 0);
setLayout(mainLayout);
}
diff --git a/addmoviewizard.cpp b/addmoviewizard.cpp
index 3855b81..b7dfbf2 100644
--- a/addmoviewizard.cpp
+++ b/addmoviewizard.cpp
@@ -132,8 +132,6 @@ MovieActorPage::MovieActorPage(QWidget *parent) : QWizardPage(parent){
mActorWidget = new ActorWidget;
mainLayout->addWidget(mActorWidget);
QVBoxLayout *actorEditorLayout = new QVBoxLayout;
- QLabel *l1 = new QLabel(" ");
- actorEditorLayout->addWidget(l1);
ListEditor *actorsEditor = new ListEditor(ListModelSingleton::instance()->model("actor"));
actorEditorLayout->addWidget(actorsEditor);
actorEditorLayout->addStretch();
@@ -155,28 +153,22 @@ MovieGenrePage::MovieGenrePage(QWidget *parent) : QWizardPage(parent){
setSubTitle(tr("Set the genre of the movie"));
setPixmap(QWizard::LogoPixmap, QPixmap(":/shemov.png"));
- QVBoxLayout *selectionLayout = new QVBoxLayout;
+ QVBoxLayout *mainLayout = new QVBoxLayout;
QLabel *l1 = new QLabel(tr("Select genre"));
- selectionLayout->addWidget(l1);
+ mainLayout->addWidget(l1);
mGenre = new QComboBox;
mGenre->setModel(ListModelSingleton::instance()->model("genre"));
int idx = mGenre->findText("shemale");
if(idx != -1){
mGenre->setCurrentIndex(idx);
}
- selectionLayout->addWidget(mGenre);
- selectionLayout->addStretch();
+ mainLayout->addWidget(mGenre);
- QVBoxLayout *editorLayout = new QVBoxLayout;
ListEditor *genreEditor = new ListEditor(ListModelSingleton::instance()->model("genre"));
- editorLayout->addWidget(genreEditor);
- editorLayout->addStretch();
+ mainLayout->addWidget(genreEditor);
+ mainLayout->addStretch();
registerField("genre", mGenre, "currentText");
- QHBoxLayout *mainLayout = new QHBoxLayout;
- mainLayout->addLayout(selectionLayout);
- mainLayout->addStretch();
- mainLayout->addLayout(editorLayout);
setLayout(mainLayout);
}
diff --git a/listeditor.cpp b/listeditor.cpp
index 53f58d6..244b11c 100644
--- a/listeditor.cpp
+++ b/listeditor.cpp
@@ -11,11 +11,15 @@
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QCompleter>
+#include <QLabel>
#include "listeditor.h"
#include "listmodel.h"
ListEditor::ListEditor(ListModel *model, QWidget *parent) : QWidget(parent), mModel(model){
+ QString caption = QString(tr("Edit %1s")).arg(model->table());
+ QLabel *l1 = new QLabel(caption);
+
mItems = new QComboBox;
mItems->setModel(mModel);
@@ -37,9 +41,11 @@ ListEditor::ListEditor(ListModel *model, QWidget *parent) : QWidget(parent), mMo
buttonLayout->addWidget(mRemove);
QVBoxLayout *mainLayout = new QVBoxLayout;
+ mainLayout->addWidget(l1);
mainLayout->addWidget(mItems);
mainLayout->addWidget(mEdit);
mainLayout->addLayout(buttonLayout);
+ mainLayout->setContentsMargins(0, 0, 0, 0);
setLayout(mainLayout);
}
diff --git a/listmodel.h b/listmodel.h
index edb21ad..fb3612d 100644
--- a/listmodel.h
+++ b/listmodel.h
@@ -26,6 +26,7 @@ class ListModel : public QAbstractItemModel {
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
QModelIndex index(const QVariant &data) const;
QModelIndex parent(const QModelIndex &) const { return QModelIndex(); };
+ const QString table() const { return mTable; };
int rowCount(const QModelIndex &parent = QModelIndex()) const;
int columnCount(const QModelIndex &) const { return 1; };
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;