PDA

View Full Version : custom slider question (very advanced)



MarkoSan
20th November 2007, 03:25
Hello to all (wysota help me please)!

Here is my problem:

I need to develop a "3d" rotating slider. That means, I need a slider with rotating bitmaps (png, xp, jpeg, no relevant, i will use what qt/qtopia supports), but I simply have no idea from which class to subclass and how to do it? Does anyone has any idea how to develop this??

mchara
20th November 2007, 06:53
Hi,
Why not use QGlWidget? It seems you'll have to render your rotated image anyhow.
It would be also nice to inherit your slider from q(abstract)slider to have some functionalities for free.
Multi inheritance is commonly a bad idea, but maybe your task is a place to try it.
Or qslider having qglwidget inside, with overridden paint that draws glwidget's contents onto slider.

wysota
20th November 2007, 07:09
Hello to all (wysota help me please)!

/me to the rescue! ;)


I need to develop a "3d" rotating slider. That means, I need a slider with rotating bitmaps (png, xp, jpeg, no relevant, i will use what qt/qtopia supports), but I simply have no idea from which class to subclass and how to do it? Does anyone has any idea how to develop this??

Using QGLWidget as suggested seems to be a good idea. The downside is that you'll have a lot of work implementing the slider functionality there. Do you want the whole slider to be rotating or only some part of it? Maybe you could post a mockup picture of what you want? If you simply want animation, then inheriting QSlider might also be an option.

MarkoSan
20th November 2007, 11:57
I am searcing for example picture, but I cannot find it. Let's sey this way: I would like an 3d view of CD jukebox, selected cd or lp from jukebox is automaticly shown larger and with its cover (which is picture). Do you understand what I mean?

And this will work on custom embedded system running qtopia, sorry I did not mention it before. So let me check the hints you gave me. Thanks a lot to all!!! And what are hardware requirements using opengl classes on embedded system?

wysota
20th November 2007, 13:46
I am searcing for example picture, but I cannot find it. Let's sey this way: I would like an 3d view of CD jukebox, selected cd or lp from jukebox is automaticly shown larger and with its cover (which is picture). Do you understand what I mean?
Nope...


And this will work on custom embedded system running qtopia, sorry I did not mention it before.
This may disqualify the OpenGL approach. Embedded devices don't have a full OpenGL implementation - instead they use OpenGLES.

MarkoSan
20th November 2007, 13:52
So, is it possible to make subclass of QSlider that will draw "bended" slider?

mchara
20th November 2007, 14:09
If OpenGLES will be unable to draw textured polygon(i never used Qtopia), an alternative approach it QSlider derived class that uses QPixmap::transformed or QTransform in paintEvent, but trolls bewares thats slow. If you want it to be quick without GL you can consider SVG vector images instead of pixmaps, but you would have to provide images in svg.

However, first thing to do is checking Gl capabilities on embedded systems.

wysota
20th November 2007, 14:11
You mean something like the application bar in OS X (or whatever it is called)? I don't see any problem in doing that. Of course you'll have to do some computations to determine hit region and such. But from what you said in the previous post (I finally understood it) you might use buttons instead of a slider. Should be waaaay simpler then.

MarkoSan
20th November 2007, 14:46
You mean something like the application bar in OS X (or whatever it is called)? I don't see any problem in doing that. Of course you'll have to do some computations to determine hit region and such. But from what you said in the previous post (I finally understood it) you might use buttons instead of a slider. Should be waaaay simpler then.

Wysota, can you give some picture of this "application bar", I've googled it and the application bar I've found is not bended.

wysota
20th November 2007, 20:02
I mean the thing at the bottom of this picture:
http://www.kde-apps.org/CONTENT/content-pre3/10958-3.jpg

MarkoSan
20th November 2007, 20:21
YYYYYYYYYYYEEEEEEESSSSSSSSSS!!!!!!! :D

So, finally we now know what is the problem. So is this foundamently QSlider or what? I really do not know where to start to dig in this problem ...

wysota
20th November 2007, 20:28
I think this in particular is a custom widget :) But you may emulate it with tool buttons, for example...

mchara
21st November 2007, 06:53
So you told it's slider in meaning of whole control, not single image/button.
But... where shall it be "3d" as you mentioned at threads beginning?
Do you want buttons to scroll around?
I assume that you want this widget do draw partially transparently as on wysota's picture, so i think it can be i.e. scrollArea with custom paintEvent that omits background drawing.

MarkoSan
21st November 2007, 07:08
On picture, the shape of this icon switcher is linear, i need it in circle form, like vynils or cds in jukebox.

mchara
21st November 2007, 07:16
Shall this circle be planar (according to screen's surface) or somehow 3d?

MarkoSan
21st November 2007, 08:06
Regarding to fact, that icons in upper part of circle will be smaller (like they are more distant) than the icons in lower part of circle and the selected icon is the biggest, i think it will look like 3d.

mchara
21st November 2007, 08:15
So you want icons on sides skewed like they would be rotated?
It can be done without real 3d features with a bit of coordinates computation it can be emulated on transformed() pixmaps.

QSlider is not best base widget i think. I suggest a completely custom widget that inherits QWidget & QButtonGroup, you can add then a number of buttons & your widgets draws them in a 3d-like circle. It's reusable then...

MarkoSan
21st November 2007, 08:19
Hmm, why QButtonGroup? Aha, QButtonGroup is not visual, this is good idea ...

Let me check now ...