Results 1 to 7 of 7

Thread: [How to ?] Writing QTableWidget cells.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2008
    Location
    Algarve, Portugal
    Posts
    288
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60
    Thanks
    23
    Thanked 32 Times in 28 Posts

    Default Re: [How to ?] Writing QTableWidget cells.

    You have to alocate memory to your pointer

    Qt Code:
    1. itab = new QTableWidgetItem; // add this line
    2. itab->setText("X");
    3. tableWidget->setItem(0, 0, itab);
    To copy to clipboard, switch view to plain text mode 

    It was crashing because you're setting a value to an unalolocate pointer.
    Last edited by john_god; 3rd April 2010 at 23:58.
    __________________________________________________
    My projects: calculator MathGraphica ; SuperEpicMegaHero game ; GooglePlay ; bitbucket ; github
    Like my projects ? Buy me a kofi

  2. The following user says thank you to john_god for this useful post:

    soulless (4th April 2010)

Similar Threads

  1. read QTableWidget cells
    By navid in forum Newbie
    Replies: 8
    Last Post: 4th April 2010, 10:40
  2. Merging cells in QTableWidget
    By lyucs in forum Newbie
    Replies: 1
    Last Post: 22nd January 2010, 19:15
  3. Focus of cells in a QTableWidget
    By SailinShoes in forum Qt Programming
    Replies: 4
    Last Post: 9th June 2008, 08:19
  4. QTableWidget, header cells margin
    By DpoHro in forum Qt Programming
    Replies: 4
    Last Post: 17th January 2008, 23:38
  5. QTableWidget with overlapping cells (span)
    By rhi in forum Qt Programming
    Replies: 2
    Last Post: 13th May 2006, 18:44

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.