Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Solved I can not show with button click a subWindow(ui) created in ui QMdiArea.

    General and Desktop
    qmdisubwindow qmdiarea
    2
    10
    923
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Halil Satilusagi
      Halil Satilusagi last edited by

      [6_1535401305063_resources.qrc](Uploading 100%) [5_1535401305063_main.cpp](Uploading 100%) [4_1535401305063_mymainwindow.h](Uploading 100%) [3_1535401305062_mymainwindow.ui](Uploading 100%) [2_1535401305062_Test14.pro.user](Uploading 100%) [1_1535401305062_Test14.pro](Uploading 100%) [0_1535401305061_mymainwindow.cpp](Uploading 100%)

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi and welcome to devnet,

        Your uploads are not visible.

        That said, you should at least give a description of your problem and how to exactly reproduce it. Just uploading your project and expect people to read through it, build it and debug your problem shows a lack of respect for their time.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply Reply Quote 0
        • Halil Satilusagi
          Halil Satilusagi last edited by

          Thank you very much.
          For test purpose, I have created a QMdiArea and subwindows in mainwindow. Normally, I call mainwindow and appearing mdiArea and subwindows. In order to prevent opening of all subwindows in mdiArea, I closed all active windows.
          After all, I want to call any subwindow a toolbutton. Unfortunately, after clicking the toolbutton, the application returns a message like that "The program has unexpectedly finished."

          1 Reply Last reply Reply Quote 0
          • Halil Satilusagi
            Halil Satilusagi last edited by

            https://cl1p.net/gnkpby

            1 Reply Last reply Reply Quote 0
            • Halil Satilusagi
              Halil Satilusagi last edited by

              I think, the problem is; after closing active subwindows in mdiArea, calling them with a button click.

              1 Reply Last reply Reply Quote 0
              • SGaist
                SGaist Lifetime Qt Champion last edited by

                That link you posted is empty.

                Do you mean you are trying to access a closed widget ? From the looks of it you likely are trying to access a dangling pointer.

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply Reply Quote 1
                • Halil Satilusagi
                  Halil Satilusagi last edited by

                  Thank you very much. It is definition issue.
                  For example:
                  .h file
                  public:
                  SecondForm *mywidget;
                  ThirdForm *thirdForm;
                  .cpp file
                  if (ui->mdiArea->activeSubWindow() == 0x0){
                  mywidget = new SecondForm(this);
                  ui->mdiArea->addSubWindow(mywidget);
                  mywidget->resize(500,500);
                  mywidget->show();
                  }
                  For nonmodal windows.
                  it is working.
                  For modal windows instance creation is necessary.

                  1 Reply Last reply Reply Quote 0
                  • SGaist
                    SGaist Lifetime Qt Champion last edited by

                    What do you mean by non modal window ?

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply Reply Quote 0
                    • Halil Satilusagi
                      Halil Satilusagi last edited by

                      Sorry, I mean "modal or modeless window".

                      1 Reply Last reply Reply Quote 0
                      • SGaist
                        SGaist Lifetime Qt Champion last edited by

                        That's usually applied to dialogs. Is that what you were using ?

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post