Results 1 to 4 of 4

Thread: Im became fool with QTableWidgetItem

  1. #1
    Join Date
    Jan 2007
    Posts
    95
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Angry Im became fool with QTableWidgetItem

    My project works fine, and now (and i dont know why) have and error. Im trying to read from a tablewidget and write to a file, and I use this functions:

    Qt Code:
    1. QString Sheet::getcellvalue(int row,int col)
    2. {
    3. QTableWidgetItem *newItem = tabla->item(row,col);
    4. QString qv = newItem->text();
    5. return qv;
    6. }
    To copy to clipboard, switch view to plain text mode 

    where "tabla" is a QTableWidget. Now the compiler says:

    Excepción no controlada en 0x6524c1ac en QTDAM.exe: 0xC0000005: Infracción de acceso al leer la ubicación 0x00000000.

    I was using .toStdString to convert QStrings to strings, and now .toLatin1. And when i change this, this code give me this error ????????.

    Why? and How to programm well.

    Please help.
    Thanks

  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: Im became fool with QTableWidgetItem

    Check if newItem != 0.

  3. #3
    Join Date
    Jan 2007
    Posts
    95
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Im became fool with QTableWidgetItem

    Yes, this is the problem. First time I used this function, "tabla" was no created, but if I checked newItem and return 0 (if is 0) works.

    Thank you very much. God pay you with a lot of children or a lot of money (you choose but remember in matrix film, blue pill or red pill)

    Thanks

  4. #4
    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: Im became fool with QTableWidgetItem

    Or with a lot of children who will make a lot of money

Similar Threads

  1. Reference QTableWidgetItem
    By regenbiegen in forum Qt Programming
    Replies: 2
    Last Post: 1st February 2007, 11:34
  2. making up a QTableWidgetItem
    By chaosgeorge in forum Qt Programming
    Replies: 1
    Last Post: 22nd November 2006, 06:36
  3. Auto text select in QTableWidgetItem
    By tstankey in forum Newbie
    Replies: 2
    Last Post: 5th October 2006, 20:40
  4. Interesting little Segfault w/r to signal/slot connection
    By Hydragyrum in forum Qt Programming
    Replies: 24
    Last Post: 12th September 2006, 19:22
  5. 3 Different Color for in QTablewidgetItem
    By jnana in forum Qt Programming
    Replies: 3
    Last Post: 21st March 2006, 11:38

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.