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 the Panel Window
Forum Update on Monday, May 27th 2025

Resizing the Panel Window

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

    I'm trying to resize the left panel to fill up the left side of the window. I've tried looking through the forum and other places and so far, nothing has worked.

    5249e03a-b131-42a3-aae4-653f9cb7c035-image.png

    d7643cda-bae7-4cd7-a556-4aa04e495308-image.png

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Please post your code as text and not as an image. This makes it hard to read while also not allowing it to be copy-pasted for tests.

      As for your issue, you seem to have a grid layout with three columns and you put widgets in column 0 and 2.

      If you want the widgets in column 0 to go next to the widgets in column 2 then you have to set the span accordingly.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • P Offline
        P Offline
        Phamy1289
        wrote on last edited by SGaist
        #3

        Sorry, here is the code in text format.

        setObjectName(title);
        mspInstance = this;
        
        setFeatures( QDockWidget::DockWidgetMovable|QDockWidget::DockWidgetFloatable);
        setFocusPolicy(Qt::StrongFocus);
        
        QPalette backgroundColor(palette());
        backgroundColor.setColor(QPalette::Background, Qt::black);
        
        QWidget *pBaseWidget = new QWidget;
        QGridLayout *pLayout = new QGridLayout;
        
        pBaseWidget->setAutoFillBackground(true);
        pBaseWidget->setPalette(backgroundColor);
        
        pBaseWidget->setLayout(pLayout);
        setWidget(pBaseWidget);
        pBaseWidget->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::MinimumExpanding));
        
        pLayout->addWidget(mpDateGroup(), 0, 0, 1, 2);
        pLayout->addWidget(mpCheckboxGroup(), 1, 0, 1, 2);
        pLayout->addWidget(mpTransmitterGroup(), 2, 0);
        pLayout->addWidget(mpReceiverGroup(), 2, 1);
        pLayout->addWidget(mpDropDownMenuGroup(), 3, 0, 1, 2);
        
        QLabel *pTitle = new QLabel("Recommended Schedule");
        QFont myTitleFont("times", 24);
        pTitle->setFont(myTitleFont);
        pTitle->setAlignment(Qt::AlignCenter);
        pTitle->setStyleSheet("background:lightBlue");
        pLayout->addWidget(pTitle, 4, 0, 1, 2);
        
        pLayout->addWidget(mpProgressBarGroup(), 5, 0, 1, 2);
        pLayout->addWidget(mpRequirementGroup(), 6, 0, 1, 2);
        
        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Do not forget to add the coding tags to make it readable.

          This code does not seem to include the whole of your interface.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - 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