Problem in setting gridlayout.
Hi
i am setting a gridlayout in frame which is child class of MainWindow , but the widget which i set on layout are not gett display.Where i am wrong.My code is
Code:
NewWindow
::NewWindow(QWidget *parent
) : ui(new Ui::NewWindow)
{
ui->setupUi(this);
this->setStyleSheet("background-color:gray");
w1 = new MainWindow(string ,this);//Custom Buttons object
QString string1
= "Emergency Help";
w2 = new MainWindow(string1 ,this);//Custom Buttons object
centralFrame->setStyleSheet("background-color:blue");
this->setCentralWidget(centralFrame);
layout->addWidget( w1,0,0);
layout->addWidget( w2,1,1);
centralFrame->setLayout(layout);
centralFrame->setGeometry(160,180,400,200);
}
]
Thanks
Waiting for your reply.
Re: Problem in setting gridlayout.
You have attached centralFrame to NewWindow. So if NewWindow is smaller then about 160x180 then frame is out of view.
PS. Strange solution: MainWindow used as a child for other window/widget and managed by layout.