X
X
xXNullXx2019-03-06 00:49:54
Qt Creator
xXNullXx, 2019-03-06 00:49:54

Because of what data from the parent window are not transferred to the child?

Good day!
Actually here:
"dialog_EditingTheClippingPlane" - child form;
"ControlWin" - Parent form;
Declaration of the "SetDate" method in the "dialog_EditingTheClippingPlane" class.

void SetDate(QString x, QString y, QString z, QString name);

This is the implementation of the "dialog_EditingTheClippingPlane" class method (child form). Actually with the help of it I AM trying to transfer the data from the parent to the child form.
void dialog_EditingTheClippingPlane::SetDate(QString x, QString y, QString z, QString name)
{
//Line Edit
    ui->le_X->setText(x);
    ui->le_Y->setText(y);
    ui->le_Z->setText(z);

    ui->le_Name->setText(name);
}

By clicking on the element of the "Tree Widget" component, a child window is called and its (above listed) components should have the following values ​​(test).
void ControlWin::on_tree_ClippingPlanes_itemClicked(QTreeWidgetItem *item, int column)
{
    dialog_EditingTheClippingPlane dl_EditingTheClippingPlane;

    if(dl_EditingTheClippingPlane.exec())
    {
        dl_EditingTheClippingPlane.SetDate(
                    "0",
                    "0",
                    "0",
                    "Name");
    }
}

As a result, there is nothing in these edits (they are empty). What is the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman, 2019-03-06
@xXNullXx

void ControlWin::on_tree_ClippingPlanes_itemClicked(QTreeWidgetItem *item, int column)
{
  dialog_EditingTheClippingPlane* dl_EditingTheClippingPlane = new dialog_EditingTheClippingPlane();
  dl_EditingTheClippingPlane->SetDate(
                    "0",
                    "0",
                    "0",
                    "Name");
  if(dl_EditingTheClippingPlane.exec() == ...)
  {
    //...
  }
  delete dl_EditingTheClippingPlane;
}

https://doc.qt.io/qt-5/qdialog.html#exec

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question