Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. I can not show with button click a subWindow(ui) created in ui QMdiArea.
QtWS25 Last Chance

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

Scheduled Pinned Locked Moved Solved General and Desktop
qmdisubwindowqmdiarea
10 Posts 2 Posters 1.6k Views
  • 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.
  • H Offline
    H Offline
    Halil Satilusagi
    wrote on 27 Aug 2018, 20:22 last edited by
    #1

    [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
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 27 Aug 2018, 20:38 last edited by
      #2

      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
      0
      • H Offline
        H Offline
        Halil Satilusagi
        wrote on 27 Aug 2018, 21:27 last edited by
        #3

        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
        0
        • H Offline
          H Offline
          Halil Satilusagi
          wrote on 27 Aug 2018, 21:39 last edited by
          #4

          https://cl1p.net/gnkpby

          1 Reply Last reply
          0
          • H Offline
            H Offline
            Halil Satilusagi
            wrote on 27 Aug 2018, 21:57 last edited by
            #5

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

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 28 Aug 2018, 21:19 last edited by
              #6

              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
              1
              • H Offline
                H Offline
                Halil Satilusagi
                wrote on 30 Aug 2018, 18:51 last edited by
                #7

                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
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 30 Aug 2018, 19:06 last edited by
                  #8

                  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
                  0
                  • H Offline
                    H Offline
                    Halil Satilusagi
                    wrote on 30 Aug 2018, 22:25 last edited by
                    #9

                    Sorry, I mean "modal or modeless window".

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on 31 Aug 2018, 22:26 last edited by
                      #10

                      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
                      0

                      8/10

                      30 Aug 2018, 19:06

                      • Login

                      • Login or register to search.
                      8 out of 10
                      • First post
                        8/10
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved