Results 1 to 7 of 7

Thread: create play,pause and stop buttons

  1. #1
    Join Date
    Jan 2007
    Posts
    21
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default create play,pause and stop buttons

    Hi

    I want to create play, pause and stop buttons on QT form. I am using QT designer.

    can anyone please tell me how can i do this?

  2. #2
    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: create play,pause and stop buttons

    Use QToolButtons.

  3. #3
    Join Date
    Jan 2007
    Posts
    21
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: create play,pause and stop buttons

    i want to create play, pause and stop buttons as we get in Windows media player.
    i will be creating separate buttons for play and pause.
    i want their representation to match with those in Windows media player.
    is it possible using QT?

  4. #4
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: create play,pause and stop buttons

    As wysota said, use QToolButton

    and use the function void setIcon ( const QIcon & icon ) of QToolButton .
    http://doc.trolltech.com/4.2/qabstra...html#icon-prop

  5. #5
    Join Date
    Jan 2006
    Location
    Kerala
    Posts
    371
    Thanks
    76
    Thanked 37 Times in 32 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: create play,pause and stop buttons

    It is very much possible in Qt. From what I understood, you are looking for a button that can has a pixmap - the Normal one, and upon mouse hover you want to change it to a Hover pixmap. and then upon pressing the pressedPixmap. Moreover The pixmap can have transparency/mask and the masked portion has to be hidden. Is this your requirement ?

    AFAIK, there is no widget that readily gives you this option. But you can subclass QButton to create a skinned button. I have seen one such in codeskipper.com. You can have a look at it
    We can't solve problems by using the same kind of thinking we used when we created them

  6. #6
    Join Date
    Jan 2007
    Posts
    21
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: create play,pause and stop buttons

    Thanks.....

    how can i disable the Qtoolbutton?
    If i click on the pixmap for play button then i need to show that the same play button is disabled. Do i need to replace the pixmap for that tool button or is there any other way??

  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: create play,pause and stop buttons

    Quote Originally Posted by Sheetal View Post
    how can i disable the Qtoolbutton?
    By calling setDisabled(true) on it

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.