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. Setting Initial Width of QDockWidget in Qt 6 C++ Without Affecting Splitter Behavior
Forum Updated to NodeBB v4.3 + New Features

Setting Initial Width of QDockWidget in Qt 6 C++ Without Affecting Splitter Behavior

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

    I'm working on a Qt 6 application where I need to set an initial width for a QDockWidget without disrupting the functionality of the splitter that separates multiple dock widgets within a QMainWindow.
    I've tried using methods like dockWidget->setFixedSize() and dockWidget->setMaximumWidth(), but they either prevent the splitter from functioning properly or do not set the initial width as desired.

    What is the recommended way to set the initial width of a QDockWidget while still allowing it to be resizable via the splitter?

    jsulmJ 1 Reply Last reply
    0
    • N NupurS

      I'm working on a Qt 6 application where I need to set an initial width for a QDockWidget without disrupting the functionality of the splitter that separates multiple dock widgets within a QMainWindow.
      I've tried using methods like dockWidget->setFixedSize() and dockWidget->setMaximumWidth(), but they either prevent the splitter from functioning properly or do not set the initial width as desired.

      What is the recommended way to set the initial width of a QDockWidget while still allowing it to be resizable via the splitter?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @NupurS What about https://doc.qt.io/qt-6/qsplitter.html#setStretchFactor ?
      There is also https://doc.qt.io/qt-6/qwidget.html#resize-1

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      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