This commit is contained in:
Herwig Birke
2018-05-09 17:59:27 +02:00
parent d3eeee295e
commit b02734e020
21 changed files with 1123 additions and 148 deletions
+28 -6
View File
@@ -18,18 +18,19 @@
cObjectWindow::cObjectWindow(QWidget *parent) :
cMDISubWindow(parent),
ui(new Ui::cObjectWindow),
m_lpMainWindow((cMainWindow*)parent),
m_lpObject(0)
{
ui->setupUi(this);
connect(ui->m_lpName, SIGNAL(gotFocus(cLineEdit*)), (cMainWindow*)parent, SLOT(onLineEditGotFocus(cLineEdit*)));
connect(ui->m_lpName, SIGNAL(lostFocus(cLineEdit*)), (cMainWindow*)parent, SLOT(onLineEditLostFocus(cLineEdit*)));
connect(ui->m_lpName, &cLineEdit::gotFocus, (cMainWindow*)parent, &cMainWindow::onLineEditGotFocus);
connect(ui->m_lpName, &cLineEdit::lostFocus, (cMainWindow*)parent, &cMainWindow::onLineEditLostFocus);
connect(ui->m_lpType, SIGNAL(gotFocus(cLineEdit*)), (cMainWindow*)parent, SLOT(onLineEditGotFocus(cLineEdit*)));
connect(ui->m_lpType, SIGNAL(lostFocus(cLineEdit*)), (cMainWindow*)parent, SLOT(onLineEditLostFocus(cLineEdit*)));
connect(ui->m_lpType, &cLineEdit::gotFocus, (cMainWindow*)parent, &cMainWindow::onLineEditGotFocus);
connect(ui->m_lpType, &cLineEdit::lostFocus, (cMainWindow*)parent, &cMainWindow::onLineEditLostFocus);
connect(ui->m_lpDescription, SIGNAL(gotFocus(cTextEdit*)), (cMainWindow*)parent, SLOT(onTextEditGotFocus(cTextEdit*)));
connect(ui->m_lpDescription, SIGNAL(lostFocus(cTextEdit*)), (cMainWindow*)parent, SLOT(onTextEditLostFocus(cTextEdit*)));
connect(ui->m_lpDescription, &cTextEdit::gotFocus, (cMainWindow*)parent, &cMainWindow::onTextEditGotFocus);
connect(ui->m_lpDescription, &cTextEdit::lostFocus, (cMainWindow*)parent, &cMainWindow::onTextEditLostFocus);
}
cObjectWindow::~cObjectWindow()
@@ -60,9 +61,30 @@ void cObjectWindow::setObject(cObject* lpObject)
ui->m_lpLayout->addItem(lpSpacer);
setWindowTitle(tr("[object] - ") + lpObject->name());
connect(ui->m_lpName, &cLineEdit::textChanged, this, &cObjectWindow::onNameChanged);
connect(ui->m_lpType, &cLineEdit::textChanged, this, &cObjectWindow::onTypeChanged);
connect(ui->m_lpDescription, &cTextEdit::textChanged, this, &cObjectWindow::onDescriptionChanged);
}
cObject* cObjectWindow::object()
{
return(m_lpObject);
}
void cObjectWindow::onNameChanged(const QString& szName)
{
m_lpObject->setName(szName);
m_lpMainWindow->somethingChanged();
}
void cObjectWindow::onTypeChanged(const QString& szName)
{
m_lpObject->setType(szName);
m_lpMainWindow->somethingChanged();
}
void cObjectWindow::onDescriptionChanged()
{
m_lpMainWindow->somethingChanged();
}