Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. How to access "textEdit" using "topLevelWidget()"?
Forum Updated to NodeBB v4.3 + New Features

How to access "textEdit" using "topLevelWidget()"?

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
2 Posts 2 Posters 237 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.
  • A Offline
    A Offline
    Anonymous_Banned275
    wrote on last edited by
    #1

    This is a repost, and I am hoping it will lead to
    t he solution.

    Here is QDesigner view of the object GUI layout. My objective is to gain access to the first "tab" member "textEdit" using the object " top LevelWidget" member.

    In pseudo code :
    while top LevelWidget != QTextEdit
    if found QTextEdit
    append "TEST TEXT"

    My object is defined:

    MainWindow_C_CODE_FORM *MWCCF = new MainWindow_C_CODE_FORM();

    8a6b9869-5529-4138-a4eb-af4a41c55721-image.png

    JonBJ 1 Reply Last reply
    0
    • A Anonymous_Banned275

      This is a repost, and I am hoping it will lead to
      t he solution.

      Here is QDesigner view of the object GUI layout. My objective is to gain access to the first "tab" member "textEdit" using the object " top LevelWidget" member.

      In pseudo code :
      while top LevelWidget != QTextEdit
      if found QTextEdit
      append "TEST TEXT"

      My object is defined:

      MainWindow_C_CODE_FORM *MWCCF = new MainWindow_C_CODE_FORM();

      8a6b9869-5529-4138-a4eb-af4a41c55721-image.png

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @AnneRanch

      QTextEdit *textEdit = mainWindow->centralWidget()->findChild<QTextEdit *>();
      if (textEdit)
          textEdt->append("TEST TEXT");
      else
          qDebug() << "Did not find any QTextEdit";
      
      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