Results 1 to 6 of 6

Thread: QTableWidget crashing

  1. #1
    Join Date
    Feb 2006
    Posts
    87
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default QTableWidget crashing

    hey there i have set up a QTableWidget called demands and is set up with a signal and slot of the type below

    Qt Code:
    1. connect(demands, SIGNAL(itemChanged(QTableWidgetItem*)), this, SLOT(obtain_values(QTableWidgetItem*)));
    To copy to clipboard, switch view to plain text mode 

    but when i try to add a item to the table from a seperate slot that i have using a button - the program crashes. when i take the line above out it adds the item no problem, but i need that line to get the data from the table....is there any way to get around this so that i can get data from the table and add items outside the constructor?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTableWidget crashing

    Maybe obtain_values() triggers the itemChanged() signal?

  3. #3
    Join Date
    Feb 2006
    Posts
    87
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QTableWidget crashing

    yeah ur rite it actaully does, but i need that method to record the values in the table ..is there a way around it?

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTableWidget crashing

    Why it must be connected to the itemChanged() signal?

  5. #5
    Join Date
    Feb 2006
    Posts
    87
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QTableWidget crashing

    i need it because otherwise there is no way that the values get recorded. am i better of having a seperate button or something to record the values?

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTableWidget crashing

    What does the obtain_values() method do? Does it read data into the QTableWidgetItem or store data from the QTableWidgetItem somewhere?

Similar Threads

  1. QComboBox in QTableWidget : display troubles.
    By Nyphel in forum Qt Programming
    Replies: 2
    Last Post: 13th October 2007, 23:29
  2. QTableWidget (resizing rows, turning off selection, etc.)
    By kiss-o-matic in forum Qt Programming
    Replies: 6
    Last Post: 11th January 2007, 01:57
  3. print QTableWidget
    By chak_med in forum Qt Programming
    Replies: 3
    Last Post: 4th November 2006, 18:46
  4. QTableWidget editing question
    By Trasmeister in forum Qt Programming
    Replies: 1
    Last Post: 20th September 2006, 18:46
  5. Replies: 6
    Last Post: 5th March 2006, 21:05

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.