aboutsummaryrefslogtreecommitdiffstats
path: root/SQLiteStudio3/guiSQLiteStudio/multieditor/multieditordialog.cpp
blob: 5e3985c79479bcb55ee0fb066e3a0bcc17935b01 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include "multieditordialog.h"
#include "multieditor.h"
#include <QDialogButtonBox>
#include <QVBoxLayout>

MultiEditorDialog::MultiEditorDialog(QWidget *parent) :
    QDialog(parent)
{
    multiEditor = new MultiEditor();

    QVBoxLayout* vbox = new QVBoxLayout();
    vbox->addWidget(multiEditor);
    setLayout(vbox);

    multiEditor->setReadOnly(false);

    buttonBox = new QDialogButtonBox(Qt::Horizontal);
    buttonBox->addButton(QDialogButtonBox::Ok);
    buttonBox->addButton(QDialogButtonBox::Cancel);
    vbox->addWidget(buttonBox);

    connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
    connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
}

MultiEditorDialog::~MultiEditorDialog()
{
    delete multiEditor;
}

void MultiEditorDialog::setValue(const QVariant& value)
{
    multiEditor->setValue(value);
}

QVariant MultiEditorDialog::getValue()
{
    return multiEditor->getValue();
}

void MultiEditorDialog::setDataType(const DataType& dataType)
{
    multiEditor->setDataType(dataType);
}

void MultiEditorDialog::setReadOnly(bool readOnly)
{
    multiEditor->setReadOnly(readOnly);
}