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

How to disable dockwidget closable

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 3 Posters 862 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.
  • F Offline
    F Offline
    firsnur96
    wrote on last edited by
    #1

    I have dockwidget.
    I want to disable closable feature but i cannot.

    ```
    dockwidget[1] = new QDockWidget();
    dockwidget[1]->setWidget(chartView2);
    ui->gridLayout2->addWidget(dockwidget[1]);
    
    jsulmJ 1 Reply Last reply
    0
    • F firsnur96

      I have dockwidget.
      I want to disable closable feature but i cannot.

      ```
      dockwidget[1] = new QDockWidget();
      dockwidget[1]->setWidget(chartView2);
      ui->gridLayout2->addWidget(dockwidget[1]);
      
      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @firsnur96
      https://doc.qt.io/qt-5/qdockwidget.html#features-prop
      https://doc.qt.io/qt-5/qdockwidget.html#DockWidgetFeature-enum
      QDockWidget::DockWidgetClosable

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      F 1 Reply Last reply
      1
      • jsulmJ jsulm

        @firsnur96
        https://doc.qt.io/qt-5/qdockwidget.html#features-prop
        https://doc.qt.io/qt-5/qdockwidget.html#DockWidgetFeature-enum
        QDockWidget::DockWidgetClosable

        F Offline
        F Offline
        firsnur96
        wrote on last edited by
        #3

        @jsulm said in How to disable dockwidget closable:

        @firsnur96

        QDockWidget::DockWidgetClosable

        It provides us to close or not the dockwidget.
        I completely disable it.
        Nobody can close the dockwidget.

        ~QDockWidget::DockWidgetClosable
        

        Not works

        jsulmJ 1 Reply Last reply
        0
        • F firsnur96

          @jsulm said in How to disable dockwidget closable:

          @firsnur96

          QDockWidget::DockWidgetClosable

          It provides us to close or not the dockwidget.
          I completely disable it.
          Nobody can close the dockwidget.

          ~QDockWidget::DockWidgetClosable
          

          Not works

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @firsnur96 said in How to disable dockwidget closable:

          Not works

          Please show how exactly you used QDockWidget::DockWidgetClosable
          Also, "Nobody can close the dockwidget." and "Not works" can be true at the same time?
          Please be more precise/clear.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          F 1 Reply Last reply
          0
          • jsulmJ jsulm

            @firsnur96 said in How to disable dockwidget closable:

            Not works

            Please show how exactly you used QDockWidget::DockWidgetClosable
            Also, "Nobody can close the dockwidget." and "Not works" can be true at the same time?
            Please be more precise/clear.

            F Offline
            F Offline
            firsnur96
            wrote on last edited by
            #5

            @jsulm I want nobody to close the dockwidget.

            QDockWidget::DockWidgetClosable
            

            Doesn't that mean it can be close?
            I want to do the opposite

            jsulmJ 1 Reply Last reply
            0
            • F firsnur96

              @jsulm I want nobody to close the dockwidget.

              QDockWidget::DockWidgetClosable
              

              Doesn't that mean it can be close?
              I want to do the opposite

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @firsnur96 said in How to disable dockwidget closable:

              Doesn't that mean it can be close?

              Come on, you have to UNSET it.

              widget->setFeatures(widget->features() & ~QDockWidget::DockWidgetClosable);
              

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              F 1 Reply Last reply
              4
              • VRoninV Offline
                VRoninV Offline
                VRonin
                wrote on last edited by
                #7
                This post is deleted!
                1 Reply Last reply
                2
                • jsulmJ jsulm

                  @firsnur96 said in How to disable dockwidget closable:

                  Doesn't that mean it can be close?

                  Come on, you have to UNSET it.

                  widget->setFeatures(widget->features() & ~QDockWidget::DockWidgetClosable);
                  
                  F Offline
                  F Offline
                  firsnur96
                  wrote on last edited by
                  #8

                  @jsulm thank you

                  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