Why does it work then if the very same widget is out of a layout?
This is my code:
MainWindow
::MainWindow(QWidget *parent
) : ui(new Ui::MainWindow)
{
ui->setupUi(this);
qs.
append("height = " + QString::number(ui
->graphicsView
->height
()));
qs.
append("\nwidth = " + QString::number(ui
->graphicsView
->width
()));
ui->labelStatus->setText(qs);
}
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
QString qs;
qs.append("height = " + QString::number(ui->graphicsView->height()));
qs.append("\nwidth = " + QString::number(ui->graphicsView->width()));
ui->labelStatus->setText(qs);
}
To copy to clipboard, switch view to plain text mode
If I brake the layout the code works fine. If I put graphicsView and labelStatus into layout it wil b wrong.
Bookmarks