
Originally Posted by
raju@123
Pbm is Qroupbox is adding in the gridlayout at posistion(0,0) not in (2,1)
No, that is not true! It is at (2,1) but you don't check it right. You probably look at the screen where it appears at (0,0) but that is because all other rows and columns are empty and so (2,1) acquires their space. See the output of:
gl.addWidget(&l, 2, 1);
qDebug() << "rows" << gl.rowCount();
qDebug() << "cols" << gl.columnCount();
if (gl.itemAtPosition(2, 1))
{
qDebug() << "Item at (2,1)" << gl.itemAtPosition(2, 1);
qDebug() << " -" << gl.itemAtPosition(2, 1)->widget();
}
QGridLayout gl;
QLabel l("foo");
gl.addWidget(&l, 2, 1);
qDebug() << "rows" << gl.rowCount();
qDebug() << "cols" << gl.columnCount();
if (gl.itemAtPosition(2, 1))
{
qDebug() << "Item at (2,1)" << gl.itemAtPosition(2, 1);
qDebug() << " -" << gl.itemAtPosition(2, 1)->widget();
}
To copy to clipboard, switch view to plain text mode
Bookmarks