KPH_WIDGET
::KPH_WIDGET(QWidget *parent, Qt
::WFlags flags
){
objPalette1.
setColor(QPalette::Window,Qt
::white);
objPalette2.
setColor(QPalette::Window,Qt
::gray);
//setFixedSize(300,300);
CRadioButtonEx* arr[10] ;
for(int i = 0; i < 10; i++)
{
pGridLayout->setRowMinimumHeight(i,50);
arr[i] = new CRadioButtonEx(tr("check"),this);
if(arr[i])
{
if(i%2 == 0)
arr[i]->setPalette(objPalette1);
else
arr[i]->setPalette(objPalette2);
arr[i]->setAutoFillBackground(true);
}
pGridLayout->addWidget(arr[i],i,0,Qt::AlignLeft);
}
KPH_WIDGET::KPH_WIDGET(QWidget *parent, Qt::WFlags flags)
: QMainWindow(parent, flags)
{
QPalette objPalette1;
objPalette1.setColor(QPalette::Window,Qt::white);
QPalette objPalette2;
objPalette2.setColor(QPalette::Window,Qt::gray);
//setFixedSize(300,300);
QGridLayout* pGridLayout = new QGridLayout(this);
CRadioButtonEx* arr[10] ;
for(int i = 0; i < 10; i++)
{
pGridLayout->setRowMinimumHeight(i,50);
arr[i] = new CRadioButtonEx(tr("check"),this);
if(arr[i])
{
if(i%2 == 0)
arr[i]->setPalette(objPalette1);
else
arr[i]->setPalette(objPalette2);
arr[i]->setAutoFillBackground(true);
}
pGridLayout->addWidget(arr[i],i,0,Qt::AlignLeft);
}
To copy to clipboard, switch view to plain text mode
Bookmarks