Important: Please read the Qt Code of Conduct -

The view of new window appears in area of old window.

  • Hi,

    When im creating new window with "this" in CTOR then view appears in area of old window. Check code below:

    void Login::on_AddNew_clicked()
        AddUser *newuser = new AddUser(this);

    Im wondering about this bug because for different windows it works ok (new window is generated). Example below:

    void Login::on_GoIn_clicked()
          if( /* whatever */ )
                      MainWindow *main = new MainWindow(this);

    I dont what to create private ptrs in .h file and use them to creating windows. I prefer the way when ptr is defined inside function and later DTOR of object is called by parent.

    Have you ever seen such issue?
    Let me know if you need more detailed code.

  • add newuser->setWindowFlags(newuser->windowFlags() | Qt::Window);

  • It helps, thank you

Log in to reply