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. Window Modality & Drawer Question
Forum Updated to NodeBB v4.3 + New Features

Window Modality & Drawer Question

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 2 Posters 453 Views 2 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
    ademmler
    wrote on 29 Sept 2023, 09:00 last edited by
    #1

    Hi everybody.

    May be I am mistaken or have forgotten how to do it.
    I think it was possible to get a dialog as a "top drawer" in the Main window by setting its modality to "Application" modal.

    Now when I do this in Qt Creator I get a standard Modal Window
    but not "a dialog sliding out from the top".

    What I am missing here?

    I use Qt 5.5.13 and Qt Creator 10.0.0 rc-1.

    thx in advance

    M 1 Reply Last reply 29 Sept 2023, 09:57
    0
    • A ademmler
      29 Sept 2023, 09:00

      Hi everybody.

      May be I am mistaken or have forgotten how to do it.
      I think it was possible to get a dialog as a "top drawer" in the Main window by setting its modality to "Application" modal.

      Now when I do this in Qt Creator I get a standard Modal Window
      but not "a dialog sliding out from the top".

      What I am missing here?

      I use Qt 5.5.13 and Qt Creator 10.0.0 rc-1.

      thx in advance

      M Offline
      M Offline
      mpergand
      wrote on 29 Sept 2023, 09:57 last edited by
      #2

      Hi @ademmler
      I presume you are talking about "sheet" on MacOs, you need to set the modality to Qt::WindowModal,
      see HERE

      A 1 Reply Last reply 30 Sept 2023, 06:38
      1
      • M mpergand
        29 Sept 2023, 09:57

        Hi @ademmler
        I presume you are talking about "sheet" on MacOs, you need to set the modality to Qt::WindowModal,
        see HERE

        A Offline
        A Offline
        ademmler
        wrote on 30 Sept 2023, 06:38 last edited by ademmler
        #3

        @mpergand Hi, yes you are right - I am talking about "sheet".

        I tried to set Modality from code and within QtCreator.
        In Both cases it does not work and I get a normal dialog popping up.

        mAssistant = new ManualAssistant();
        mAssistant->setModal(true);
        mAssistant->setWindowModality(Qt::WindowModal);
        mAssistant->show();  //I tried also mAssistant->exec()
        

        Seems to be broken somehow.

        Regards Alex

        M 2 Replies Last reply 30 Sept 2023, 09:01
        0
        • A ademmler
          30 Sept 2023, 06:38

          @mpergand Hi, yes you are right - I am talking about "sheet".

          I tried to set Modality from code and within QtCreator.
          In Both cases it does not work and I get a normal dialog popping up.

          mAssistant = new ManualAssistant();
          mAssistant->setModal(true);
          mAssistant->setWindowModality(Qt::WindowModal);
          mAssistant->show();  //I tried also mAssistant->exec()
          

          Seems to be broken somehow.

          Regards Alex

          M Offline
          M Offline
          mpergand
          wrote on 30 Sept 2023, 09:01 last edited by mpergand
          #4

          @ademmler
          You need to set the sheet a parent window:
          mAssistant = new ManualAssistant(this); // this is the parent window
          or
          mAssistant->setParent(parent window)

          A 1 Reply Last reply 2 Oct 2023, 08:15
          0
          • M mpergand
            30 Sept 2023, 09:01

            @ademmler
            You need to set the sheet a parent window:
            mAssistant = new ManualAssistant(this); // this is the parent window
            or
            mAssistant->setParent(parent window)

            A Offline
            A Offline
            ademmler
            wrote on 2 Oct 2023, 08:15 last edited by ademmler 10 Feb 2023, 08:16
            #5

            @mpergand said in Window Modality & Drawer Question:

            mAssistant->setParent(parent window)

            Thx for your hint - if I do so I get a modal dialog.
            But it sits in the window center and not as "sheet" at the top.

            Bildschirmfoto 2023-10-02 um 10.10.32.png

            Regards Alex

            1 Reply Last reply
            0
            • A ademmler
              30 Sept 2023, 06:38

              @mpergand Hi, yes you are right - I am talking about "sheet".

              I tried to set Modality from code and within QtCreator.
              In Both cases it does not work and I get a normal dialog popping up.

              mAssistant = new ManualAssistant();
              mAssistant->setModal(true);
              mAssistant->setWindowModality(Qt::WindowModal);
              mAssistant->show();  //I tried also mAssistant->exec()
              

              Seems to be broken somehow.

              Regards Alex

              M Offline
              M Offline
              mpergand
              wrote on 2 Oct 2023, 09:43 last edited by mpergand 10 Feb 2023, 09:44
              #6

              Try to add Qt::Window to setParent as here:

              mAssistant = new ManualAssistant();
              mAssistant->setModal(true);
              mAssistant->setParent(parent, Qt::Window);
              mAssistant->exec();

              1 Reply Last reply
              0

              3/6

              30 Sept 2023, 06:38

              • Login

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