diff options
author | Arno <arno@disconnect.de> | 2018-04-04 18:52:09 +0200 |
---|---|---|
committer | Arno <arno@disconnect.de> | 2018-04-04 18:52:09 +0200 |
commit | f48e27a63c59840979dd848893ffba3faefdfdde (patch) | |
tree | 71f1b6c59c3f75a11f38c6a2c703faa6250d72aa /sminputdialog.cpp | |
parent | 89c3587b8768bb49d7f82aa845781ee485df8370 (diff) | |
download | SheMov-f48e27a63c59840979dd848893ffba3faefdfdde.tar.gz SheMov-f48e27a63c59840979dd848893ffba3faefdfdde.tar.bz2 SheMov-f48e27a63c59840979dd848893ffba3faefdfdde.zip |
MoviePropertiesDialog: implement add actors and genres
Only adds items to the view, doesn't do any changes to the database yet.
Had to implement a custom InputDialog, because the standard InputDialog
doesn't have a setter for the completer.
Diffstat (limited to 'sminputdialog.cpp')
-rw-r--r-- | sminputdialog.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/sminputdialog.cpp b/sminputdialog.cpp new file mode 100644 index 0000000..6a97ca4 --- /dev/null +++ b/sminputdialog.cpp @@ -0,0 +1,37 @@ +#include <QLabel> +#include <QLineEdit> +#include <QPushButton> +#include <QCompleter> +#include <QHBoxLayout> +#include <QVBoxLayout> + +#include "sminputdialog.h" + +SmInputDialog::SmInputDialog(const QString &label, QWidget *parent) : QDialog(parent){ + QLabel *thisL = new QLabel(label); + mLE = new QLineEdit; + QPushButton *cancelPB = new QPushButton(tr("Cancel")); + connect(cancelPB, &QPushButton::clicked, this, &SmInputDialog::reject); + QPushButton *acceptPB = new QPushButton(tr("OK")); + connect(acceptPB, &QPushButton::clicked, this, &SmInputDialog::accept); + QHBoxLayout *topL = new QHBoxLayout; + topL->addWidget(thisL); + topL->addWidget(mLE); + QHBoxLayout *buttonLayout = new QHBoxLayout; + buttonLayout->addStretch(); + buttonLayout->addWidget(cancelPB); + buttonLayout->addWidget(acceptPB); + QVBoxLayout *mainLayout = new QVBoxLayout; + mainLayout->addLayout(topL); + mainLayout->addLayout(buttonLayout); + setLayout(mainLayout); +} + +void SmInputDialog::setText(QString &text){ + mLE->setText(text); +} + +void SmInputDialog::setCompleter(QCompleter *completer){ + mLE->completer()->deleteLater(); + mLE->setCompleter(completer); +} |