Results 1 to 4 of 4

Thread: Dynamic QLabels

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    May 2008
    Location
    Kyiv, Ukraine
    Posts
    418
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    1
    Thanked 29 Times in 27 Posts

    Default Re: Dynamic QLabels

    Quote Originally Posted by rajeshs View Post
    Hi All,

    I am having one QFrame in QDialog, I need to create dynamic labels based on some input given by user.the number of label is based on user input.

    [ for Ex if user gives 6 as input i need 6 labels and then next if he gives 4 second time i need only 4 ,so i need to remove 2 labels now]

    How to achieve this ?
    What if you do something like this:

    Qt Code:
    1. for (int i = 0; i < numberOfLabelsSpecified; i++) {
    2. ...
    3. yourLayout->addWidget(new QLabel(........), row, column);
    4. ...
    5. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by jpn; 30th May 2008 at 12:05. Reason: missing [code] tags
    I'm a rebel in the S.D.G.

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

    rajeshs (30th May 2008)

Similar Threads

  1. Dynamic number of QLabel
    By jd in forum Qt Programming
    Replies: 2
    Last Post: 4th April 2008, 18:09
  2. Static vs. Dynamic Building for GPL Open Source Software Release
    By brent99 in forum Installation and Deployment
    Replies: 6
    Last Post: 11th March 2008, 21:46
  3. Rezizing the Qlabels vertically
    By anju123 in forum Qt Programming
    Replies: 3
    Last Post: 3rd January 2008, 16:35
  4. Table made from QLabels
    By T4ng10r in forum Qt Programming
    Replies: 1
    Last Post: 25th April 2007, 07:58
  5. Dynamic grid layout
    By eriwik in forum Qt Programming
    Replies: 1
    Last Post: 12th June 2006, 16:19

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