Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Getting The Object Created and accessing it..
QtWS25 Last Chance

Getting The Object Created and accessing it..

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 361 Views
  • 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 Offline
    Z Offline
    zeroptr
    wrote on last edited by
    #1

    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
    0
    • jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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
      0

      • Login

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