Results 1 to 5 of 5

Thread: QTableView::doubleClicked(const QModelIndex &) isn't emitted

  1. #1
    Join Date
    Jul 2009
    Posts
    12
    Qt products
    Qt4
    Platforms
    Windows

    Default QTableView::doubleClicked(const QModelIndex &) isn't emitted

    Hi,

    I am using QTableView class. I want when user double clicks on the item (e.g. row = 1, column = 1) dialog appears on the screen.

    I wrote the following:
    Qt Code:
    1. MainWindow::MainWindow(/* PARAMS */)
    2. {
    3. ...
    4. connect(tableView, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT(showDialog(const QModelIndex &)));
    5. ...
    6. }
    To copy to clipboard, switch view to plain text mode 

    but the slot isn't called .

    Why double click signal isn't emitted?

    thanks,
    Hasmik.

  2. #2
    Join Date
    Apr 2007
    Location
    Sunny Darwin, NT Australia
    Posts
    186
    Thanks
    29
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QTableView::doubleClicked(const QModelIndex &) isn't emitted

    Maybe you have a missing slot or incompatible sender/receiver arguments.
    Do you see a warning message in the output window ? it's a good clue.

  3. #3
    Join Date
    Jul 2009
    Posts
    12
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QTableView::doubleClicked(const QModelIndex &) isn't emitted

    Thanks for the reply.

    There is no warnings. The slot is defined correct. I read in the Internet that QTableView doesn't emit signals. Is it correct?
    I surprised because I use QTreeWidget and I haven't met any problem.

  4. #4
    Join Date
    Apr 2007
    Location
    Sunny Darwin, NT Australia
    Posts
    186
    Thanks
    29
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QTableView::doubleClicked(const QModelIndex &) isn't emitted

    QTableView DOES emit signal.
    Is your slot defined in the same file/class ?

  5. #5
    Join Date
    Jul 2009
    Posts
    12
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QTableView::doubleClicked(const QModelIndex &) isn't emitted

    My slot is defined in the MainWindow class which is derived from MainWindow. This slot has the same argumnts as doubleclick signal has. I want to mention that I have defined a new model and this model is used in QTableView.

Similar Threads

  1. beginInsertRows was not declared ???
    By travlr in forum Qt Programming
    Replies: 2
    Last Post: 6th June 2009, 21:22
  2. QAbstractProxyModel to do a Tree
    By xgoan in forum Qt Programming
    Replies: 3
    Last Post: 18th November 2008, 17:31
  3. QSql*Model + QTreeView : make a tree
    By punkypogo in forum Qt Programming
    Replies: 18
    Last Post: 24th October 2008, 18:14
  4. QAbstractItemModel newbie question
    By okellogg in forum Qt Programming
    Replies: 14
    Last Post: 18th February 2008, 12:30
  5. Replies: 6
    Last Post: 21st September 2007, 13:51

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.