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. [SOLVED?]how to detect active Qframe in mdi area
Forum Updated to NodeBB v4.3 + New Features

[SOLVED?]how to detect active Qframe in mdi area

Scheduled Pinned Locked Moved General and Desktop
7 Posts 2 Posters 2.2k Views 1 Watching
  • 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.
  • gfxxG Offline
    gfxxG Offline
    gfxx
    wrote on last edited by
    #1

    I need help for detect the active qframe that my app open inside an mdiArea on mainwindow.

    bkt

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      QMdiArea::activeSubWindow()

      1 Reply Last reply
      0
      • gfxxG Offline
        gfxxG Offline
        gfxx
        wrote on last edited by
        #3

        don't work for me ..... I've created mdiarea with designer in my main window and in my mainwindow.ccp with signal & slot by menù item I open a new frame(class parent of QFrame) when I clik over a menu item.

        with "QMdiArea::activeSubWindow()" I detect only the mdiarea creted with designer, but not the single frame that I open with menù.

        bkt

        1 Reply Last reply
        0
        • gfxxG Offline
          gfxxG Offline
          gfxx
          wrote on last edited by
          #4

          for more precision:

          in my mainwindow.ccp I have some of these void (ex.):

          void pesa2::newlavoro()
          {

          //when I open these I need to close all other ..... I have too void pesa2::new1 --> m_new1 -- void pesa2::new2 --> m_new2 etc etc....

          m_newlavoro = new lavoro(ui->mdiArea); // for close lavoro??
          m_newlavoro->show();
          m_newlavoro->activateWindow();
          m_newlavoro->setAttribute(Qt::WA_DeleteOnClose);

          }

          bkt

          1 Reply Last reply
          0
          • gfxxG Offline
            gfxxG Offline
            gfxx
            wrote on last edited by
            #5

            I tray this ... but obtain only an error of segmentation fault tipe SIGSEV

            void pesa2::newlavoro()
            {

            //when I open these I need to close all other ….. I have too void pesa2::new1 —> m_new1 — void pesa2::new2 —> m_new2 etc etc….

            if (m_new1->isVisible()){m_new1->close();}
            if (m_new2->isVisible()){m_new2->close();}

            m_newlavoro = new lavoro(ui->mdiArea);
            m_newlavoro->show();
            m_newlavoro->activateWindow(); m_newlavoro->setAttribute(Qt::WA_DeleteOnClose);

            }

            bkt

            1 Reply Last reply
            0
            • C Offline
              C Offline
              ChrisW67
              wrote on last edited by
              #6

              Nothing in your example code has added a widget to the MDI area (with QMdiArea::addSubWindow()) so the call to QMdiArea::activeSubWindow() will return a null pointer. The docs describe other circumstances a null will be returned.

              1 Reply Last reply
              0
              • gfxxG Offline
                gfxxG Offline
                gfxx
                wrote on last edited by
                #7

                I think you're right ... in qt there is no method for add"frame" in mdiArea

                bkt

                1 Reply Last reply
                0

                • Login

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