.
This commit is contained in:
+28
-6
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user