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. Qt Creator: accessing an object not defined in the source files

Qt Creator: accessing an object not defined in the source files

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 847 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.
  • R Offline
    R Offline
    ritchan
    wrote on last edited by
    #1

    I have a .ui file that looks like this:
    http://img521.imageshack.us/img521/9753/nol.png
    Upon one of the QCheckBoxes being ticked, I want Generated Command Line Preview to update itself. Here's the particular code I'm trying to work with:
    @
    void Dialog::on_inputformatCombo_currentIndexChanged(const QString &arg1)
    {
    commandline.insert(commandline.length(),arg1);
    CLIPreview.setText(commandline);
    }
    @
    However, the dialog.cpp and dialog.h files are bare and don't make any mention of the objects I created in the .ui file. How am I supposed to access CLIPreview then?

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      This wildly depends on how you are including your UI header (upon compilation, uic generates ui_yourdialog.h file).

      If your dialog was generated automatically by Qt Creator, then most probably you need to use:
      @
      ui->CLIPreview->setText("blah");
      @

      (Z(:^

      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