Results 1 to 3 of 3

Thread: QGridLayOut

  1. #1
    Join Date
    Sep 2008
    Posts
    32
    Thanks
    7

    Default QGridLayOut

    Hi,

    I am using Grid lay out for adding Labels in a frame. Then I am usuing setColumnStretch()
    Then I am writing some text in the label. My requirement is whenever I don't have enough space for the text the text should be truncated but it's not happening. If my text width is more then it's not reducing the width of Label i.e I am not able to reduce the width of label less than the width of text.

    I tried with setColumnMinimumWidth as zero and setSizeConstraint(QLayout::SetMinimumSize) but it didn't me help me.

    So please help me to resolve the issue.

    Regards,
    Rakesh

  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: QGridLayOut

    Try changing the horizontal size policy of the label to QSizePolicy::Maximum.
    J-P Nurmi

  3. The following user says thank you to jpn for this useful post:

    Rakesh_Kumar (9th January 2009)

  4. #3
    Join Date
    Sep 2008
    Posts
    32
    Thanks
    7

    Default Re: QGridLayOut

    Thanks a lot.

    I tried with QSizePolicy::Maximum. It didn't work but QSizePolicy::Ignored resolved my problem.

    Regards,
    Rakesh

Similar Threads

  1. QGridLayout XY position
    By paule22 in forum Newbie
    Replies: 2
    Last Post: 9th August 2008, 19:42
  2. Delete a QGridLayout and New QGridLayout at runtime
    By sabeesh in forum Qt Programming
    Replies: 1
    Last Post: 5th November 2007, 14:01
  3. Qt 3.3 QGridLayout
    By ToddAtWSU in forum Qt Programming
    Replies: 2
    Last Post: 23rd February 2007, 18:40
  4. QGridLayout
    By ToddAtWSU in forum Qt Programming
    Replies: 5
    Last Post: 29th June 2006, 21:34
  5. QPixmap and QGridLayout
    By Talon_Karrde in forum Qt Programming
    Replies: 5
    Last Post: 22nd February 2006, 13:27

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.