on-internet
← Community

Qt4.8 The effect of setSizePolicy(QSizePolicy ::Expanding , QSizePolicy ::Expanding) When I using QGridLayout

Stack Overflow ·

I want slice the main windows as like this my layout code is follow: QGridLayout *gLayout = new QGridLayout (); viewWidget->setStyleSheet("background-color: #333;" ); for ( i = 0; i < m_numOfVideoWidget; i++) { QWidget *vWidget = new QWidget(viewWidget); vWidget->setSizePolicy(QSizePolicy ::Expanding , QSizePolicy ::Expanding ); videoList.append( vWidget); } index = 0; for ( j = 0; j < 4; j += 2) { gLayout->addWidget( videoList[ index++], 0, j, 2, 2); } for ( i = 2; i < 4; i++) for ( j = 0; j < 4; j++) gLayout-> addWidget( videoList[ index++], i, j); viewWidget->setLayout(gLayout ); Unfortunat

Comments

Sign in or sign up to comment and upvote.

No comments yet.