QMainWindow
I have created a main window with a qvboxlayout where I have placed a combobox, a tree widget and the button ok. When I click the button ok, I create a new qvboxlayout with some widgets. The new qvboxlayout has the button return. How can I return to the first window with the choices of the user?
Do I have to create a new MainWindow or is there a function that does the whole work?
The code is :
- setupUI();
- }
- QXSRExample::~QXSRExample() {
- }
- void QXSRExample::setupUI() {
- _layout = new QVBoxLayout;
- frame->setLayout(_layout);
- parseXML();
- scrollArea->setWidget(frame);
- scrollArea->setWidgetResizable(true);
- setCentralWidget(scrollArea);
- }
- ………
- _layout = new QVBoxLayout;
- frame2->setLayout(_layout);
- scrollArea->setWidget(frame2);
- scrollArea->setWidgetResizable(true);
- setCentralWidget(scrollArea);
- while(!persons3.isEmpty()) {
- if ((person["surname"]==itemName) or (person["name"]==itemName)){
- ………….
- personGB->setLayout(layout);
- this->_layout->addWidget(personGB);
- }
- }
- connect(ok, SIGNAL(clicked()),this, SLOT(cancel()));
- }
EDIT: please only use one @-tag in the beginning of the code, and one in the end, Gerolf
2 replies
You must log in to post a reply. Not a member yet? Register here!




