Results 1 to 2 of 2

Thread: QTableWidget item in edit state crash when mouse cursor go over

  1. #1

    Default QTableWidget item in edit state crash when mouse cursor go over

    Hi

    I'mk facing a very strange problem in my application. I have a QTableWidget control and when I want to add a new item I use the following code:

    QTableWidgetItem* pNewItem = new QTableWidgetItem();

    ui->List->insertRow(0);
    ui->List->setItem(0, 0, pNewItem);
    ui->List->editItem(pNewItem);

    I use this solution for allow the user to type the name of the new item directly into the edit field. This solution work but have a very strange problem. When I go with the mouse cursor over the item when is in edit mode the application crash. The error seem connected to some unallocated bitmap memory inside the qt code. I'm developing under Windows 7 64bit.

    Someone know what I'm doing wrong?

  2. #2
    Join Date
    Jul 2009
    Location
    Enschede, Netherlands
    Posts
    462
    Thanked 69 Times in 67 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTableWidget item in edit state crash when mouse cursor go over

    Why not just set the QAbstractItemModel::ItemIsEditable flag on the newly created table widget item?
    Horse sense is the thing that keeps horses from betting on people. --W.C. Fields

    Ask Smart Questions

Similar Threads

  1. How to edit Horizontal Header Item in QTableWidget
    By ioannis in forum Qt Programming
    Replies: 6
    Last Post: 5th March 2013, 19:50
  2. Accessing check state of CheckBox in QTableWidget
    By lnxusr in forum Qt Programming
    Replies: 6
    Last Post: 22nd November 2009, 02:13
  3. Mouse Cursor Problem
    By ToddAtWSU in forum Qt Programming
    Replies: 2
    Last Post: 1st October 2007, 19:16
  4. Replies: 8
    Last Post: 15th May 2007, 10:21
  5. How to hide mouse cursor
    By kiransu123 in forum Qt Programming
    Replies: 1
    Last Post: 23rd March 2007, 18:52

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.