Nested pop ups



  • Re: Pop up examples

    When I make a new pop up and show it using show() or exec() after clicking a button, can I use the buttons on the pop ups as well? Basically can I use nested pop ups?


  • Qt Champions 2016

    Hi and welcome to the forums
    When you say "popup" do you mean dialog or what kind of widget ?
    But yes, in most situations you can.



  • @mrjj I meant dialog. Also I figured out my mistake but I don't know how to fix it.

    The reason it isn't working for me is because I haven't included Q_OBJECT in any of the header files except the first one. This is why my signals aren't working. I understand a simple solution to that would be to include Q_OBJECT in each header file but that shows different kind of error. Specifically it says the following errors

    undefined reference to 'NewAccount::staticMetaObject'

    What can I do?

    For you better understanding, I am writing a pseudo code below :

    //Header File for newaccount.h
    #include <QDialog>

    class NewAccount : public QDialog
    {
    Q_OBJECT
    };


    //Header File for userinfo.h
    #include <QDialog>
    #include "newaccount.h"

    class UserInfo : public QDialog
    {
    Q_OBJECT

    protected : NewAccount *new;
    };


  • Qt Champions 2016

    @Utkarsh-Agarwal said in Nested pop ups:

    undefined reference to 'NewAccount::staticMetaObject'

    Hi
    Make sure that all the classes are defined in .h file. ( not defined in any .cpp )
    Then completely clean your build folder. qamke + rebuild all.

    This error i have seen mostly with the moc tool not find the class or the
    unit was not recompiled after adding Q_OBJECT.


Log in to reply
 

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