HappyCoder
23rd July 2015, 14:19
Hi,
i have the following code in my constructor:
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();
The debug output is:
200
200
(0, 0)
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)
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
i have the following code in my constructor:
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();
The debug output is:
200
200
(0, 0)
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)
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