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. Resizing QDockWidget in Designer
Qt 6.11 is out! See what's new in the release blog

Resizing QDockWidget in Designer

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 3.5k 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
    phlucious
    wrote on last edited by
    #1

    I've done dozens of Google searches for this and can't seem to find an answer to what seems to be an obvious question. How do I size a QDockWidget in Designer (within Qt Creator) after I've placed it in my QMainWindow?

    When I hover my mouse over the QDockWidget's edge, I get the expected mouse icon with two arrows pointing away from two bars (standard resize icon), but when I click it tries to select objects. Honestly, I find this behavior quite bizarre since I can resize the MainWindow itself normally within Designer, and dragging the edge of the QDockWidget works exactly as expected while the program is running.

    When I adjust the geometry->Width property of the QDockWidget or its child in Designer, nothing happens. The child widget does have a VBoxLayout applied to it with a QTabWidget inside, so that's likely controlling the geometry since changing the width does work if I have a QPushButton (or whatever) instead of the QTabWidget. But why won't it expand in Designer with the QTabWidget there? It works exactly as expected in run-time.

    This is important to me since I've been unable to enlarge the QDockWidget ever since I added the QTabWidget. Below is a simplified version of the ui file:

    @<?xml version="1.0" encoding="UTF-8"?>
    <ui version="4.0">
    <class>MainWindow</class>
    <widget class="QMainWindow" name="MainWindow">
    <property name="geometry">
    <rect>
    <x>0</x>
    <y>0</y>
    <width>400</width>
    <height>300</height>
    </rect>
    </property>
    <property name="windowTitle">
    <string>MainWindow</string>
    </property>
    <widget class="QWidget" name="centralWidget"/>
    <widget class="QMenuBar" name="menuBar">
    <property name="geometry">
    <rect>
    <x>0</x>
    <y>0</y>
    <width>400</width>
    <height>21</height>
    </rect>
    </property>
    </widget>
    <widget class="QToolBar" name="mainToolBar">
    <attribute name="toolBarArea">
    <enum>TopToolBarArea</enum>
    </attribute>
    <attribute name="toolBarBreak">
    <bool>false</bool>
    </attribute>
    </widget>
    <widget class="QStatusBar" name="statusBar"/>
    <widget class="QDockWidget" name="dockWidget">
    <attribute name="dockWidgetArea">
    <number>1</number>
    </attribute>
    <widget class="QWidget" name="dockWidgetContents">
    <layout class="QVBoxLayout" name="verticalLayout">
    <item>
    <widget class="QTabWidget" name="tabWidget">
    <widget class="QWidget" name="tab">
    <attribute name="title">
    <string>Tab 1</string>
    </attribute>
    </widget>
    <widget class="QWidget" name="tab_2">
    <attribute name="title">
    <string>Tab 2</string>
    </attribute>
    </widget>
    </widget>
    </item>
    </layout>
    </widget>
    </widget>
    </widget>
    <layoutdefault spacing="6" margin="11"/>
    <resources/>
    <connections/>
    </ui>@

    1 Reply Last reply
    0
    • _ Offline
      _ Offline
      _vf_
      wrote on last edited by
      #2

      See this http://www.qtcentre.org/threads/14954-QSplitter-in-Designer
      may be it can help 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