PDA

View Full Version : Click Region



Atomic_Sheep
1st July 2012, 07:16
Hi guys, in another thread, I got my OpenGL window to load a .bmp image.

http://www.qtcentre.org/threads/49018-OpenGL-Texture-Loading-Problem?highlight=

I'm now trying to create click regions in this OpenGL window. The thing I'm not sure about is how best to go about this problem. The most logical way is to use composition i.e. my window has buttons, but the way I see it, this would mean I would have to create a bunch of buttons by hand. Yes, the amount of time that it took for me to come here and type up this question, I could have spent creating those buttons and would have most likely finished them all by now, but I was wondering if there is a more elegant solution?

For my button class, I've inherited QWidget for the purpose of being able to accept QMouseEvents and QKeyEvents. Once the button is pressed, it emits it's unique signal.

Any comments, suggestions?

FYI I'm not really interested in SDL I think it's called and the like, in terms of solutions, I want to put custom graphics for each button so the default OS buttons will not be acceptable for me - hence the custom job.