Qwidget as modal



  • Hi

    I have a Qwidget window which i m displaying on click of button.
    I want to make this QWidget window as modal how to do this.

    Below is my piece of code which gets called when i click button.

    @ Myobj *obj1 = new Myobj();
    obj1->show();@

    Myobj class
    @class Myobj: public QWidget
    {
    Q_OBJECT

    public:
    Myobj(QWidget *parent = 0);
    ~Myobj();
    Ui::Myobj ui;
    public slots:
    void OnBrowseOneFile();
    void OnImportOneFile();
    private:
    };@


  • Moderators

    Using:
    @
    setWindowModality(Qt::WindowModal);
    @

    in MyObj's constructor does not work?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.