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 to disable the parent form when a child form is active?
QtWS25 Last Chance

How to disable the parent form when a child form is active?

Scheduled Pinned Locked Moved Solved General and Desktop
3 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.
  • S Offline
    S Offline
    Sushant21
    wrote on 19 Nov 2016, 17:40 last edited by
    #1

    In C# or VB.net, you wud achieve it by ShowDialog , which means you cannot interact with the parent form until child form closes.

    How to achieve same in qt ?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 19 Nov 2016, 20:37 last edited by
      #2

      Hi and welcome

      Its called a modal dialog and its activated by calling exec() and not show()

      Mydialog dialog;;
      dialog.exec(); // local event loop and blocking.

      If Widget is not QDialog, you can read about
      setWindowModality(Qt::ApplicationModal);
      http://doc.qt.io/qt-5/qwidget.html#windowModality-prop

      to get such effect.

      S 1 Reply Last reply 20 Nov 2016, 04:23
      1
      • M mrjj
        19 Nov 2016, 20:37

        Hi and welcome

        Its called a modal dialog and its activated by calling exec() and not show()

        Mydialog dialog;;
        dialog.exec(); // local event loop and blocking.

        If Widget is not QDialog, you can read about
        setWindowModality(Qt::ApplicationModal);
        http://doc.qt.io/qt-5/qwidget.html#windowModality-prop

        to get such effect.

        S Offline
        S Offline
        Sushant21
        wrote on 20 Nov 2016, 04:23 last edited by
        #3

        @mrjj Thank You !!
        that did the trick...

        1 Reply Last reply
        1

        1/3

        19 Nov 2016, 17:40

        • Login

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