Hello List,
I have created a small GUI using two ui files.
The first UI file has a button and after buttonClickHandler executed it loads 
the 2nd GUI as defined in an .ui file.
But, the 2nd Widget does not stay and disaapears immediately. 

void MainWindow::buttonClickHandler()
{
  QMessageBox msgBox;
  msgBox.setWindowTitle("MyWorld");
  msgBox.setText("Interface for new widgets");
  msgBox.setInformativeText("Instead of MessageBox, another widget to be shown 
here");

   AddressBook addrBook;
   addrBook.show();
   
}

The above program is fine.
and the 2nd Widget as :

--------------------------------
    #include "addressbook.h"
    #include <QMessageBox>
    #include "ui_AddressBook.h"

    AddressBook::AddressBook(QWidget *parent)
        : QWidget(parent), ui(new Ui::AddressBookClass)
    {
        ui->setupUi(this);
                                                  (at  this point if I add      
"this.show()". It shows both widget at start of the main.
    }

    void AddressBook::infoButtonHandler()
    {
      QMessageBox msgBox;
      msgBox.setWindowTitle("MyInfo");
      msgBox.setText("Details here");
      msgBox.setInformativeText("Place Holder for My Info");

       msgBox.exec();
    }
    AddressBook::~AddressBook()
    {
        delete ui;
    }

=============================


Please reply how the 2nd window shall wait  till the button is clicked.


Thanks in advance,
arun

_______________________________________________
Qt-creator mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-creator

Reply via email to