Results 1 to 2 of 2

Thread: Immediatly stretching Widgets

  1. #1
    Join Date
    Dec 2018
    Posts
    6
    Thanks
    1

    Default Immediatly stretching Widgets

    Hi,
    I have a QHBoxLayout with a QTableWidget and a thin Button, with the purpose to show additional informations.
    These informations (currently Placeholder LineEdits and Buttons) are in a QGridLayout together with the thinButton. Then I setStretch(0,3) and setStretch(1,1) on my QHBoxLayout. This works pretty well and i get the wanted sizes for my Table and the GridLayout.
    Then i call a method to update the TableHeaders to space them better in the smaller space. But somehow the Table->width() is not yet updated and therefore the headers won't get resized correctly.

    Can i do something to immediatly stretch the components of my QHBoxLayout? Or do i need to try an ugly workaround by gathering the individual stretch factors and calculate the new width myself before the width is changed?
    I'd really appreciate it if someone would help me. And even if not, I'd also like you to have a great day.

  2. #2
    Join Date
    Jul 2012
    Posts
    244
    Thanks
    27
    Thanked 15 Times in 14 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Immediatly stretching Widgets

    Not sure i 100% understand your problem, but isnt it enough to just call update() on the layouts in question?

Similar Threads

  1. QwtPlot stretching
    By jmsbc in forum Qwt
    Replies: 7
    Last Post: 27th August 2013, 08:43
  2. Replies: 15
    Last Post: 22nd July 2011, 03:23
  3. QGridLayout - Stop stretching
    By johnnyturbo3 in forum Newbie
    Replies: 1
    Last Post: 9th May 2011, 12:20
  4. QThread sends signal to main thread immediatly
    By BIllNo123 in forum Newbie
    Replies: 7
    Last Post: 27th August 2010, 11:32
  5. Dockwidget stretching
    By jayreddy in forum Qt Programming
    Replies: 0
    Last Post: 6th November 2009, 16:37

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.