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. QDockWidget - resizing it over other widget without changing size of that widget
Forum Updated to NodeBB v4.3 + New Features

QDockWidget - resizing it over other widget without changing size of that widget

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 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.
  • N Offline
    N Offline
    never_ever
    wrote on last edited by
    #1

    Hi,
    I have question about QDockWidget.
    If there is a possibility that QDockWidget could be resized over other widget. I mean that now when I resize dockWidget (for example increase height of it) that docked widget change size of other widget that is a central widget. I want that docked widget will resize but over that central widget (without changing size of central widget). Is there possibility to do that? I thought I saw that solution somewhere but now I can't find it or I mistook it with some other widget.

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      No, QDockWidget can't do that. You would have to implement that yourself.
      The closest thing a QDockWidget can do is become a floating window, but I'm not sure that's what you mean.

      It's easy to do, but this type of thing doesn't play well with Qt layout system. Such widget would have to be put over other widgets without any layout applied and its size would have to be manually adjusted on resizeEvent of the parent.

      1 Reply Last reply
      0
      • N Offline
        N Offline
        never_ever
        wrote on last edited by
        #3

        So, maybe you could explain me one thing. I have dockWidget and central widget. In central widget I have QWidget container with two other widgets (one over other). First widget is used as a background, and second widget is over that first. That first widget is resizing when I resize dockWidget, but second widget not. Why does it happen?

        1 Reply Last reply
        0
        • Chris KawaC Offline
          Chris KawaC Offline
          Chris Kawa
          Lifetime Qt Champion
          wrote on last edited by
          #4

          It depends on how are these two widgets laid out. I'm guessing you set the first widget with setCentralWidget(). This puts it into the built in QMainWindow layout so it gets properly resized when needed. If the second one covers the first one then I'm guessing you just created it with a parent but did not put it into any specific layout.
          So you need to either manually adjust what's needed in that second widget or put it into a layout.

          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