John-P
7th December 2009, 11:42
Hi
I want to set the color of pushButton to transparent.
(button background color)
I tried using setColor() to change "QPalette::Button" .
But following build error occured.
" invalid conversion from 'QPalette*' to 'QRgb' "
"initializing argument 1 of 'QColor::QColor(QRgb)' "
How can I resolve this error.
palette = new QPalette();
palette->setColor(QPalette::Button , QColor(0,0,0,0) );
pushButton = new QPushButton(centralwidget);
pushButton->setPalette(QPalette(palette));
pushButton->setObjectName(QString::fromUtf8("pushButton"));
pushButton->setGeometry(80, 220, 140, 140);
pushButton->setIcon(QIcon(QPixmap("icon.png")));
pushButton->setIconSize(QSize(140 , 140));
regards
John
I want to set the color of pushButton to transparent.
(button background color)
I tried using setColor() to change "QPalette::Button" .
But following build error occured.
" invalid conversion from 'QPalette*' to 'QRgb' "
"initializing argument 1 of 'QColor::QColor(QRgb)' "
How can I resolve this error.
palette = new QPalette();
palette->setColor(QPalette::Button , QColor(0,0,0,0) );
pushButton = new QPushButton(centralwidget);
pushButton->setPalette(QPalette(palette));
pushButton->setObjectName(QString::fromUtf8("pushButton"));
pushButton->setGeometry(80, 220, 140, 140);
pushButton->setIcon(QIcon(QPixmap("icon.png")));
pushButton->setIconSize(QSize(140 , 140));
regards
John