Results 1 to 9 of 9

Thread: How to create labels dynamically according to the slider value

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Join Date
    Jan 2013
    Location
    Bangalore, India
    Posts
    36
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    9
    Thanked 2 Times in 2 Posts

    Default Re: How to create labels dynamically according to the slider value

    @anda_skoa I didn't mean about loops

    int no_of labels = ui->slider->value();

    for(int i=1; i<=no_of_labels; i++)
    {
    // what I have to do here??
    }


    Suppose if no_of_labels is 5, i have to create 5 labels dynamically label1, label2, label3, label4 & label5 and display images in each label. how to do this?

    I have created 8 labels statically and displaying the images according to the no_of_labels. Suppose if the no_of_label is 5, 5 labels are shown with corresponding images, the remaining three labels are left free. I dont want that. so I decided to create labels dynamically depending on the slider value.

    Jakr13
    Last edited by jakr13; 5th December 2014 at 08:22.

Similar Threads

  1. Dynamically change slider max range
    By Don_Hannes in forum Qt Programming
    Replies: 2
    Last Post: 3rd October 2012, 16:19
  2. Replies: 2
    Last Post: 21st March 2010, 09:01
  3. how to dynamically add labels
    By mohanakrishnan in forum Qt Programming
    Replies: 5
    Last Post: 20th October 2009, 10:19
  4. Tick Labels for Slider
    By jcraig in forum Qt Tools
    Replies: 2
    Last Post: 9th August 2007, 17:21

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.