[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Overriding mousePressEvent in QTextView
From:       Paul Dwerryhouse <paul () xenu ! ee ! mu ! oz ! au>
Date:       2000-03-20 3:12:02
[Download RAW message or body]


Hi all,

I'm trying to override mousePressEvent in a subclass of QTextView so that 
I can add the ability to click on the whole widget, but it doesn't seem to 
work.

Here is part of the code:

class ClickTextView : public QTextView {
	Q_OBJECT

protected:
	void mousePressEvent(QMouseEvent *me) {
        	emit(clicked(me));
	}

signals:
        void clicked(QMouseEvent *);

};

It all compiles fine, but when I connect the signal to a slot that should
handle it all, nothing happens when I click on the widget. There's no problem
with the slot handling code - I tried it with another widget and it worked.

What am I doing wrong?

Cheers,

Paul


-- 
"The growing use of e-mail, not to mention Web-page     | Paul Dwerryhouse
publishing, threatens to reverse the trend towards      | paul@xenu.ee.mu.oz.au
illiteracy among the supposedly educated without at the | Melbourne 
same time improving their spelling" -Michael Swaine,DDJ | Australia 

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic