Intercepting mouse event
-
I'm working on plugin for Qt and I'd wonder how could I intercept double-click signal when user double clicks on one of the files listed in navigation pane under Projects?
Cannot insert image (I have it on my hard drive) so this is the link to the same question on SO:
http://stackoverflow.com/questions/14232269/intercepting-double-click -
Please ask that on "qt-creator mailing list":http://lists.qt-project.org/mailman/listinfo/qt-creator, too, you'll get better probability of response.
-
You should really direct questions like this to "our mailing list":http://lists.qt-project.org/ or IRC (#qt-creator on freenode network). All devs follow both of these channels, hardly anyone bothers with more than those and asking the devs is bound to be more productive than asking passers by in random places on the internet!
To answer your question: You can't. The activated() signal of the ProjectTreeView is connected to the openItem(...) method of the ProjectTreeWidget which will open an editor for that file. I do not know what you want to do, but I do not think that it is good if you end up doing something drastically different than opening an editor... that would be very inconsistent.
You are of course free to register your own editors for your mime types.
-
Hi sierdzio, thanks, will give it a go.
-
@Tobias Hunger
I'm actually working on a plugin which will in effect ease the way of working with .pro file, which at this moment is purely textual job. I believe that being able to transform it from having to type everything into simply selecting most of the available options would be of great help.
I'm not sure if you really cannot intercept this event, will try and will post results.
Thanks. -
Why don't you just register your own editor for pro/pri files then? Double-clicking on the pro-files in the projects mode will work fine then. It will also work when opening those files from other places (which won't be the case if you hack into the ProjectTreeWidget).
PS: There already is a ProFileEditor. Maybe you can just extend that one?
-
@Tobias
Hey, that may just be what I wanted! Thanks.