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 QTextEdit
Forum Updated to NodeBB v4.3 + New Features

How to use QTextEdit

Scheduled Pinned Locked Moved Unsolved General and Desktop
22 Posts 5 Posters 3.0k Views 2 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.
  • JonBJ JonB

    @Gojir4 said in How to use QTextEdit:

    @jenya7 Of course. It is only visible in MainWindow.
    You need to add a method (or slot) in your MainWindow allowing to access the control, or to set the text
    void MainWindow::setTerminalText(const QString &txt){
    ui->textEditTerminalRx->setText(txt);
    }

    OOI, how does this help? How does a different class/module/form get any access to the MainWindow instance to call that method, any more than to the ui?

    Gojir4G Offline
    Gojir4G Offline
    Gojir4
    wrote on last edited by
    #21

    @JonB said in How to use QTextEdit:

    @Gojir4 said in How to use QTextEdit:

    @jenya7 Of course. It is only visible in MainWindow.
    You need to add a method (or slot) in your MainWindow allowing to access the control, or to set the text
    void MainWindow::setTerminalText(const QString &txt){
    ui->textEditTerminalRx->setText(txt);
    }

    OOI, how does this help? How does a different class/module/form get any access to the MainWindow instance to call that method, any more than to the ui?

    @JonB said in How to use QTextEdit:

    You either need to decide to gain access to the main window's text edit so that you can set its text directly, or (perhaps more suitable for your use case) you could have it raise a signal when stuff is"going on", and the main window could place a slot on that signal so that it updates the text edit.

    :P thanks for this moment of fun

    JonBJ 1 Reply Last reply
    0
    • Gojir4G Gojir4

      @JonB said in How to use QTextEdit:

      @Gojir4 said in How to use QTextEdit:

      @jenya7 Of course. It is only visible in MainWindow.
      You need to add a method (or slot) in your MainWindow allowing to access the control, or to set the text
      void MainWindow::setTerminalText(const QString &txt){
      ui->textEditTerminalRx->setText(txt);
      }

      OOI, how does this help? How does a different class/module/form get any access to the MainWindow instance to call that method, any more than to the ui?

      @JonB said in How to use QTextEdit:

      You either need to decide to gain access to the main window's text edit so that you can set its text directly, or (perhaps more suitable for your use case) you could have it raise a signal when stuff is"going on", and the main window could place a slot on that signal so that it updates the text edit.

      :P thanks for this moment of fun

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

      @Gojir4 said in How to use QTextEdit:

      :P thanks for this moment of fun

      ??

      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