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?
Forum Updated to NodeBB v4.3 + New Features

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 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
    Sushant21
    wrote on 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
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on 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
      1
      • mrjjM mrjj

        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 last edited by
        #3

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

        1 Reply Last reply
        1

        • Login

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