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. How to use an object created in the UI Designer
QtWS25 Last Chance

How to use an object created in the UI Designer

Scheduled Pinned Locked Moved Solved General and Desktop
formsqframe
3 Posts 2 Posters 1.2k 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.
  • kenyankeK Offline
    kenyankeK Offline
    kenyanke
    wrote on last edited by kenyanke
    #1

    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
    0
    • A Offline
      A Offline
      asanka424
      wrote on last edited by
      #2

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

      kenyankeK 1 Reply Last reply
      0
      • A asanka424

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

        kenyankeK Offline
        kenyankeK Offline
        kenyanke
        wrote on last edited by kenyanke
        #3

        Thank you.

        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