Results 1 to 2 of 2

Thread: inserting rows performance with custom widget

  1. #1
    Join Date
    May 2011
    Posts
    132
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    14

    Default inserting rows performance with custom widget

    How to improve loading data, inserting list items with custom widget using setIndexWidget(). The speed is terrible slow, without widget inserts much faster. The widget is a QLabel, which I need it to make a text as a hyper link.

    Qt Code:
    1. QLabel *link = new QLabel(this);
    2. connect(link , SIGNAL(linkActivated(QString)), this, SLOT(openLink(QString)));
    3. nameLink->setText("<html><a href='"+fileID+"'><font color='#616E7F'>"+text+"</font></a></html>");
    4.  
    5. nameItem->setData(name, ListView::SORTBYFILEDATE);
    6. nameItem->setData(linkID, ListView::LINKID);
    7.  
    8. model()->setItem(row, col, item);
    9. setIndexWidget(nameItem->index(),link);
    To copy to clipboard, switch view to plain text mode 

    inserting about 20 items takes about a second

    How QML about adding QML widget there ?
    Thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: inserting rows performance with custom widget

    Don't use widgets. Implement a proper item delegate.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 3
    Last Post: 3rd June 2011, 15:50
  2. inserting custom Widget to listview
    By Amit_3117 in forum Qt Programming
    Replies: 20
    Last Post: 27th August 2010, 18:38
  3. Replies: 2
    Last Post: 23rd July 2008, 18:48
  4. Efficient way of inserting rows?
    By afflictedd2 in forum Qt Programming
    Replies: 1
    Last Post: 14th July 2008, 21:01
  5. Treeview scrollbar not updating when inserting rows
    By Khal Drogo in forum Qt Programming
    Replies: 11
    Last Post: 29th November 2007, 14:13

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.