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
connect(this, SIGNAL(clicked(const QModelIndex&)),
this, SLOT(clickInstance(const QModelIndex&)));
Why not use the doubleClicked signal ?
I am getting following message when I start my GUI
Object::connect: No such signal GQInstView::doubleclicked(QModelIndex)
the code is as follows -----
: QTreeView(dparent), model(0),
QObject::connect(this, SIGNAL(doubleclicked(const QModelIndex&)), this, SLOT(clickInstance(const QModelIndex&)));
Is there anything I am missing
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 :-)