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. Accessing objects inside form
Forum Updated to NodeBB v4.3 + New Features

Accessing objects inside form

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 833 Views 1 Watching
  • 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.
  • U Offline
    U Offline
    unCrypticSolutions
    wrote on last edited by
    #1

    so im a beginner in qt. my question is let's say i created something in the form of the qt gui application. how can i access that inside the c++ code ?

    1 Reply Last reply
    0
    • clogwogC Offline
      clogwogC Offline
      clogwog
      wrote on last edited by
      #2

      when you create a form using the qtcreator, it creates a matching class
      have a look at the ui pointer in that class

      for example i created a the form called MainWindow, QtCreator made a MainWindow class that contains a

      @Ui::MainWindow *ui;@

      to access a button that i created on MainWindow i can call:

      @ui->pb_myButton.setText("allo allo");@

      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