Results 1 to 2 of 2

Thread: Deleting a row in QTable having custom widgets

  1. #1
    Join Date
    Jan 2007
    Posts
    1
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Deleting a row in QTable having custom widgets

    I am trying to delete rows is table (Qt-3.1). The rows initially seem to be deleted, but when i add new rows, old rows show up somewhere in between, thus not being deleted properly. I am inheriting Qtable, with support for large table. Also one of the column in all rows has custom widget.
    I am calling removeRow(row).

    The re-implemented functions are :
    Qt Code:
    1. void Table::resizeData( int ) {}
    2.  
    3. QTableItem* Table::item( int r, int c ) const {
    4. //printf("accessing item at : %d %d \n", r, c);
    5. return contents.find( indexOf( r, c ) );
    6. }
    7. void Table::setItem( int r, int c, QTableItem *i ) {
    8. contents.replace( indexOf( r, c ), i );
    9. }
    10. void Table::clearCell( int r, int c ) {
    11. contents.remove( indexOf( r, c ) );
    12. }
    13. void Table::insertWidget( int r, int c, QWidget *w ) {
    14. widgets.replace( indexOf( r, c ), w );
    15. }
    16. QWidget* Table::cellWidget( int r, int c ) const {
    17. return widgets.find( indexOf( r, c ) );
    18. }
    19. void Table::clearCellWidget( int r, int c ) {
    20. widgets.remove( indexOf( r, c ) );
    21. }
    To copy to clipboard, switch view to plain text mode 


    Do we need to handle removal of rows specially for large tables or what else could be the problem ?


    Regards,

    Madhu
    Last edited by wysota; 18th January 2007 at 10:54. Reason: missing [code] tags

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

    Default Re: Deleting a row in QTable having custom widgets

    Hard to say, the size of the table shouldn't matter. Could you post a minimal compilable example reproducing the problem?

Similar Threads

  1. create custom widgets
    By nimmyj in forum General Discussion
    Replies: 1
    Last Post: 20th November 2006, 08:24
  2. Global includes with designer custom widgets
    By mab in forum Qt Programming
    Replies: 2
    Last Post: 5th October 2006, 22:06
  3. Compiling custom Qt3 Widgets Gives warning in VC++6 Compiler
    By sunil.thaha in forum Qt Programming
    Replies: 4
    Last Post: 9th June 2006, 12:44
  4. container populated with custom widgets
    By momesana in forum Qt Programming
    Replies: 2
    Last Post: 16th April 2006, 21:02
  5. custom widgets as plugins
    By cwalsh in forum Qt Programming
    Replies: 7
    Last Post: 22nd February 2006, 22:02

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.