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. is there an event/signal which happens when the QMdiarea become empty?
QtWS25 Last Chance

is there an event/signal which happens when the QMdiarea become empty?

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 905 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.
  • P Offline
    P Offline
    Prmego
    wrote on last edited by
    #1

    I want to implement a code when QMdiarea is empty i.e. (has no QSubWindow children).

    For example:

    is there an event or signal which happens when the QMdiarea become empty?

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      Hi! If you're using tabs as your subwindows, then listening to the subWindowActivated signal might be enough. But I'm not 100% sure.

      1 Reply Last reply
      3
      • Vinod KuntojiV Offline
        Vinod KuntojiV Offline
        Vinod Kuntoji
        wrote on last edited by
        #3

        connect(mdiArea,SIGNAL(subWindowActivated(QMdiSubWindow*)),this,SLOT(getSubwindowCount()));

        static int count = mdiArea->subWindowList().size();
        if(!subWindow->isVisible()) {
        --count;
        }
        if(!subWindow1->isVisible()) {
        --count;
        }
        qDebug() << Q_FUNC_INFO <<count;

        if count is Zero, mdiArea will be empty.

        C++, Qt, Qt Quick Developer,
        PthinkS, Bangalore

        1 Reply Last reply
        5
        • P Offline
          P Offline
          Prmego
          wrote on last edited by
          #4

          Yes, it's work fine. so the subWindowActivated is the right signal for that job.
          I thank @Wieland and @Vinod-Kuntoji for helping me.

          1 Reply Last reply
          2

          • Login

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