Results 1 to 4 of 4

Thread: Removing pressed effect from a QPushButton

  1. #1
    Join Date
    Jan 2010
    Posts
    190
    Thanks
    18
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Removing pressed effect from a QPushButton

    Hi! I subclassed QPushButton to create buttons which have the pressed effect by changing the icon. Seems to work ok, but I noticed that QPushButton creates a pressed effect on its own by slightly moving the icon. Is it possible to remove this effect?
    Thanks!

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Removing pressed effect from a QPushButton

    Probably using styles or stylesheets

  3. #3
    Join Date
    Jan 2010
    Posts
    190
    Thanks
    18
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Removing pressed effect from a QPushButton

    I tried to search in the reference, but I'm finding it difficult as I don't know how to call that effect. Any idea?
    Thanks!

  4. #4
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Removing pressed effect from a QPushButton

    Try this:

    Create a stylesheet for a QPushButton, normal and pressed conditions.
    In it, add an image. Check if it moves it around when pressing the button. If so, try to use image-position to position the image.
    http://doc.qt.nokia.com/4.6/stylesheet-reference.html

Similar Threads

  1. Removing gradient from QPushButton
    By Lexrst in forum Newbie
    Replies: 12
    Last Post: 1st January 2019, 20:27
  2. QToolButton pressed effect
    By chenxuelian in forum Qt Programming
    Replies: 3
    Last Post: 3rd March 2010, 07:03
  3. Replies: 3
    Last Post: 17th November 2009, 22:10
  4. Delay Loop until a QPushButton pressed
    By ljshap in forum Newbie
    Replies: 6
    Last Post: 17th January 2009, 17:30
  5. QPushButton fade effect without animation
    By Kostanev in forum Qt Programming
    Replies: 11
    Last Post: 12th November 2008, 10:46

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.