Is there any tutorial about mouse events?

Ralf Nolden Ralf.Nolden at post.rwth-aachen.de
Thu Mar 16 21:11:29 UTC 2000


Peter Thorstenson wrote:

> I'm trying to understand how to use the
> mouseDoubleClickEvent ( QMouseEvent * )
> for the QListBox widget. :(

> libFiles = new QListBox(Base);
> libFiles->setGeometry(10,13,195,215);
> libFiles->setAutoBottomScrollBar(true);
> //libFiles->mouseDoubleClickEvent(QMouseEvent *);   ??????????
that doesn´t work ;-)

mouseDoubleClickEvent is a virtual event handler which you have to
reimplement in a derived class. In your case, if you don´t have a signal
by the orignal class that indicates you a double click, you have to
derive from QListBox, overwrite mouseDoubleClickEvent and in that
overwritten method you can retrive the selected item and emit a signal.
Then create your libFiles instance from your implemtation of QListBox.

> Is there any tutorial out there that could help me???
Yes, see the kdevelop 1.1 tutorial handbook. There are some event
handlers overwritten, at least in the appendix holding the complete
sources. It´s a drawing app (kscribble) but should help you
understanding how to overwrite event handlers. Also read the KDE Library
Reference Guide !!! That is the ultimative collection to get started
with event handling and signals/slots.

> Peter Torstenson
> CoconutBeach
> Rio de Janeiro
> 29 degrees and sunny....

Ralf

Vulkan Bräu, 10 degrees and light brown ;-)


-- 
**********************************
Ralf Nolden

Ardennenstr. 41 
52355 Düren

Tel. 02421/502758

The KDevelop Project
http://www.kdevelop.org

Email: rnolden at kdevelop.de
**********************************





More information about the KDevelop mailing list