Results 1 to 11 of 11

Thread: How to implement radially rotated qpushbuttons?

  1. #1
    Join Date
    Jan 2013
    Posts
    11
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default How to implement radially rotated qpushbuttons?

    Hi All,

    I'm trying to implement a gui with an array of 20 qpushbuttons placed radially. Think slide projector carousel viewed from the top. It looks like QXT only does 90 deg. increments. I've seen another post kind of describing this, but there's the scary "rectangular bounding box" part of that that sounds all wrong. I need the user to be able to hit each one easily on a touch screen, and it sounds like they'll overlap. Any ideas? I'm not wed to a qpushbutton-- I just need to emit a signal. I'm also using qtcreator, and am something of a novice, so if there's a plugin widget solution so much the better.

    Thanks,
    Brian
    Last edited by briankeeney; 23rd January 2013 at 00:34.

  2. #2
    Join Date
    Jan 2013
    Posts
    11
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to implement radially rotated qpushbuttons?

    Any ideas? Is this impossible in Qt?

  3. #3
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: How to implement radially rotated qpushbuttons?

    Can you show us some screenshots? Just make something up, so that it is clear to visualize it.
    When you know how to do it then you may do it wrong.
    When you don't know how to do it then it is not that you may do it wrong but you may not do it right.

  4. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: How to implement radially rotated qpushbuttons?

    With widget you hardly can avoid the "rectangular bounding box" even if there are some tricks like transparent for mouse events, a custom click behavior... But depending on the complexity of your interface you could implement the ring of 20 buttons with a QGraphicsView or with QtQuick. Have you had a look at these?

  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: How to implement radially rotated qpushbuttons?

    With a circular layout of buttons one can implement a custom widget that will draw and handle those 20 "buttons". Then there is no problem with the rectangular bounding box as a single widget already has a rectangular bouding box which a bounding box of the circle making up this ring of buttons. Of course the buttons would be fake so one has to handle all required events manually.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. #6
    Join Date
    Jan 2013
    Posts
    11
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to implement radially rotated qpushbuttons?

    ring_button.png Thanks all for your input. Santosh, here's a quick scrawl of what I need to do. So there would be 20 buttons in the ring, like petals of a flower. Each one needs to change color when clicked (or when I want for some other reason) and send a "clicked()" signal.

    Lykburg and Wysota-- I don't have any experience with any of the packages that you've mentioned. What do you think is the best shot at getting there, given that I'm a novice programmer?

    Thanks a bunch,
    Brian

  7. #7
    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: How to implement radially rotated qpushbuttons?

    It really depends what you need it for. Maybe you don't need push buttons at all? Would simple coloured rectangles be sufficient?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  8. The following user says thank you to wysota for this useful post:

    briankeeney (23rd January 2013)

  9. #8
    Join Date
    Jan 2013
    Posts
    11
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to implement radially rotated qpushbuttons?

    Yup, I just need two pngs displayed for states, and the ability to send a clicked signal. Does that simplify things?

  10. #9
    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: How to implement radially rotated qpushbuttons?

    And what do you need all this for?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  11. #10
    Join Date
    Jan 2013
    Posts
    11
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to implement radially rotated qpushbuttons?

    It's part of the industrial design of a scientific instrument. It's for naming each sample in a carousel-- each petal/button corresponds to a sample, and needs labeling. This is done on a touchscreen on the device. touching a particular button pops up a dialog box with a virtual keyboard.

  12. #11
    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: How to implement radially rotated qpushbuttons?

    In that case I'd suggest to implement your UI in QML/QtQuick. If you don't feel up to it then use GraphicsView. Having rotated rectangles is very easy in both these technologies.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  13. The following user says thank you to wysota for this useful post:

    briankeeney (24th January 2013)

Similar Threads

  1. Resizing a rotated QGraphicsRectItem
    By Seishin in forum Qt Programming
    Replies: 1
    Last Post: 15th November 2012, 15:31
  2. Replies: 2
    Last Post: 15th March 2010, 10:03
  3. QGraphicsTextItem sharpness when rotated
    By martinn in forum Qt Programming
    Replies: 3
    Last Post: 26th February 2010, 12:13
  4. drawing series of rotated ellipses
    By qtn00b in forum Newbie
    Replies: 1
    Last Post: 17th December 2009, 01:51
  5. rotated labels
    By jayw710 in forum Qt Programming
    Replies: 2
    Last Post: 11th April 2006, 17:47

Tags for this Thread

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.