Could anyone help with this? Any information will be appreciated!
Could anyone help with this? Any information will be appreciated!
What exactly are you having problems with?
Thanks for the reply!
I'm not familiar with GUI development and I'm trying to write a skinnable window which is frameless but resizable by all its corners and edges. I'm looking for the typical/efficient way a sophisiticated GUI programmer would do.
You won't make progress by repeating what you have already said. Tell us what have you already tried, what problems have you stumbled upon, etc.
Sorry if I didn't make my question clear. As I described in #1 of this post, I was able to ahieve my goal of resizing a frameless window. But since I'm not an experienced GUI programmer, I don't know whether those two approaches are the appropriate ones. It's not like I couldn't implement such functionalities, it's just that I highly doubt the two methods I came up with groundlessly were neither proper/efficient for such purposes.
Thanks again for patiently helping me out!
Regards
Added after 6 minutes:
In other words, I want to know whether the methods I came up with are appropriate or not. If not, then what is the proper method to make a frameless window resizable (not just adding one QSizeGrip, but resizable by all four corners and four edges).
Thanks!
Last edited by Sean; 25th October 2010 at 15:16.
I would probably implement a "charm" that could be applied on a widget consisting of an event filter that would intercept mouse-move events and modify the geometry of the widget. If I wanted to have cursor changes while moving along the borders of the window I would also enable mouse tracking for the widget as part of my charm. One can also check the code for controlling sub-windows of QMdiArea.
Sean (25th October 2010)
Thanks for your opinion! I care a lot about how much computational resource my algorithm consumes and that's why I posted this thread in the first place. If I keep tracking the mouse inside the window and calculating the corresponding geometry, will that be too much computation for such a simple task? Since the code we write through regular C++/QT statements are user-level code, and there are machine/OS dependent instructions/APIs which utilize hardware acceleration for such purposes. And QT use lots of them internally to improve its efficiency, just like video game developers regularly utilize video card facilities.
Hardware acceleration or anything like it will not help you determine whether you are at a window border or not. If you want to have such information inside your application, you need mouse tracking. The only alternative is to rely on the windowing system by not applying a custom skin and using the default decorations instead.
This is not the case. Engine developers do that and game developers use the engine. In the same way that gui library programmers handle the gritty details and application programmers use the library. Game programming is a large part scripting and setting up events. There's not much 3D programming done apart from writing the odd shader or maybe using a fragment program to speed a physics calculation (in extreme cases).
I can't pretend to know your situation here, but if you're using Qt then likely you're not resource stricken- why are you rolling your own gui?
Sean (26th October 2010)
Bookmarks