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. How to change the width of QDialogbox with the click of a button
QtWS25 Last Chance

How to change the width of QDialogbox with the click of a button

Scheduled Pinned Locked Moved Unsolved General and Desktop
c++qdialogsize
2 Posts 2 Posters 526 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.
  • M Offline
    M Offline
    Mr-Workalot
    wrote on last edited by Mr-Workalot
    #1

    3c1776fa-50a3-4e02-945f-330f19e1db9d-image.png

    This is my QDialog
    as of now the width of the QDialog is 1000, on right side the QListwidget covers 500 width, when i click the button "Show/Hide" , i should be able to change the width of QDialog frm 1000 to 500 (such that i am able to hide the QListwidget) and vice versa,

    i guess i would have to use setFixedWidth(int w) function, but kinda confused how would i do it to change the QDialog size

    Pl45m4P 1 Reply Last reply
    0
    • M Mr-Workalot

      3c1776fa-50a3-4e02-945f-330f19e1db9d-image.png

      This is my QDialog
      as of now the width of the QDialog is 1000, on right side the QListwidget covers 500 width, when i click the button "Show/Hide" , i should be able to change the width of QDialog frm 1000 to 500 (such that i am able to hide the QListwidget) and vice versa,

      i guess i would have to use setFixedWidth(int w) function, but kinda confused how would i do it to change the QDialog size

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by Pl45m4
      #2

      @Mr-Workalot

      First of all, it seems that you don't use any layouts.
      Secondly, don't hide your widget by just resizing your dialog (if you are trying to do that). Better hide the widget itself.

      To set a width anyway, you can use
      QWidget::resize(int w, int h)


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      1 Reply Last reply
      3

      • Login

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