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. How can I get the QMdiSubWindow before it closes ?
Forum Updated to NodeBB v4.3 + New Features

How can I get the QMdiSubWindow before it closes ?

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

    I've got some QMdiArea in my QMainWindow. I can handle a creation of subwindows and it's activation. But i need to get pointer to subwindow before it close and destroyed. I find out some tabCloseReqested signal in tabbar when i can get index of closed tab. But how can I get pointer to QMdiSubwindow by this index ?

    1 Reply Last reply
    0
    • _ Offline
      _ Offline
      _rmn
      wrote on last edited by
      #2

      May be QObject::destroyed(Qobject*) signal can be helpfull for you?
      Also you can reimplement closeEvent of your QMdiSubWindow and emit signal from it.

      1 Reply Last reply
      0
      • B Offline
        B Offline
        broadpeak
        wrote on last edited by
        #3

        Maybe:
        http://doc.qt.digia.com/qt/qmdiarea.html#subWindowList

        1 Reply Last reply
        0
        • A Offline
          A Offline
          Anticross
          wrote on last edited by
          #4

          bq. May be QObject::destroyed(Qobject*) signal can be helpfull for you?
          Also you can reimplement closeEvent of your QMdiSubWindow and emit signal from it.

          I can reimplement close Event, but I need to write my own QMdiSubWindow based class to do that. And I hope to do this with standard QMdiArea or QTabWidget methods.

          bq. Maybe:
          http://doc.qt.digia.com/qt/qmdiarea.html#subWindowList

          subWindowList can't help me. Because when I call it in slot, which connected to tabCloseReqested signal my widget is already destroyed. So there is no item with such index in sub window list at that moment.

          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