Qt Forum

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

    Solved How to use an object created in the UI Designer

    General and Desktop
    forms qframe
    2
    3
    846
    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.
    • kenyanke
      kenyanke last edited by kenyanke

      This could be a stupid question to ask...

      I have an application that mounts onto a QFrame to be displayed on screen, I want to add a Frame onto a Form and display my application on it.

      // QFrame* MainFrame = new QFrame;
      // MainFrame->setWindowTitle("Sugarscape");
      // MainFrame->resize(400, 400);
      // MainFrame->show();

      // Create a SFML view inside the main frame
      // Sugarscape* SFMLView = new Sugarscape(MainFrame, QPoint(20, 20), QSize(360, 360));
      // SFMLView->show();

      The above code I'm creating explicitly in my main, but I want to create one using the form, but don't know how to access the objects reference. (can only access the slots for resize, setWindowTitle, destroyed etc)

      e.g... but for the actual frame in ClassName class

      ClassName::On_MainFrame_setWindowTitle(QString &title)
      {

      }

      1 Reply Last reply Reply Quote 0
      • A
        asanka424 last edited by

        usually UI objects created in designer are accessible using ui variable. for example ui->form. Not sure if thats what you want.

        kenyanke 1 Reply Last reply Reply Quote 0
        • kenyanke
          kenyanke @asanka424 last edited by kenyanke

          Thank you.

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