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. Dockable widget in a widget (not the QMainWindow)?
Forum Updated to NodeBB v4.3 + New Features

Dockable widget in a widget (not the QMainWindow)?

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 523 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.
  • A Offline
    A Offline
    Alain38 0
    wrote on 3 Apr 2018, 14:44 last edited by
    #1

    Hi,
    I have an application with a QStackedWidget as central widget. In this stack, one page is divided in two parts:

    • a set of tools with configuration widgets specific to each tool (a little bit like that you find in GIMP),

    • the display widget

    Now, what I wants is that the set of tools acts as a QDockedWidget. That is to say:

    • I must be able to undock it, and have it as floating widget. Then I must be able to move it,

    • I must be able to dock it again in the page, when I drop it close to the borders of the page.

    I have tried to use QDockWidget for this. But I only have the half of my needs. I am not able to dock it again, when it is in floatable state.

    Is it possible with QDockWidget (ar another existing class), or should I implement all from QWidget?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 3 Apr 2018, 20:10 last edited by
      #2

      Hi
      The QMainwindow provides the dock areas so it cant work as a widget.
      However, you can use QMainwindow as a widget and cheat in that way.
      However, its a bit hacky.

      1 Reply Last reply
      2
      • A Offline
        A Offline
        Alain38 0
        wrote on 4 Apr 2018, 07:21 last edited by
        #3

        Thanks a lot. It works. Now I just have to set a style to the Dock widget

        1 Reply Last reply
        0

        1/3

        3 Apr 2018, 14:44

        • Login

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