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. [solved] QPlainTextEdit to QMessageBox Problem
Forum Updated to NodeBB v4.3 + New Features

[solved] QPlainTextEdit to QMessageBox Problem

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.1k 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
    aquanaut
    wrote on last edited by
    #1

    Goodday,

    I am very new to Qt and some assistance. I have created a dialog.ui and add 2 PlainTextEdit. What I need assistance with is:

    How do I concatenate the string from the first edit with the second edit and display the result in a QMessageBox.

    I have been looking for the answer but to no avail.If someone could point in the right direction that would be great.

    Thanks

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Since you don't state how you would like that to happen, I'll take a QPushButton as trigger. Write a slot for that button, and in it grab the text from the tow QPlainTextEdit.

      Roughly

      @
      void MyCoolWidget::on_myButton_clicked()
      {
      QString string = ui->myPlainTextEdit1->toPlainText() + ui->myPlainTextEdit2->toPlainText();
      QMessageBox::information(this, tr("My Cool Title"), string);
      }
      @

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • A Offline
        A Offline
        aquanaut
        wrote on last edited by
        #3

        Thanks for the assistance

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          You're welcome !

          If that answers your question then please update the thread title prepending [solved] so other forum users may know a solution has been found :)

          Happy coding !

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          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