30 lines
705 B
C++
30 lines
705 B
C++
#include "itemcreationdialog.h"
|
|
#include "ui_itemcreationdialog.h"
|
|
|
|
ItemCreationDialog::ItemCreationDialog(QWidget *parent) :
|
|
QDialog(parent),
|
|
ui(new Ui::ItemCreationDialog)
|
|
{
|
|
ui->setupUi(this);
|
|
connect(ui->comboBox, &QComboBox::currentTextChanged, this, &ItemCreationDialog::itemTypeChanged);
|
|
connect(ui->lineEdit, &QLineEdit::textChanged, this, &ItemCreationDialog::itemNameChanged);
|
|
}
|
|
|
|
ItemCreationDialog::~ItemCreationDialog()
|
|
{
|
|
delete ui;
|
|
}
|
|
|
|
void ItemCreationDialog::itemTypeChanged(const QString& type)
|
|
{
|
|
ui->verticalLayout->removeWidget(widget);
|
|
}
|
|
|
|
void ItemCreationDialog::itemNameChanged(const QString& name)
|
|
{
|
|
if(item)
|
|
{
|
|
item->setName(name);
|
|
}
|
|
}
|
|
|