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]Detect the QMainWindow is showing or not
Forum Updated to NodeBB v4.3 + New Features

[Solved]Detect the QMainWindow is showing or not

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

    I want to detect a QMainWindow is showing or not

    @
    QMainWindow window;
    //.......
    if(window.isShowing())
    {
    //..................
    }
    @

    Are there exist some function to do that?

    If there are no such things, I would use a variable
    to safe the state of the QMainWindow, and override
    the closeEvent.

    Do you have another solution could make things become easier?

    1 Reply Last reply
    0
    • L Offline
      L Offline
      lgeyer
      wrote on last edited by
      #2

      "QWidget::isVisible()":http://doc.qt.digia.com/qt/qwidget.html#visible-prop

      1 Reply Last reply
      0
      • S Offline
        S Offline
        stereomatching
        wrote on last edited by
        #3

        Thanks a lot, this would make my codes easier to read.

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

          "QWidget::isActiveWindow()":http://doc.qt.digia.com/qt/qwidget.html#isActiveWindow-prop

          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