Hi,
i have the following code in my constructor:
pSplitter->setOrientation( Qt::Vertical );
pSplitter->setHandleWidth( 10 );
pSplitter->addWidget( pressure );
pSplitter->addWidget( temperature );
layout->addWidget( pSplitter, 0,0 );
qDebug() << pressure->height();
qDebug() << temperature->height();
qDebug() << pSplitter->sizes();
QGridLayout *layout = new QGridLayout( parent );
pSplitter = new QSplitter();
pSplitter->setOrientation( Qt::Vertical );
pSplitter->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
pSplitter->setHandleWidth( 10 );
pSplitter->addWidget( pressure );
pSplitter->addWidget( temperature );
layout->addWidget( pSplitter, 0,0 );
qDebug() << pressure->height();
qDebug() << temperature->height();
qDebug() << pSplitter->sizes();
To copy to clipboard, switch view to plain text mode
The debug output is:
200
200
(0, 0)
200
200
(0, 0)
To copy to clipboard, switch view to plain text mode
I have a slot to follow the splitterMoved(int,int) signal, there i got this output
for sizes() after splitter movement.
(330, 330)
(331, 329)
(331, 329)
(331, 329)
(330, 330)
(331, 329)
(331, 329)
(331, 329)
To copy to clipboard, switch view to plain text mode
Why is sizes() == (0,0) in constructor and contain values after "splitterMoved" singal.
Do i miss something in my code or is sizes() only updated when the splitter was moved?
Thx
Bookmarks