Don't you need to enable mouse tracking to get these?Originally Posted by mickey
Don't you need to enable mouse tracking to get these?Originally Posted by mickey
Hi,
I link a loadButton to a SLOT:
Then:Qt Code:
MainfForm::load { loadButton->installEventFilter(this->myWidget1); loadButton->installEventFilter(this->myWidget2); loadButton->installEventFilter(this->myWidget3); ...... QFileDialog fd; ........... }To copy to clipboard, switch view to plain text mode
I have 3 instance of MyWidget. The MouseMoveEvent in myWidget start when I choose a file "with doubleClick" in QFileDialog but printf inside QMouseEvent (in MyWidget) saysQt Code:
cout << "filter\n"; cout << e->type() << endl; cout << "filter out\n"; return TRUE; } }To copy to clipboard, switch view to plain text mode
that only mouseMove start...![]()
A hint? Thanks
Regards
did you enable mouse tracking ??? Basically a widget records mose move only when a click occurs...
You can change that settings :
Current Qt projects : QCodeEdit, RotiDeCode
yes I proved.Don't change...I'm thinking that QmouseMoveEvent starts for some strangeOriginally Posted by fullmetalcoder
reason.......
Regards
Because you tried to contact me via skype and sending message failed, here's what I said there:
It would help if you'd provide a full working example with source as short as possible so I can try on my machine. I and others already suggested what could be the reason. If none of our tipps work, we have to see code. Often while you create such a like 100 LOC application, you solve the problem because the problem does not occur in the small testapp. Then you will compare what is different and hopefully find the reason. If not, post the programm
It's nice to be important but it's more important to be nice.
axeljaeger, thanks for reply...
I solved my problem but I don't understand why qMouseMoveEvent of MyWidget:: starts
starts after the code of loadButton():
(With the printf above I see that QMouseMoveEvent of myWidget starts after (out) loadButtton(). But Why? I coded removeFilter at the end of loadbutton() but QmouseMoveEvent starts after and so don't filter it)Qt Code:
void MainForm::loadbutton() { this->myWidget->installEventFilter(this->myWidget); ............. printf("end mainform()LoadButt\n"); }To copy to clipboard, switch view to plain text mode
With cout << e->type I see all QEvent on myWidget and MouseMove runs only after the oadButton()...so I filter out only one (setMouseTracking is off) QMouseMove and I put removeFilter in the eventFilter (but I don't LIKE this....) .Qt Code:
if (obj == this) { cout << e->type() << endl; this->removeEventFilter(this); cout << "filter out\n"; return TRUE; } else { } } }To copy to clipboard, switch view to plain text mode
What do you think of this?
thanks
Regards
Bookmarks