Results 1 to 2 of 2

Thread: Problem with KeyPress event and QTableView

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2008
    Posts
    17
    Qt products
    Qt4
    Platforms
    Windows

    Default Problem with KeyPress event and QTableView

    Hi,

    I have an issue with moving next cell in a QTableView by pressing Key_Return. In some cases like a cell has dropdown list box as its item and from that cell if i press Enter/Return key it throws a exception while exetuing this->setCurrentIndex(Index).

    this refers to a object of QTableView
    and Index refers to a QModelIndex.

    The exception is
    ASSERT: "VisualRow != -1" in file itemviews\qtableview.cpp line 932. (I am using Qt 4.4).
    sample code segment

    Qt Code:
    1. {
    2. const QModelIndex& Index = this->moveCursor(QAbstractItemView::MoveNext, Qt::KeypadModifier);
    3. if(Index.isValid())
    4. this->setCurrentIndex(Index);
    5. }
    To copy to clipboard, switch view to plain text mode 

    the problem only occurs if the current cell itself has a ComboBox or other QWidgets

    Please share your ideas to solve ths issue.
    Last edited by jpn; 16th January 2009 at 19:54. Reason: missing [code] tags

Similar Threads

  1. QTableView doubleclicked event not working
    By sgmurphy19 in forum Qt Programming
    Replies: 6
    Last Post: 15th March 2009, 10:00

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.