Unsolved how to have double click on a image on single click
-
I display a QPixMap in QTreevIew . When the user double clicks on the image I should bring QColorDialog
I tried following code but I can get the behavior on single click but I want the behavior only on double click
MyInstView::myInstView(QWidget* dparent)
: QTreeView(dparent),
{
connect(this, SIGNAL(clicked(const QModelIndex&)),
this, SLOT(clickInstance(const QModelIndex&)));
} -
Hi,
Why not use the doubleClicked signal ?
-
Hi, try
connect(this,SIGNAL(doubleclicked(const QModelIndex&)),
-
I am getting following message when I start my GUI
Object::connect: No such signal GQInstView::doubleclicked(QModelIndex)
the code is as follows -----
GQInstView::GQInstView(QWidget* dparent)
: QTreeView(dparent), model(0),
{
QObject::connect(this, SIGNAL(doubleclicked(const QModelIndex&)), this, SLOT(clickInstance(const QModelIndex&)));
}Is there anything I am missing
-
Because it's
doubleClicked
. Casing is important.If you are using Qt 5, then you should go for the new syntax. That would have already failed at compile time.
-
Yes @SGaist is correct and sorry, it was my bad speeling :-)