Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Nested pop ups
Qt 6.12 LTS is out! See what's new in the release blog

Nested pop ups

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 1.2k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    Utkarsh Agarwal
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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.

      U 1 Reply Last reply
      0
      • mrjjM mrjj

        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.

        U Offline
        U Offline
        Utkarsh Agarwal
        wrote on last edited by
        #3

        @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;
        };

        mrjjM 1 Reply Last reply
        0
        • U Utkarsh Agarwal

          @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;
          };

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @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.

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt
          • Unsolved