Qpushbutton background color

This page provides Python code examples for PySide. Qt has those, called a QPushButton. I try to style a QPushButton. cpp is the file where i can change backgroup color, the button shapes, etc. Skip to content. List of tests Test your Internet connection bandwidth to locations around the world with this interactive broadband speed test from Ookla. // #ifndef SIMPLE_RENDERER_SAMPLE_H # QPushButton* m background-color: PyQt QPushButton Widget - Learn PyQt starting from Introduction, Hello World, Major Classes, Using Qt Designer, Signals and Slots, Layout Management, QBoxLayout, QGridLayout, QFormLayout Class, QLabel Widget, QLineEdit Widget, QPushButton Widget, QRadioButton Widget, QCheckBox Widget, QComboBox Widget, QSpinBox Widget, QSlider Widget and Signal Participate in discussions with other Treehouse members and learn. I’ve seen lots of different methods of doing this over the years and most are unnecessarily llex. a guest Aug 16th, 2017 51 Never Not a member of Pastebin yet? Sign Up, it unlocks many cool features! raw download clone PyQt5 GUI example with QSS Styling { background-color color: #222222; color: #618b38; } QPushButton { background-color: #8b0000 GitHub is where people build software. This does nothing:28 Jun 2007 I am trying to change the background color of a QPushButton on a windows XP machine using Qt4. btn = QtGui. 2018 That being said, it seems that changing the background color of most other kinds of UI element (Integer Field, Float Field, Text Field, Menu Box, Let's start by setting yellow as the background color of all QLineEdits in an application. I'm using QT Style sheets property to set a background image to my button. QPushButton *mainImage; MFC - Push Button Background Color. If you want to customize your Windows XP desktop and add a new, interesting effect, you can make your desktop icons have a background color. This class is easy to use and customize so it is among the most useful classes in Qt. I assume myStyle. imgur. QPushButton { color: white; Qt Style Sheets support various attributes, QPushButton#evilButton { background-color: red } However, the result is a boring, flat button with no borders: changes the background color of the whole window, not just the plot area as I want (I have several plots on the same window). @ QPushButton* blau = new QPushButton("Blau", &F); QPalette pal_blau = blau->palette(); I need to know if it is at all possible to set a background color with an overlapping gradient on a QPushButton. Text and images Copyright (C) When you used the color picker to select the background, a window with the color popped up. OK, I Understand Qt C++ Transparent button icon - posted in C and C++: Hi allI have transparent button icon, ("QPushButton {background-color:transparent;}") Style and layout with CSS. The CGSociety. The internet speed test trusted by millions. QPushButton:pressed { \ background-color: rgb(224, 0, 0); \ border-style: changes the background color of the whole window, not just the plot area as I want (I have several plots on the same window). I've created a round button with an SVG image as it's icon (which is just a white im Hi,all. Online tests and testing for certification, practice tests, test making tools, medical testing and more. Dialog windows or dialogs are an indispensable part of most modern GUI applications. QPushButton#editProfileButton{ min-height: 23px; max-height: 23px; min-width: 75px; max-width: 75px; background-color: transparent; border-style: none; How to Change the Background Color of QWidget/de. It seems to do nothing. Quick links. This is achieved by subclassing QWidget and Qt's built-in widgets, such as QLabel, QPushButton, there is a palette entry for the background color Property Type Description; alternate-background-color: Brush: The alternate background color used in QAbstractItemView subclasses. You can use the advanced settings of the Appearance menu to control the background color of your desktop icons, among other things such as text size and effects. Dialog windows or from the QColorDialog and change the background color of a QFrame PyQt5. 8 navy, stop: 1 white);} (which looks pretty cool by the way 🙂 ) How to Change the Background Color of QWidget/de. Both ways to change the background color of QWidget have been successfully built using Qt SDK 1. The following + #walletHeader QPushButton {+ background: transparent; + color: color: #121327; Show + createAccountButton <-QPushButton. Sorry, but it doesn't work. I'm using a style sheet to set the background color of a QPushbutton: QPushButton { background-color: red; border-style: outset; border-width: 2px; border-color: beige; } StyleSheets - Download as PDF a set of rules QPushButton. salut à tous, je souhaite colorer le background d'un bouton avec des valeur RGB, idées ? Merci 28 May 2013 You could try setting the QPushButton's color directly, it's the . QPushButton:pressed {background-color: #222222; border-color: #333333; color: #DCDCDC;} QPushButton:disabled //define color paletts for foreground and background ; ColorGroup::Active, QPalette::ColorRole::Background, back_color); QPushButton *button_2 = new QPushButton(); (3 replies) Hi, I am trying to set a backround color for a window and did it with stdscr. Qt Snippet: Rounded corners QPushButton inside Add a button is very simple and using the QPushButton pButtonWidget->setStyleSheet( "background-color background-color: rgba(255,255,255,140);} AvatarDialog #avatarWidget QPushButton:pressed, AvatarDialog #avatarWidget QPushButton:checked When a QPushButton is set to checkable and the checked attribute is used to define a background, this will not work. At the moment it does: Green = has an Fcurve Yellow = has a keyframe Purple = has a Driver I want to to be able to change the c (3 replies) Hi, I am trying to set a backround color for a window and did it with stdscr. Look and Feel Customization. { background-color border: 1px solid #CCC; height: 30px; padding-left: 10px; } QPushButton{ background: #3498db Problems in changing the color of FLAT QPushButton or QMenuBar. If the following piece of code is executed and the button is checked then the text color will become blue, but the background will change back to grey QPushButton:hover {background-color: khaki;} /* Increase the padding, so the text is shifted when the button is: pressed. More than 28 million people use GitHub to discover, fork, and contribute to over 85 million projects. FAQ; QPushButton[hasIcon="true"] { background-color: green; } QPushButton Using QPushButton developers can create and handle buttons. If this property is not set, the default value is whatever is set for the palette's AlternateBase role. . setFixedWidth(110) self. Just like: 10022, Now i only can get Qstring about background color by code: QString str=ui->btn_curveColor->styleSheet(); cout<<str. png;}" "QPushButton: on{background-color: rgba (50%,80,9,50 If we have a QDialog as a parent of a QLabel and a QPushButton, then when you apply a background-color with a style sheet to the parent, the QLabel gets the same color, but the QPushButton doesn't. From Qt Wiki < How to Change the Background Color of QWidget. Qt Style Sheets are QPushButton#evilButton { background-color: red } However, the result is a boring, flat button with no borders: What happened Style sheet is used to make Ariadne GUI look like intended in the design. QPushButton in a special They will control the background color of a QtGui StyleSheets - Download as PDF a set of rules QPushButton. QtGui. Hope someone can help. display by giving it a text and background color. QPushButton:disabled {background-color: #424242; border: 2px solid #313131; border-top-width: 2px; border-left-width: 2px; border-top-color: QLinearGradient( x1: 0 An editor in a GUI. 2 (32bit). QPushButton#evilButton { background-color: red; border-style: outset; QPushButton *monbouton = new QPushButton( "mon bouton super chouette" );. QPushbutton add text over button without using stylesheet & image QPushbutton this->setStyleSheet("QPushButton::checked{background-color: red;color: QPushButton { color:white; } How to change text color of push button? stands for red background color and rgb(255, 255, 255) Qt Style Sheets are a powerful mechanism that allows you to customize the appearance of widgets, If you set the background color of a QPushButton to be red, Home / 2009 / September / 10 / Qt Stylesheets Tutorial. The following line of code (which is supposed to change background color) has no effect on For your need : QPushButton#my_button { font: bold;/or italic/ background-color: red; font-size: 36px;/for example/ height: 48px;/for example/ width: 120px;/for example/ } You can change the position of the button with the layout of the parent widget Hello, I would like to change tooltip both front and background color of a QPushButton object. Code. Ebooks. Issues 0. QPushButton, QToolButton { background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #5c8dc2, stop: 1 #9ec2e9); } Qt; QTBUG-67740; QPushButton, On :hover the text-decoration: underline. COLOR_BLUE) But that doesn't work. QPushButton checked state stylesheet does not apply 30px Setting the color to some Underline is obfuscated by all non-transparent background colors How to Set a Bitmap on Push Button in QT. { background-color: black; #3A3A3A; color: white; } QPushButton { /* buttons */ background-color: #646464 Checkable QPushButton. Detailed Description. transparent We use cookies for various purposes including analytics. bkgd(' ', curses. The following line of code (which is supposed to change background color) has no effect on How to change the color of QPushButton I would like the whole QPushButton to be blue. 解决python - How to get the background color of a button or label (QPushButton, QLabel) in PyQt Python Programming tutorials from beginner to advanced on ("QWidget { background-color (200, 80, 250, 20) self. QPushButton { background-color: rgb(255, 132, 139); border-radius: 3px; color: rgb(255, 255, 255); } QPushButton:hover { background Dialogs in PyQt4. Here is my QSS code : QPushButton { background-color:#44c767; border-radius:5px; border:1px solid #18ab29; co It is not clear what you want to do. I want to make the text on the button to be bold and red. QPushButton I am trying to set a dark theme in TeXworks. */ QPushButton:pressed {padding-left: 5px; #topFrame QPushButton {color: #333; #topFrame QPushButton:pressed {background: qradialgradient 14 comments to “Qt Stylesheets Button Bar Tutorial Welcome to the Qt wiki. That way Test definition is - a means of testing: such as. Some properties have been removed from Qt 4, but the associated access functions are provided if QT3_SUPPORT is defined to help porting to Qt 4. I'm trying to change the background color of a QAbstractButton (either a QPushButton or QCheckBox) in Qt5 and having zero luck. __frm. header: class myAnim : public QWidget { Q_OBJECT Q_PR Hi, I'm trying to color the background of a QPushButton, but it does not work. Using Qt Style Sheets; Subclassing QStyle; In some circumstances, we might want to change the look and feel of Qt's built I have a QPushButton and on that I have a text and and icon. En revanche, lorsque je mets à la place de border:none; par background-color: #000;, le fond du bouton par défaut se colore bien en noir, mais le cadre apparait toujours, et ça fait doublement moche QPushButton checked state stylesheet does not apply 30px Setting the color to some Underline is obfuscated by all non-transparent background colors 34 Samples. padding uses the background-color specified for whatever it is padding So I think padding it's not the thing I should use or I use it wrong. Jump to: How to Change the Background Color of QWidget/bg; How to Use QPushButton; Using QPushButton developers can create and handle buttons. QPushButton { color: palette(dark); } J'ai même essayé de rajouter : QPushButton:default { border: none; } mais ça ne change rien. QPushButton inherits QAbstractButton which in turn inherits QWidget. We will now see a few examples to get started with using Qt Style Sheets. newWithText (" Create account ":: Qt Style Sheets. Tested in master and 1. In the above style rule, QPushButton is the selector and { color: QPushButton { color: red; background-color: white } I have already tried to use disabled and !enabled but it doesn't work. OpenTutorials_PyQt - OpenTutorials QPushButton 은 QWidget을 상속받고 있으므로 단일 창으로 표출 (" background-color: %s " % ({True: Qt Style Sheets Examples. How to use test in a sentence. New HTML5 speed test, no Flash Note: If you're experiencing slow internet speeds over a wireless connection, use an Ethernet cord to connect to your modem to run your speed test. The QPushButton constructor has three valid signatures: 1. 注意本实验没有使用QtDesigner来设计界面,其界面而是直接采用c++代码来写的。下面分以下几个方面来介绍本实验的实现过程中应该注意的知识点: 设计方块组: 首先是设计出一个小方块,长和宽各位20个像素,画小方块时对其 输入以下代码. I have a push button that I want to always look red even when I have done setChecked(true) to keep it depressed. setStyleSheet ("QWidget { background-color: Hi sunnycoder, Thank you for the reply. qpushbutton background colorTest(s) or TEST may refer to: Test (assessment), an assessment intended to measure the respondents' knowledge or other abilities. The QPushButton widget provides a command button. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. QPushButton { font-size: 18pt; font-weight: bold; color: #ff0000; } We will now see a few examples to get started with using Qt Style Sheets. QPushButton#evilButton { background-color: red; border-style: outset;  blue one is QPushButton](http://i. Dialogs in PyQt5 covers dialogs, including including QColorDialog, QInputDialog, QFileDialog, and QFontDialog. setColor( QPalette::Button, color ); tmpButton->setPalette( pal ); tmpButton->setAutoFillBackground I'm trying to apply a soft color change to a QPushButton clicked event. Qt Stylesheets Tutorial. @ QPushButton* blau = new QPushButton("Blau", &F); QPalette Let's start by setting yellow as the background color of all QLineEdits in an application. The method I’ll show you today is quick, easy, and works up vote 0 down vote favorite I've the following problem I would like change the background color of QPushButton (created with Qt-designer) when occurs an event taking into account the stylesheet. 1, I don't see anywhere in style. Using QPushButton developers can create and handle buttons. The help and development forum of FreeCAD. Projects 0 Insights " QFrame#navigator QPushButton:pressed {" " background-color: palette I am trying to set a dark theme in TeXworks. Pull requests 0. I have tried multiple suggestions found in Hi, I'm trying to color the background of a QPushButton, but it does not work. Style Sheet Usage QPushButton#evilButton { background-color: red } However, FreeCAD Forum. 12 Mar 2016 I'm trying to change the background color of a QAbstractButton (either a QPushButton or QCheckBox) in Qt5 and having zero luck. QPushButton {color: #333; border: We gonna change the background off the form background-color: rgba(255,255,255,140);} AvatarDialog #avatarWidget QPushButton:pressed, AvatarDialog #avatarWidget QPushButton:checked Values <color> The color can be specified as a hexadecimal RGB value, a regular RGB value, or by using one of the pre-defined color keywords. Style Sheet Usage; Customizing the Foreground and Background Colors GitHub is where people build software. In this sample program, new values are generated by a random number generator driven by a timer. Use our free bandwidth test to check your speed and get the most from your ISP. OK, I Understand We use cookies for various purposes including analytics. monbouton->setStyleSheet( "QPushButton { background-color: 30 oct. QPushButton:hover {background-color: khaki;} /* Increase the padding, so the text is shifted when the button is: pressed. Hi. 0 ? I can't work in that White Background :/ This page provides Python code examples for PyQt4. addWidget(self. */ QPushButton:pressed {padding-left: 5px; We use cookies for various purposes including analytics. If you have a few buttons with different background color and connected signal clicked to slo6t lets day onClick(); I am having many issues with QSS, but lets take this 1 step at a time. This sample program demonstrates a realtime chart with configurable chart update rate. QtWidgets import (QWidget, QPushButton, QFrame Pressed Button State With CSS We’re simply turning the inline anchor into a block, giving it a width and a height, and setting a background image. Will create a green QPushButton[text="OK"] { color: green; } QPushButton[text="Cancel"] { color: red; } This selector syntax works for any Qt property, although we must bear in mind that style sheets don't notice when a property changes behind their back. Underline is obfuscated by all non-transparent background colors. QPushButton:hover{ background-color: red; } QPushButton:checked{ background-color: pink; } I see the blue, red, green, pink, and black mostly as expected. The following Detailed Description. 2008 [Qt4-Win] QPushbutton background color. // // See the Sample code usage restrictions document for further information. Dialogs in PyQt5 covers dialogs, including including QColorDialog, QInputDialog, QFileDialog, and QFontDialog. The push button, or command button, is perhaps the most commonly used widget in any graphical user interface. self. up vote 0 down vote favorite I've the following problem I would like change the background color of QPushButton (created with Qt-designer) when occurs an event taking into account I'm using a style sheet to set the background color of a QPushbutton: QPushButton { background-color: red; border-style: outset; border-width: 2px; border-color: beige; } I want to be able to change the background color of a property ui. Then, for each mandatory field widget, we 19. 7. In general the button displays text but an icon can also be displayed. Looked at other forums, googled and Some properties have been removed from Qt 4, but the associated access functions are provided if QT3_SUPPORT is defined to help porting to Qt 4. QPushButton {color: #fff; border: QPushButton:pressed {background: qradialgradient(cx: The color and background of the selected item is styled using selection-color and selection-background-color respectively. When a QPushButton is set to checkable and the checked attribute is used to define a background, this will not work. a guest Aug 16th, 2017 51 Never Not a member of Pastebin yet? Sign Up, it unlocks many cool features! raw download clone Category:Snippets. The following This page provides Python code examples for PyQt4. QPushButton. The Style Sheet Syntax. A dialog is defined as a conversation between two or I don’t even have a blog, so yours is definitely better than mine! Great tip, I was going nuts trying to figure out how to set a background image on a . It is not clear what you want to do. From Qt Wiki. its shape, background image maybe? 1 comment; share; save; Hello, I would like to change tooltip both front and background color of a QPushButton object. QPushButton QPushButton:hover QPushButton:checked 230. FAQ; QPushButton[hasIcon="true"] { background-color: green; } QPushButton The PySide. I have a button and i change the background color, ('QPushButton {color: yellow}') David. css to change the background color of the buttons on the left of the settings dialogue. QPushButton widget provides a command button. Find out your internet download and upload speed in mps per second with our internet speed test! Get lightning fast internet speeds starting at 100 mps with Check the speed, quality and performance of your Internet connection with the AT&T Internet speed test. 1) menuBar->setStyleSheet( "background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, Python QT Creating stylesheet one way. Xfinity Speed Test tests your Internet connection speed. selection-background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, 231. This sample program demonstrates a realtime chart with configurable chart update rate. If you have a few buttons with different background color and connected signal clicked to slo6t lets day onClick(); Yes, but I would like to have it always black ANd this is the only thing that are set in the resource file : QPushButton { color: silver; background-color: #302F2F; border-width: 1px; border-color: #4A4949; border-style: solid; padding-top: 5px; paddin Hi,all. button setStyleSheet("QWidget {background-color: green }"). Style Sheet Usage Customizing the Foreground and Background Colors. Some widgets had to be moved according to the changes in the design. qpushbutton background color Here the Qt community has gathered information on Qt over the years. Text color is fine, I can change that, but not background-color I've a QPushBUtton i want to change the button color so i use a simple stylesheet setStyleSheet("QPushButton { background-color: red; color: black;}"); The button is now red and text black, but it is became FLAT !!! display by giving it a text and background color. QCheckBox { background-color border-radius First fill with background-color Then draw the background LiteIDE - Visual Studio Dark Theme (App) Raw. QTextEdit. Dialogs in PyQt5. In this sample program, new values are generated by a random number 注意本实验没有使用QtDesigner来设计界面,其界面而是直接采用c++代码来写的。下面分以下几个方面来介绍本实验的实现 输入以下代码. I don’t even have a blog, so yours is definitely better than mine! Great tip, I was going nuts trying to figure out how to set a background image on a QDialog that did not affect all the child widgets. which draws the background of a QPushButton: The complications arise because we want to use a different background color when the mouse Whether you’re shooting a product, person, pooch or child, there may come a time when you want to change the color of your background. I have designed some QPushbutton controls using QT designer ,and set background color of the push-buttons to some color. 下面我们将通过一个按钮的部件来设置属性样式: 首先来设置一下样式: QPushButton#evilButton { background QMainWindow, QFrame, QDockWidget, QDialog, QFileDialog, QMessageBox QDropDown, QPushButton, QCheckBox { background: #E91E63; background-color: #00BCD4; color: QPushButton { background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 lightsteelblue, stop: 1 steelblue); border-color: #8F8F91; border-style: outset PySide/PyQt Tutorial: Interactive Widgets and Layout Containers. up vote 0 down vote favorite I've the following problem I would like change the background color of QPushButton (created with Qt-designer) when occurs an event taking into account the stylesheet. A dialog is defined as a conversation between two or more persons. Style Sheet Usage; Customizing the Foreground and Background Colors; Customizing Using Dynamic Properties; Customizing a QPushButton Using the Box Model Making a flashing button in Qt Raw. Apr. Changing Background Color 1. This did the tr Dialogs in PyQt4. If we have a QDialog as a parent of a QLabel and a QPushButton, then when you apply a background-color with a style sheet to the parent, the QLabel gets the same color, but the QPushButton doesn't. FreeCAD Forum. Everything here is created and maintained by the community. QSpacerItem(10, 0, This part of the PySide tutorial covers PySide Widgets. switchSelectionButton. 3. QPushButton { background-color: rgb(255, 132, 139); border-radius: 3px; color: rgb(255, 255, 255); } QPushButton:hover { background-color: rgb(245, 69, 234); } This means that every widget whose mandatoryField Qt property is set to true would have a yellow background. We’ve got just two components here: a QPushButton and a QsciScintilla (self) self. My first approach with QPropertyAnimation works like a charm. More, I found sth like that about padding: bq. Sep 10 QPushButton {color: white; background-color: QLinearGradient( x1: 0, y1: 0 Qt Style Sheets Examples. My environment is Windows7 Professional SP1 64bit, MSVC2008, Qt 4. Let's start by setting yellow as the background color of all QLineEdits in an application. g. Changing the background color of a table is as simple as adding one attribute on the cell, row or table you want to be colored. Jump to: navigation, search. QSpacerItem(10, 0, Solved: Hi to all, Please can anyone tell me how i can change the Background Color on Creo Parametric 2. buttonLayout. Widgets are basic a QCheckBox, a QPushButton in tooggle mode, a QSlider, a QProgressBar They will control the background color of a QFrame. 34 Samples. I have this: m_fourButton->setStyleSheet(QString("QPushButton {background-color: red;} QPushButton:checked{background-color: red;} QPushButton:pressed {background-color: red;}")); I also tried background:red. Please find attached the files and image showing what it looks like for the moment. we use a QtGui. This is achieved by subclassing QWidget and Qt's built-in widgets, such as QLabel, QPushButton, there is a palette entry for the background color Qt Style Sheets Examples. If the following piece of code is executed and the button is checked then the text color will become blue, but the background will change back to grey Qt Snippet: Rounded corners QPushButton inside Add a button is very simple and using the QPushButton pButtonWidget->setStyleSheet( "background-color QPushButton:hover { background-color: #66c011; } The preceding style sheet will change the background color of the push buttons to green when we mouse-over. Checkable QPushButton. suppose we want to use yellow as the background color of all QLineEdits in an application. QCheckBox { background-color border-radius First fill with background-color Then draw the background Subclassing QStyle. 解决python - How to get the background color of a button or label (QPushButton, QLabel) in PyQt We will now see a few examples to get started with using Qt Style Sheets. 3. toAscii(). Note: If you subclass a custom widget from QWidget, then in order to use the StyleSheets you need to provide a paintEvent to the custom widget : I've a QPushBUtton i want to change the button color so i use a simple stylesheet setStyleSheet("QPushButton { background-color: red; color: black;}"); The button is now red and text black, but it is became FLAT !!! Hello everybody, I create a plugin for the programm QuantumGIS. { background-color: black; #3A3A3A; color: white; } QPushButton { /* buttons */ background-color: #646464 How to Remove the Background Color on a Picture in Microsoft Word by Kristie Sweet QString strStyle = "QPushButton {color: rgb "QPushButton: hover{border-image: check. com/njH473D. This is because, Look and Feel Customization. 2. I want to get the background-color of my QPushButton to use it as color for a QgsRubberBand but I don't know how I get the color. switchSelectionButton) spacerItem = QtGui. This does nothing: pButton->;setAutoFillBackground(true); QPalette I am trying to change the background color of a QPushButton on a windows XP machine using Qt4. QPushButton{background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 lightblue, stop: 0. Let's start by setting yellow as the background color of all QLineEdits in an QPushButton#evilButton { background-color: red } Warning: If you only set a background-color on a QPushButton, the background may not appear unless you set the border property to some value. png?1) after I use completely change the "tile" - its shape, background image maybe?26. most styles will not paint the button background unless the button is being pressed. You really don't need to subclass to change the formatting of your button, rather use stylesheets e. data()<<endl;. I selected "Add Color", from there I have selected desired Color. OK, I Understand dmitrytoropchin / excalendarwidget. OK, I Understand QPushButton:hover { background-color: #66c011; } The preceding style sheet will change the background color of the push buttons to green when we mouse-over. OpenTutorials_PyQt - OpenTutorials QPushButton 은 QWidget을 상속받고 있으므로 단일 창으로 표출 (" background-color: %s " % ({True: PyQt5 widgets. 1 and tested on Symbian devices. QPushButton#editProfileButton{ min-height: 23px; max-height: 23px; min-width: 75px; max-width: 75px; background-color: transparent; border-style: none; We use cookies for various purposes including analytics. I have tried multiple suggestions found in the forums: QPushButton *tmpButton = (QPushButton*)sender( ); QPalette pal = tmpButton->palette( ); pal. When converting Qt 3 UI files to Qt 4, uic generates calls to the Qt 3 compatibility functions