Results 1 to 5 of 5

Thread: QLabels not getting resizeEvent--how to invoke?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,330
    Thanks
    317
    Thanked 871 Times in 858 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QLabels not getting resizeEvent--how to invoke?

    I expected their resizeEvent methods to be called when the bars are hidden and shown, but they are not.
    I am guessing that the layout is calling QWidget::resize() directly on your label, and that triggers a repaint of the widget. As an experiment, you could replace your custom QLabel with a custom widget derived directly from QWidget and see what happens there. If you do that, be sure to implement the sizeHint() (and maybe minimumSizeHint()) method so the layout has some guidance.
    Last edited by d_stranz; 3rd February 2023 at 17:14.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  2. The following user says thank you to d_stranz for this useful post:

    davethomaspilot (3rd February 2023)

Similar Threads

  1. Carousel with QLabels
    By ZajtiM in forum Newbie
    Replies: 1
    Last Post: 19th September 2021, 00:38
  2. Two QLabels transparent to each other
    By augusbas in forum Qt Programming
    Replies: 3
    Last Post: 3rd November 2010, 06:19
  3. How to show QLabels
    By Pavel Abrosimov in forum Qt Programming
    Replies: 24
    Last Post: 9th July 2009, 09:39
  4. Dynamic QLabels
    By rajeshs in forum Qt Programming
    Replies: 3
    Last Post: 30th May 2008, 11:26
  5. QSpinBox or QLabels
    By ToddAtWSU in forum Qt Programming
    Replies: 10
    Last Post: 27th November 2007, 20:10

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
  •  
Qt is a trademark of The Qt Company.