[Qt-interest] QListView clicked mouse button

Efan... efanharris at gmail.com
Fri Feb 27 19:59:39 CET 2009


There is one more way you can do it , use static function of QApplication
which can also give you exactly what button got clicked
Q <qt.html#MouseButton-enum>t::MouseButtons QApplication::mouseButtons
()  [static]

Efan...

On Fri, Feb 27, 2009 at 3:39 AM, R. Reucher <rene.reucher at batcom-it.net>wrote:

> On Fri February 27 2009 11:47:07 Jesús Fernández wrote:
> > Hi,
> >
> > I need to know what was the mouse button clicked when a
> QListView::clicked
> > signal is emitted.
> >
> > How can I know the button.
> AFAIK, not via the signal... you have to reimplement
>
> void QWidget::mousePressEvent(QMouseEvent *)
>
> to access
>
> Qt::MouseButton QMouseEvent::button()
>
> and "remember" the pressed button to have it available when the slot is
> called.
>
> There may be an easier way, but I'm not aware of any...
>
> HTH, René
> --
> René Reucher
> rene.reucher at batcom-it.net
> http://www.batcom-it.net/
>
> Five is a sufficiently close approximation to infinity.
>                -- Robert Firth
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090227/8a7795c0/attachment.html 


More information about the Qt-interest-old mailing list