Results 1 to 5 of 5

Thread: QLabel::setText causes part of widget to disappear

  1. #1
    Join Date
    Jan 2006
    Location
    Genk, Belgium
    Posts
    36
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default QLabel::setText causes part of widget to disappear

    Hi,

    While processing a mouse press, among others the contents of the label is set (setText).

    In certain application states this causes the parent groupbox to disappear. In other states, setting the text causes the parent groupbox to reappear.

    Leaving out the call/connection to setText, everything works as expected.

    Any ideas?

    Pieter

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QLabel::setText causes part of widget to disappear

    Could we see the relevant code?
    J-P Nurmi

  3. #3
    Join Date
    Jan 2006
    Location
    Genk, Belgium
    Posts
    36
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QLabel::setText causes part of widget to disappear

    I was affraid of this (logical) reply, as it is quite difficult to isolate.

    The problem has been (partially) solved, by replacing in code changes to the form (which is designed in Qt Designer), to using custom widgets via the promotion mechanism.

    The groupbox does no longer hide an show alternately, but it height changes alternately from very small to appropriate. In the same groupbox, a Q3ListView subclass is used, maybe using Qt4 and Qt3 support gives rise to the strange behavior?

  4. #4
    Join Date
    Feb 2007
    Posts
    34
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QLabel::setText causes part of widget to disappear

    An off the cuff guess of where to look would be in the layout management for the frames/widgets involved. All it takes is one missing layout or a mis-applied sisePolicy on a widget to get behavior like you are describing.

  5. #5
    Join Date
    Jan 2006
    Location
    Genk, Belgium
    Posts
    36
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QLabel::setText causes part of widget to disappear

    Rebuilding the design from scratch resolved the problem. Probably indeed a missing/inappropriate layout.

Similar Threads

  1. Replies: 9
    Last Post: 8th May 2006, 14:21

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.