Results 1 to 2 of 2

Thread: QT crashes when trying to insert data into QTableWidgets

  1. #1
    Join Date
    Nov 2012
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Exclamation QT crashes when trying to insert data into QTableWidgets

    I have noticed a particularly weird feature when using QTableWidgets and I'm hoping there is an easy work-around or that I am missing something easy. Often times after creating new tables, QT will crash when you try to run a build where you insert information into the Table. One way to fix this is to double click on the table, go the "items" tab, click "properties" at the lower right, and make sure that each cell has a property where the word "text" is BOLD. If the word text is not bold, that cell will not accept data and it will cause a crash. So say you have a table that is 5 X5, that means you have to make sure that 25 cells have the word "text" bold before it will work properly. To make this "text" turn bold you must double click into each cell. It turns from regular to bold right then and the next time you run it will work properly (assuming you got all 25 cells, if you only get 24, crash). Is this a bug? Or is there a setting I am missing?

    I have a table that has 10 rows and 1000 columns, I don't think I want to click 20,000 (10,000 cells each double clicked) times in order for my table to accept data....any ideas?


    attached is a pic to help any confusion, its a hard issue to describe. Notice in the right section at the top how the word "text" is bold, and nothing else is. This is achieved by double clicking into the cell, prior it would have been regular and not bold. If I do not do this for each cell my build will crash. Even if I have to update only 1 cell, if ALL cells aren't fixed it will crash. ITEMWEIRD.jpg


    HIGGZ BOSON
    the quantum mechanic

  2. #2
    Join Date
    Feb 2008
    Posts
    491
    Thanks
    12
    Thanked 142 Times in 135 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: QT crashes when trying to insert data into QTableWidgets

    When you add columns or rows to a QTableWidget in designer the cells are empty. I assume your program is crashing where you are doing some processing. If that is the case check to see if the cell has an item in it:
    Qt Code:
    1. if( QTableWidget::item(row, column) != 0 )
    2. //do something
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. SOLVED : SqlQuery can't insert data.
    By naptizaN in forum Qt Programming
    Replies: 1
    Last Post: 18th July 2012, 14:32
  2. Getting / setting data on QTableWidgets
    By orfner in forum Qt Programming
    Replies: 1
    Last Post: 30th October 2011, 03:33
  3. Replies: 5
    Last Post: 10th June 2011, 11:58
  4. Insert data to QTableView
    By Lodhart in forum Qt Programming
    Replies: 1
    Last Post: 23rd April 2009, 10:38
  5. insert additional data into qdirmodel
    By killerwookie99 in forum Qt Programming
    Replies: 0
    Last Post: 13th October 2008, 16:09

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.