You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

jacek

Master

  • "jacek" is male

Posts: 2,729

Location: Warsaw, Poland

  • Send private message

21

Friday, December 23rd 2005, 11:48pm

RE: EventFilters

Quoted

From Qt docs:
void QObject::installEventFilter ( QObject * filterObj )
Installs an event filter filterObj on this object. For example:
monitoredObj->installEventFilter(filterObj);

So in your case that obj parameter will point to the "load" button.

22

Saturday, December 24th 2005, 11:26am

mouseMoveEvent & QFileDialog

Hi,

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
bool MyWidget::eventFilter(QObject* obj, QEvent* e) {
     if (obj == w->load ) {
		cout << "myWidget\n";
		if (( e->type() == QEvent::MouseButtonDblClick) || ( e->type() ==    
                           QEvent::MouseMove)) {
		  cout << "mo";
		  return  true;
		} 
		else {
			cout << "false\n";
			return false;
		}
	}

The fisrt if don't compile because w->load is a QPushButton and not a
QObject.....
Regards,

  • "wysota" is male

Posts: 4,276

Location: Warsaw, POLAND

  • Send private message

23

Saturday, December 24th 2005, 1:08pm

RE: mouseMoveEvent & QFileDialog

1. #include <qpushbutton.h>

2. You lack basic C++ knowledge, so: http://www.mindview.net/Books/TICPP/ThinkingInCPP2e.html

3. I give you a little "warning" -- this forum is not a virtual compiler, it doesn't release you from necessity of thinking and reading the docs. Your issues are plain algorithmic and/or "cplusplusish", and not really related to Qt. You are not trying to do anything on your own, but when you encounter a problem, you come here and ask us to solve it. It cannot continue this way. This thread has more than 20 posts now and it looks like you are not even a step closer to a solution. So if you want us to give you hints (hints, not complete solutions), please try to think on your own a little or I will close this thread.

I advise you to look at examples that come with Qt and use your head a little more. Thank you in advance for cooperation.