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. Docking QTabWidget to top of main window?
Forum Updated to NodeBB v4.3 + New Features

Docking QTabWidget to top of main window?

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 1.4k Views 1 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.
  • P Offline
    P Offline
    Pauly
    wrote on last edited by
    #1

    I'm trying to make a quick and simple ribbon bar at the top side of the main window. I'm trying to use QTabWidget to do this. However the QTabWidget does not seem to dock (and fix) to the main window. How do I dock the QTabWidget and let it stay there on top of anything? Thank you.

    mrjjM 1 Reply Last reply
    0
    • P Pauly

      I'm trying to make a quick and simple ribbon bar at the top side of the main window. I'm trying to use QTabWidget to do this. However the QTabWidget does not seem to dock (and fix) to the main window. How do I dock the QTabWidget and let it stay there on top of anything? Thank you.

      mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Pauly
      Hi
      Only Docks can , well, dock.

      http://doc.qt.io/qt-5/qtwidgets-mainwindows-dockwidgets-example.html

      Im not sure if u really mean dock or just place.

      1 Reply Last reply
      1
      • dheerendraD Offline
        dheerendraD Offline
        dheerendra
        Qt Champions 2022
        wrote on last edited by
        #3

        Did you use something like follows ?

        QDockWidget * dockWidget=new QDockWidget ;
        dockWidget->setFeatures(QDockWidget::AllDockWidgetFeatures);
        dockWidget.setWidget(tabWidget)
        mainWindows.dockWidget(dockWidget)

        Dheerendra
        @Community Service
        Certified Qt Specialist
        http://www.pthinks.com

        1 Reply Last reply
        8
        • P Offline
          P Offline
          Pauly
          wrote on last edited by
          #4

          Thanks for the quick reply. Yes, silly me... I was trying to dock the tab widget directly instead of putting it inside a dock widget for docking. Thanks!

          1 Reply Last reply
          2

          • Login

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