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. Preventing a QDockWidget from being closed by keyboard shortcuts if it should not be closable
Forum Updated to NodeBB v4.3 + New Features

Preventing a QDockWidget from being closed by keyboard shortcuts if it should not be closable

Scheduled Pinned Locked Moved Solved General and Desktop
13 Posts 4 Posters 274 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.
  • l3u_L Offline
    l3u_L Offline
    l3u_
    wrote last edited by
    #1

    Hi all,

    I just found again a bug report I filed ca. one year ago: https://bugreports.qt.io/browse/QTBUG-126418

    The relevant problem is: A QDockWidget that is declared as non-closable but as floatable cannot be closed by clicking an "X" button (it's omitted then), but one can actually close such a floating dock nevertheless by using a keyboard shortcut (Alt+F4).

    After that, there's no way to re-show that closed dock, as the menu bar's context menu containing checkboxes for all dock widgets is grayed out (it becomes enabled when adding docks with the QDockWidget::DockWidgetClosable feature set). The only way to get the dock back is to delete the window state from the rc file.

    My understanding is that a QDockWidget that is marked as not closable should not only not be closable by omitting the "X"/"Close" button, but also an attempt to close it using keyboard shortcuts should be ignored, to also prevent it from closing this way.

    @Axel-Spoerl Now that I know that you're the QDockWidgets expert here – is this a bug or is it a feature!? ;-) Do I have to prevent this in my code, or do you agree that Qt should take care of this?

    Cheers, Tobias

    l3u_L 1 Reply Last reply
    0
    • Axel SpoerlA Offline
      Axel SpoerlA Offline
      Axel Spoerl
      Moderators
      wrote last edited by
      #13

      Looks like the bug doesn't reproduce anymore.

      Software Engineer
      The Qt Company, Oslo

      1 Reply Last reply
      0
      • Axel SpoerlA Offline
        Axel SpoerlA Offline
        Axel Spoerl
        Moderators
        wrote last edited by
        #2

        Hi Tobias,
        that's definitively a bug, not a feature. Non-closable is not limited to the x-button. Maybe you wanna assign it to me.
        Cheers
        Axel

        Software Engineer
        The Qt Company, Oslo

        1 Reply Last reply
        0
        • l3u_L Offline
          l3u_L Offline
          l3u_
          wrote last edited by
          #3

          I'd love to if I knew how … ;-)

          JonBJ 1 Reply Last reply
          0
          • l3u_L l3u_

            I'd love to if I knew how … ;-)

            JonBJ Offline
            JonBJ Offline
            JonB
            wrote last edited by
            #4

            @l3u_ He means go to https://bugreports.qt.io/, create a bug report and assign to his name :)

            1 Reply Last reply
            0
            • l3u_L l3u_

              Hi all,

              I just found again a bug report I filed ca. one year ago: https://bugreports.qt.io/browse/QTBUG-126418

              The relevant problem is: A QDockWidget that is declared as non-closable but as floatable cannot be closed by clicking an "X" button (it's omitted then), but one can actually close such a floating dock nevertheless by using a keyboard shortcut (Alt+F4).

              After that, there's no way to re-show that closed dock, as the menu bar's context menu containing checkboxes for all dock widgets is grayed out (it becomes enabled when adding docks with the QDockWidget::DockWidgetClosable feature set). The only way to get the dock back is to delete the window state from the rc file.

              My understanding is that a QDockWidget that is marked as not closable should not only not be closable by omitting the "X"/"Close" button, but also an attempt to close it using keyboard shortcuts should be ignored, to also prevent it from closing this way.

              @Axel-Spoerl Now that I know that you're the QDockWidgets expert here – is this a bug or is it a feature!? ;-) Do I have to prevent this in my code, or do you agree that Qt should take care of this?

              Cheers, Tobias

              l3u_L Offline
              l3u_L Offline
              l3u_
              wrote last edited by l3u_
              #5

              @JonB

              @l3u_ said in Preventing a QDockWidget from being closed by keyboard shortcuts if it should not be closable:

              I just found again a bug report I filed ca. one year ago: https://bugreports.qt.io/browse/QTBUG-126418

              There is already a bug report. But I don't see how I could assign it …

              JonBJ Christian EhrlicherC 2 Replies Last reply
              0
              • l3u_L l3u_

                @JonB

                @l3u_ said in Preventing a QDockWidget from being closed by keyboard shortcuts if it should not be closable:

                I just found again a bug report I filed ca. one year ago: https://bugreports.qt.io/browse/QTBUG-126418

                There is already a bug report. But I don't see how I could assign it …

                JonBJ Offline
                JonBJ Offline
                JonB
                wrote last edited by
                #6

                @l3u_ OIC. I don't think you/I have permission? Wait for @Axel-Spoerl to return here.

                1 Reply Last reply
                0
                • l3u_L l3u_

                  @JonB

                  @l3u_ said in Preventing a QDockWidget from being closed by keyboard shortcuts if it should not be closable:

                  I just found again a bug report I filed ca. one year ago: https://bugreports.qt.io/browse/QTBUG-126418

                  There is already a bug report. But I don't see how I could assign it …

                  Christian EhrlicherC Online
                  Christian EhrlicherC Online
                  Christian Ehrlicher
                  Lifetime Qt Champion
                  wrote last edited by
                  #7

                  @l3u_ said in Preventing a QDockWidget from being closed by keyboard shortcuts if it should not be closable:

                  But I don't see how I could assign it …

                  Done

                  Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                  Visit the Qt Academy at https://academy.qt.io/catalog

                  1 Reply Last reply
                  0
                  • l3u_L Offline
                    l3u_L Offline
                    l3u_
                    wrote last edited by
                    #8

                    Thanks! So is it correct one needs special permissions to do so?

                    1 Reply Last reply
                    0
                    • l3u_L Offline
                      l3u_L Offline
                      l3u_
                      wrote last edited by
                      #9

                      @Christian-Ehrlicher Hey, was it intentional to assign the bug to "Axel Sanwald" and not to @Axel-Spoerl ?

                      Christian EhrlicherC 1 Reply Last reply
                      0
                      • l3u_L l3u_

                        @Christian-Ehrlicher Hey, was it intentional to assign the bug to "Axel Sanwald" and not to @Axel-Spoerl ?

                        Christian EhrlicherC Online
                        Christian EhrlicherC Online
                        Christian Ehrlicher
                        Lifetime Qt Champion
                        wrote last edited by
                        #10

                        @l3u_ said in Preventing a QDockWidget from being closed by keyboard shortcuts if it should not be closable:

                        @Christian-Ehrlicher Hey, was it intentional to assign the bug to "Axel Sanwald" and not to @Axel-Spoerl ?

                        No, it was mistake on my little mobile phone.

                        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                        Visit the Qt Academy at https://academy.qt.io/catalog

                        1 Reply Last reply
                        0
                        • Axel SpoerlA Offline
                          Axel SpoerlA Offline
                          Axel Spoerl
                          Moderators
                          wrote last edited by
                          #11

                          Hey, I was gone for some days.
                          Will look into it this week!

                          Software Engineer
                          The Qt Company, Oslo

                          1 Reply Last reply
                          0
                          • Axel SpoerlA Offline
                            Axel SpoerlA Offline
                            Axel Spoerl
                            Moderators
                            wrote last edited by
                            #12

                            Hi all,
                            I looked into it a bit and replied in the Jira ticket.
                            Please answer there.

                            Software Engineer
                            The Qt Company, Oslo

                            1 Reply Last reply
                            0
                            • Axel SpoerlA Offline
                              Axel SpoerlA Offline
                              Axel Spoerl
                              Moderators
                              wrote last edited by
                              #13

                              Looks like the bug doesn't reproduce anymore.

                              Software Engineer
                              The Qt Company, Oslo

                              1 Reply Last reply
                              0
                              • Axel SpoerlA Axel Spoerl has marked this topic as solved

                              • Login

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