Important: Please read the Qt Code of Conduct -

Getting The Object Created and accessing it..

  • Hi All,

    I have a strange problem..

    One of my class opens a form there are 10 forms depending on a global variable it opens one in a switch case .. And an other 2. form.. and destroys itself..

    The second form created in some cases have to chage public variable of that created first class which has 10 choices..

        form1 *mform1;
        form2 *mform2;
        form3 *mform3;
    form10 *mform10;
        switch (aVariable) {
        case 1:
            mform1 = new form1(this);
            mform1->Editable = Editable;
        case 2:
            mform2 = new form2(this);
            mform2->Editable = Editable;

    İn some cases the seont form that created needs to accesss the created formx.ediatable and change it..

    how can i solve this..

  • Lifetime Qt Champion

    It is really hard to understand what you're describing.
    In general your forms should not access each other directly, instead you should use signals/slots to exchange data or to trigger activities.

Log in to reply