googie
18th June 2013, 01:16
Hi,
I just created simple "QMainWindow" application, just from QtCreator New Project wizard. I've added two push buttons into center widget, then each of them connected (clicked() signal) with slots:
void MainWindow::on_pushButton_clicked()
{
w = new QWidget(this);
w->move(0, 0);
w->setFixedSize(50, 200);
w->setVisible(true);
}
void MainWindow::on_pushButton_2_clicked()
{
delete w;
}
What bothers me is that after pressing button1, widget is created and resized as expected, but it's not painted at all. I mean I see that the widget is there, because it covers left part of the upper push button, therefore the pushbutton doesn't light-up on mouse over event, but when I move mouse right the pushbutton lights up. But... the widget itself is not painted at all, like it was transparent :(
What am I missing here? Shouldn't the widget paint itself as empty rectangle, instead of transparent one?
I just created simple "QMainWindow" application, just from QtCreator New Project wizard. I've added two push buttons into center widget, then each of them connected (clicked() signal) with slots:
void MainWindow::on_pushButton_clicked()
{
w = new QWidget(this);
w->move(0, 0);
w->setFixedSize(50, 200);
w->setVisible(true);
}
void MainWindow::on_pushButton_2_clicked()
{
delete w;
}
What bothers me is that after pressing button1, widget is created and resized as expected, but it's not painted at all. I mean I see that the widget is there, because it covers left part of the upper push button, therefore the pushbutton doesn't light-up on mouse over event, but when I move mouse right the pushbutton lights up. But... the widget itself is not painted at all, like it was transparent :(
What am I missing here? Shouldn't the widget paint itself as empty rectangle, instead of transparent one?