Results 1 to 5 of 5

Thread: Remove drawed lines with Repeater on ComboBox value changed

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts

    Default Re: Remove drawed lines with Repeater on ComboBox value changed

    The repeater will always create as many element as its model says.

    Since your model is a simple number, just decrement that number.

    Cheers,
    _

  2. #2
    Join Date
    Aug 2016
    Posts
    36
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Remove drawed lines with Repeater on ComboBox value changed

    Once some number of lines is drawn, they will not be deleted when a smaller number of lines is given to the model. So how to delete them and start drawing again?

  3. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts

    Default Re: Remove drawed lines with Repeater on ComboBox value changed

    A Repeater that operates on a primitive model, a number or a list, will always recreate the number of delegates for the current model's count.

    I.e. if the number changes from 1 to 2, it will delete all delegates and create 2.
    If the number changes from 2 to 1, it will delete all delegates and create 1.

    In your code the most puzzlng thing is why you create a new additional Analysis component every time the combobox changes.

    Cheers,
    _

  4. #4
    Join Date
    Aug 2016
    Posts
    36
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Remove drawed lines with Repeater on ComboBox value changed

    SOLVED. Thank you.
    Last edited by bchinfosieeuw; 10th August 2016 at 15:38.

Similar Threads

  1. PropertyChanges on repeater elements
    By joko in forum Qt Quick
    Replies: 4
    Last Post: 15th October 2014, 11:36
  2. QPainter doing a distortion in drawed pixmap
    By Momergil in forum Qt Programming
    Replies: 2
    Last Post: 14th July 2014, 12:44
  3. ComboBox with lines
    By Braunstein in forum Qt Programming
    Replies: 1
    Last Post: 16th March 2010, 08:12
  4. Remove Duplicate Lines in a file
    By nmuntz in forum Qt Programming
    Replies: 4
    Last Post: 12th January 2009, 00:04
  5. how to save somtihing drawed on QPaiter to an image?
    By cxl2253 in forum Qt Programming
    Replies: 3
    Last Post: 15th December 2006, 09:34

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.