Important: Please read the Qt Code of Conduct -

QGridLayout setRowStretch

  • Hi
    I am having trouble setting a row stretch
    This snippet shows what I have attempted - it is obviosly part of a larger program, but I woujld be grateful if soemone could suggest any reason why the row stretch is not honoured.

        QGridLayout *pxLayout = new QGridLayout();
        pxLayout->addLayout(pxFilterLayout,   0, 0);
        pxLayout->addLayout(pxTableLayout, 1, 0);
        pxLayout->addWidget(pxDetailsLabel, 2, 0);
        pxLayout->addWidget(m_pxDetailsText, 3, 0);
    	pxLayout->setRowStretch(0, 10);
    	pxLayout->setRowStretch(1, 80);
    	pxLayout->setRowStretch(2, 10);

  • @GrahamLa hi. your problem is not clear to me. But when I run into a problem about QGridLayout I just check the qt calculator example
    ( it is very helpful to me. I think its better to share the whole code and please be more clear.

Log in to reply