PDA

View Full Version : use of popup window



rahulgogoi
14th June 2011, 09:55
hello friends

actually i want to use popwindow instead of messagebox in my app..so i dont know whether there is a facilities of using popup in qt..please anyone suggest me…

regards
rahul

almboa
14th June 2011, 11:56
Hello,

QMessageBox inherits QDialog. You can create your own 'popups' by also deriving a class from QDialog to provide your functionality.

Regards

rahulgogoi
14th June 2011, 13:20
how that can be done...can u show me with simple example..

almboa
14th June 2011, 14:31
first hit in google:

http://www.civilnet.cn/book/embedded/gui/qt4/ch02lev1sec1.html

basically:

// mydialog.h
#include <QDialog>
class MyDialog : public QDialog {
Q_OBJECT
public:
MyDialog(QWidget *parent = 0);

};

// mydialog.cpp
#include "mydialog.h"

MyDialog::MyDialog(QWidget *parent) : QWidget(parent)
{
}

and then add whatever you want to have in your dialog such as buttons, labels, tableviews, ...