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 193 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 18 Oct 2024, 04:02 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?

    J 1 Reply Last reply 18 Oct 2024, 07:40
    0
    • N NupurS
      18 Oct 2024, 04:02

      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?

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 18 Oct 2024, 07:40 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

      1/2

      18 Oct 2024, 04:02

      • Login

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