Merubah warna widget
2 posters
Halaman 1 dari 1
Background transparent
- Code:
#include <QtGui>
#include <QApplication>
int main(int argc, char **argv)
{
QApplication app (argc,argv);
QWidget wid;
//inilah yang akan membuat perbedaan
QPalette palette;
palette.setBrush(wid.backgroundRole(), QBrush(QImage("letak/fle/gambar/anda.png")));
wid.setPalette(palette);
wid.show();
return app.exec();
}
//sungukong
cpp- Pejuang
- Jumlah posting : 35
Registration date : 15.03.09
Merubah warna widget
- Code:
#include <QtGui>
#include <QApplication>
int main(int argc, char **argv)
{
QApplication app (argc,argv);
QWidget wid;
//inilah yang akan merubah warna
wid.setPalette(QColor(Qt::magenta));
wid.setAutoFillBackground(true);
wid.show();
return app.exec();
}
//hi
zz- Panglima
- Jumlah posting : 121
Age : 78
Lokasi : france
Registration date : 13.02.09
Halaman 1 dari 1
Permissions in this forum:
Anda tidak dapat menjawab topik
|
|