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. Remove Titlebar DockWidget?
QtWS25 Last Chance

Remove Titlebar DockWidget?

Scheduled Pinned Locked Moved Solved General and Desktop
qt c++dockwidget
8 Posts 3 Posters 663 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.
  • S Offline
    S Offline
    StudentScripter
    wrote on last edited by
    #1

    So i create my Dockwidgets and allow grouped Dragging: setDockOptions(dockOptions() | QMainWindow::GroupedDragging);

    When i have my Dockwidgets tabbed now it always shows the Tab and the dockwidget headderbar. Is there a way to remove the headder bar but still being able to drag the dockwidgets?

    Thank you very much :D

    a9962b88-bf11-4a92-b910-bff7b146e899-image.png

    
        
        //Dockwidgets auf der Linken Seite um die GraphicsItems in Scene zu droppen
        CustomDockWidgetLeft *LeftDockWidget = new CustomDockWidgetLeft(scene, this);
        addDockWidget(Qt::LeftDockWidgetArea, LeftDockWidget);
    
        //Obers Dockwidget auf der rechten Seite, hält die Listenansicht aller Items in der Scene
        CustomDockableItemList *DockableListWidget = new CustomDockableItemList(scene, this);
        addDockWidget(Qt::RightDockWidgetArea, DockableListWidget);
    
        //Unteres Dockwidget auf der rechten Seite, hält alle Module und Properties der Graphicsitems
        DockWidgetModulesMain *DockWidgetMainModules= new DockWidgetModulesMain( scene, this);
    
        // Titel für den Tab festlegen
        DockWidgetMainModules->setWindowTitle("Properties");
        addDockWidget(Qt::RightDockWidgetArea, DockWidgetMainModules);
    
        DockWidgetMainModules->setFeatures(QDockWidget::DockWidgetMovable| QDockWidget::DockWidgetClosable);
    
        // Zweites DockWidget
        DockWidgetModulesMain *DockWidgetMainModules2 = new DockWidgetModulesMain(scene, this);
        addDockWidget(Qt::RightDockWidgetArea, DockWidgetMainModules2);
        DockWidgetMainModules2->setWindowTitle("Workspace");
    
    
        // Fügt das zweite DockWidget als Tab neben dem ersten hinzu
       tabifyDockWidget(DockWidgetMainModules, DockWidgetMainModules2);
    
    
        // Setzt die Position der Tabs auf oben
        setTabPosition(Qt::RightDockWidgetArea, QTabWidget::North);
    
    
    1 Reply Last reply
    0
    • Pl45m4P Pl45m4

      @StudentScripter

      @SGaist was correct with his first answer. The bottom bar is the actual title bar of your dockwidget while the top one is automatically created when having multiple dockwidgets at the same spot.

      I don't know if you can remove that, but if you do, you have to find another way to bring the hidden, docked widget back up.

      S Offline
      S Offline
      StudentScripter
      wrote on last edited by
      #8

      @Pl45m4 @SGaist Ok well i got is removed by setting the titlebar widget to fixed height of 1 and background transparent. This way it retains its dockability.

      1 Reply Last reply
      1
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #2

        Hi,

        This tab means that you have several docks in the same space so trying to remove it will also make the other dock inaccessible.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        S 1 Reply Last reply
        1
        • SGaistS SGaist

          Hi,

          This tab means that you have several docks in the same space so trying to remove it will also make the other dock inaccessible.

          S Offline
          S Offline
          StudentScripter
          wrote on last edited by
          #3

          @SGaist But isn't it possible to have something like: 4334cf7e-30d2-49f7-8dec-4c1da95080eb-image.png Only those two bars? I've seen that in many applications.

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #4

            My bad, I misunderstood your question.

            Did you implement a custom title bar ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            S 1 Reply Last reply
            0
            • SGaistS SGaist

              My bad, I misunderstood your question.

              Did you implement a custom title bar ?

              S Offline
              S Offline
              StudentScripter
              wrote on last edited by StudentScripter
              #5

              @SGaist No its just a tabbified dock widget but when tabbified, one titlebar is redundant.

              SGaistS Pl45m4P 2 Replies Last reply
              0
              • S StudentScripter

                @SGaist No its just a tabbified dock widget but when tabbified, one titlebar is redundant.

                SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #6

                Which version of Qt are you using ?
                On which OS ?

                Can you provide a minimal compilable example that shows this behavior ?

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • S StudentScripter

                  @SGaist No its just a tabbified dock widget but when tabbified, one titlebar is redundant.

                  Pl45m4P Offline
                  Pl45m4P Offline
                  Pl45m4
                  wrote on last edited by
                  #7

                  @StudentScripter

                  @SGaist was correct with his first answer. The bottom bar is the actual title bar of your dockwidget while the top one is automatically created when having multiple dockwidgets at the same spot.

                  I don't know if you can remove that, but if you do, you have to find another way to bring the hidden, docked widget back up.


                  If debugging is the process of removing software bugs, then programming must be the process of putting them in.

                  ~E. W. Dijkstra

                  S 1 Reply Last reply
                  0
                  • Pl45m4P Pl45m4

                    @StudentScripter

                    @SGaist was correct with his first answer. The bottom bar is the actual title bar of your dockwidget while the top one is automatically created when having multiple dockwidgets at the same spot.

                    I don't know if you can remove that, but if you do, you have to find another way to bring the hidden, docked widget back up.

                    S Offline
                    S Offline
                    StudentScripter
                    wrote on last edited by
                    #8

                    @Pl45m4 @SGaist Ok well i got is removed by setting the titlebar widget to fixed height of 1 and background transparent. This way it retains its dockability.

                    1 Reply Last reply
                    1
                    • S StudentScripter has marked this topic as solved on

                    • Login

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