Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved Getting The Object Created and accessing it..

    General and Desktop
    2
    2
    256
    Loading More Posts
    • 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.
    • Z
      zeroptr last edited by

      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;
              mform1->showFullScreen();
             break;
          case 2:
              mform2 = new form2(this);
              mform2->Editable = Editable;
              mform2->showFullScreen();
             break;
      .
      .
      .
          default:
              break;
          }
      

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

      how can i solve this..

      Linux Mint 20.04 64 Bit QT6.0.1

      1 Reply Last reply Reply Quote 0
      • jsulm
        jsulm Lifetime Qt Champion last edited by

        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.

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply Reply Quote 0
        • First post
          Last post