How to implement a pop-up slider in menu?



  • Hi, I'm simulator Adobe Illustrator and have problem when try to implement a widget that a menu that can pops up another widget, such as a slider.

    image:

    !http://pic.yupoo.com/liuyanghejerry/Cjgk5Yx7/OZx8Z.png(wanted effect)!

    Any idea to implement it? Or should I just start from looking QMenu's source code? Thanks.



  • This is certainly possible to do.
    The first step would be to create the popup button. I'd look at "this example":http://blog.qt.digia.com/2007/06/06/lineedit-with-a-clear-button/ for starters on how you can trick Qt to put a button inside a line edit.

    The next step is the actual popup widget. For that, you can use some window flags. You create the widget without a parent and with the Qt::Popup window flags. Then, you position it so that it appears right under the lineedit-with-button widget. Put a slider on top, and you're in business.



  • [quote author="Andre" date="1349156271"]This is certainly possible to do.
    The first step would be to create the popup button. I'd look at "this example":http://blog.qt.digia.com/2007/06/06/lineedit-with-a-clear-button/ for starters on how you can trick Qt to put a button inside a line edit.

    The next step is the actual popup widget. For that, you can use some window flags. You create the widget without a parent and with the Qt::Popup window flags. Then, you position it so that it appears right under the lineedit-with-button widget. Put a slider on top, and you're in business.[/quote]

    Thanks! I think this is the way to go.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.