Results 1 to 4 of 4

Thread: QToolButton pressed effect

  1. #1
    Join Date
    Feb 2010
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QToolButton pressed effect

    Hi everyone,
    i have some questions to ask you.when a toolbutton pressed, as everyone know, it moves down 1px.
    but i want to get an effect that when a toolbutton pressed ,it moves up 1px.please ,how can i do.

  2. #2
    Join Date
    Feb 2010
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QToolButton pressed effect

    i use CSS,but not succeed.
    QToolButtonressed {
    position:absolute;
    top: 20px;
    left: 50px; /* shift it a bit */
    }

  3. #3
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default Re: QToolButton pressed effect

    Hi,

    You can do it as chenxuelian suggested, but if you want all your tool buttons to have this property, you can do something like the following;

    Qt Code:
    1. QString styleSheet = "QToolButton:pressed{ position:absolute;top: 20px;left: 50px; /* shift it a bit */ };"
    2. QApplication::instance()->setStyleSheet(styleSheet);
    To copy to clipboard, switch view to plain text mode 

  4. #4
    Join Date
    Feb 2010
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QToolButton pressed effect

    thanks for your answer,but useing css not succeed

Similar Threads

  1. QTableView key pressed
    By radu_d in forum Qt Programming
    Replies: 6
    Last Post: 1st August 2013, 03:20
  2. QToolButton - doesn't change icons when pressed
    By walsha3000 in forum Qt Programming
    Replies: 1
    Last Post: 21st February 2010, 10:03
  3. Can't See QToolButton pressed Signal from QTableWidget
    By mbrusati in forum Qt Programming
    Replies: 0
    Last Post: 23rd September 2008, 20:06
  4. Getting the row for button pressed
    By steg90 in forum Qt Programming
    Replies: 2
    Last Post: 28th November 2007, 15:45
  5. Painting Faded away when alt key pressed,
    By rajeshs in forum Qt Programming
    Replies: 2
    Last Post: 4th July 2007, 09:45

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.