QT background
Unsolved
General and Desktop
-
hello i done c++ basic learning and now i try to learn QT..,
I want set background color or Image but if i put this:QPalette pal = ui->widget->palette; //pozadie farba pal.setColor(QPalette::Background, Qt::red); ui->widget->setAutoFillBackground(true); ui->widget->setPalette(pal); ui->widget->show();
Qt says me for widget no member named... what should i do ?
-
@Eternus said in QT background:
QPalette pal = ui->widget->palette;
should be
QPalette pal = ui->widget->palette(); // method call
-
@raven-worx said in QT background:
QPalette pal = ui->widget->palette(); // method call
but stilll have it same error
-
@Eternus said in QT background:
Qt says me for widget no member named... what should i do ?
What should you do? You should copy and paste the actual error message, so that we can see what the actual thing it's complaining about is, instead of guessing. I have a feeling it's going to be
ui->widget
....