Results 1 to 18 of 18

Thread: custom slider question (very advanced)

  1. #1
    Join Date
    Jan 2006
    Location
    Ljubljana
    Posts
    687
    Thanks
    111
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Question custom slider question (very advanced)

    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??
    Qt 5.3 Opensource & Creator 3.1.2

  2. #2
    Join Date
    Sep 2007
    Location
    Szczecin, Poland
    Posts
    153
    Thanks
    7
    Thanked 11 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: custom slider question (very advanced)

    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.
    See GrEEn (Graphics Effects Environment)
    http://sourceforge.net/project/platf...roup_id=232746
    a qt-based plugins oriented MDI image processing application(contains also qt plugins like styles & imageformats).

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: custom slider question (very advanced)

    Quote Originally Posted by MarkoSan View Post
    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.

  4. #4
    Join Date
    Jan 2006
    Location
    Ljubljana
    Posts
    687
    Thanks
    111
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: custom slider question (very advanced)

    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?
    Last edited by MarkoSan; 20th November 2007 at 12:10.
    Qt 5.3 Opensource & Creator 3.1.2

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: custom slider question (very advanced)

    Quote Originally Posted by MarkoSan View Post
    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.

  6. #6
    Join Date
    Jan 2006
    Location
    Ljubljana
    Posts
    687
    Thanks
    111
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Question Re: custom slider question (very advanced)

    So, is it possible to make subclass of QSlider that will draw "bended" slider?
    Qt 5.3 Opensource & Creator 3.1.2

  7. #7
    Join Date
    Sep 2007
    Location
    Szczecin, Poland
    Posts
    153
    Thanks
    7
    Thanked 11 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: custom slider question (very advanced)

    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.
    See GrEEn (Graphics Effects Environment)
    http://sourceforge.net/project/platf...roup_id=232746
    a qt-based plugins oriented MDI image processing application(contains also qt plugins like styles & imageformats).

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: custom slider question (very advanced)

    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.

  9. #9
    Join Date
    Jan 2006
    Location
    Ljubljana
    Posts
    687
    Thanks
    111
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Question Re: custom slider question (very advanced)

    Quote Originally Posted by wysota View Post
    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.
    Qt 5.3 Opensource & Creator 3.1.2

  10. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: custom slider question (very advanced)

    I mean the thing at the bottom of this picture:

  11. #11
    Join Date
    Jan 2006
    Location
    Ljubljana
    Posts
    687
    Thanks
    111
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Lightbulb Re: custom slider question (very advanced)

    YYYYYYYYYYYEEEEEEESSSSSSSSSS!!!!!!!

    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 ...
    Qt 5.3 Opensource & Creator 3.1.2

  12. #12
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: custom slider question (very advanced)

    I think this in particular is a custom widget But you may emulate it with tool buttons, for example...

  13. #13
    Join Date
    Sep 2007
    Location
    Szczecin, Poland
    Posts
    153
    Thanks
    7
    Thanked 11 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: custom slider question (very advanced)

    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.
    See GrEEn (Graphics Effects Environment)
    http://sourceforge.net/project/platf...roup_id=232746
    a qt-based plugins oriented MDI image processing application(contains also qt plugins like styles & imageformats).

  14. #14
    Join Date
    Jan 2006
    Location
    Ljubljana
    Posts
    687
    Thanks
    111
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: custom slider question (very advanced)

    On picture, the shape of this icon switcher is linear, i need it in circle form, like vynils or cds in jukebox.
    Qt 5.3 Opensource & Creator 3.1.2

  15. #15
    Join Date
    Sep 2007
    Location
    Szczecin, Poland
    Posts
    153
    Thanks
    7
    Thanked 11 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: custom slider question (very advanced)

    Shall this circle be planar (according to screen's surface) or somehow 3d?
    See GrEEn (Graphics Effects Environment)
    http://sourceforge.net/project/platf...roup_id=232746
    a qt-based plugins oriented MDI image processing application(contains also qt plugins like styles & imageformats).

  16. #16
    Join Date
    Jan 2006
    Location
    Ljubljana
    Posts
    687
    Thanks
    111
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: custom slider question (very advanced)

    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.
    Qt 5.3 Opensource & Creator 3.1.2

  17. #17
    Join Date
    Sep 2007
    Location
    Szczecin, Poland
    Posts
    153
    Thanks
    7
    Thanked 11 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: custom slider question (very advanced)

    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...
    See GrEEn (Graphics Effects Environment)
    http://sourceforge.net/project/platf...roup_id=232746
    a qt-based plugins oriented MDI image processing application(contains also qt plugins like styles & imageformats).

  18. #18
    Join Date
    Jan 2006
    Location
    Ljubljana
    Posts
    687
    Thanks
    111
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: custom slider question (very advanced)

    Hmm, why QButtonGroup? Aha, QButtonGroup is not visual, this is good idea ...

    Let me check now ...
    Qt 5.3 Opensource & Creator 3.1.2

Similar Threads

  1. Custom tab widget question
    By PrimeCP in forum Qt Programming
    Replies: 2
    Last Post: 7th August 2007, 11:17

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.