Results 1 to 9 of 9

Thread: Push Button selection color

  1. #1
    Join Date
    May 2011
    Posts
    22
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Maemo/MeeGo

    Default Push Button selection color

    Hi All

    When i click on my push button a red rectangle is displayed on top of the button. How to remove that color

    Regards
    Last edited by in_dbasu; 18th June 2012 at 14:54.

  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: Push Button selection color

    Give more info please.
    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.


  3. #3
    Join Date
    May 2011
    Posts
    22
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Maemo/MeeGo

    Default Re: Push Button selection color

    Hi

    I attached the screen shot of widget. In 1st column 2nd button you can see a red rectangle on top of the button which i clicked

    All the pushbutton are custom made.

    Regards
    Attached Images Attached Images

  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: Push Button selection color

    If its custom made button, you should track its paintEvent. Or are stylesheets used ?

  5. #5
    Join Date
    May 2011
    Posts
    22
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Maemo/MeeGo

    Default Re: Push Button selection color

    Hi

    I Only used style sheets.

    Regards

  6. #6
    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: Push Button selection color

    So correct the stylesheet to not show that border.
    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.


  7. #7
    Join Date
    May 2011
    Posts
    22
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Maemo/MeeGo

    Default Re: Push Button selection color

    Hi

    this is my code

    MyPushButton::MyPushButton(QWidget *parent) : QPushButton(parent)
    {
    MyPushButton::setFixedSize(115, 115);
    MyPushButton::setStyleSheet ("background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 #649600, stop: 0.9 #000000); border:none; border-radius: 20px;color: #964600;");
    QFont f("Arial", 14);
    MyPushButton::setFont(f);
    }

  8. #8
    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: Push Button selection color

    There must be another place where you are setting stylesheet... probably on hover or focus case.

  9. #9
    Join Date
    May 2011
    Posts
    22
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Maemo/MeeGo

    Default Re: Push Button selection color

    Hi

    I am not using both hover or focus case but still i guess internally hover or focus function is getting called.

Similar Threads

  1. Bitmap on Push Button in QT 3
    By Gokulnath in forum Newbie
    Replies: 2
    Last Post: 12th January 2011, 08:34
  2. [QT]Push button-no action
    By nqn in forum Newbie
    Replies: 4
    Last Post: 30th May 2010, 20:08
  3. How to change text color of push button?
    By augusbas in forum Qt Programming
    Replies: 2
    Last Post: 3rd July 2009, 11:32
  4. changing color of push button
    By babu198649 in forum Newbie
    Replies: 1
    Last Post: 2nd March 2008, 13:55

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.