Results 1 to 3 of 3

Thread: QTableWidgetItem setData crashes everytime.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2010
    Posts
    9
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60

    Default QTableWidgetItem setData crashes everytime.

    Hi at all,
    I'm trying to simply set a QString in a QTableWidgetItem.

    Qt Code:
    1. ui->tableWidget->item(0,0)->setData(Qt::DisplayRoleRole,"foo");
    To copy to clipboard, switch view to plain text mode 

    But when I do this the little app crashes.

    Instead, if I write something before in the same cell by myself, the setData works out.

    It sounds like the item object isn't still created when I try to setData. When I before write something in the same cell trought the GUI, the object is created and the the setData istruction works.

    Any Idea? that's real strange.

    Sorry for my english

    Gianluigi
    Last edited by Wing_Zero; 16th August 2010 at 14:10.

Similar Threads

  1. QTableWidgetItem: setData or setText?
    By mattc in forum Qt Programming
    Replies: 1
    Last Post: 5th January 2010, 18:34
  2. QSqlTableModel and possible bug with setData?
    By sylvainb in forum Qt Programming
    Replies: 2
    Last Post: 25th February 2009, 21:43
  3. update() works fine sometime but not everytime..!!
    By salmanmanekia in forum Qt Programming
    Replies: 19
    Last Post: 22nd August 2008, 09:11
  4. setData()
    By starcontrol in forum Qt Programming
    Replies: 2
    Last Post: 2nd May 2008, 08:54
  5. setData()
    By coderbob in forum Qt Programming
    Replies: 4
    Last Post: 28th February 2008, 12:51

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.