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
QtWS25 Last Chance

Window Modality & Drawer Question

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 2 Posters 436 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.
  • ademmlerA Offline
    ademmlerA Offline
    ademmler
    wrote on 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
    0
    • ademmlerA ademmler

      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 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

      ademmlerA 1 Reply Last reply
      1
      • M mpergand

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

        ademmlerA Offline
        ademmlerA Offline
        ademmler
        wrote on 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
        0
        • ademmlerA ademmler

          @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 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)

          ademmlerA 1 Reply Last reply
          0
          • M mpergand

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

            ademmlerA Offline
            ademmlerA Offline
            ademmler
            wrote on last edited by ademmler
            #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
            • ademmlerA ademmler

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

              • Login

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