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. Reading from a PlainTextEdit

Reading from a PlainTextEdit

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 3.5k 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.
  • B Offline
    B Offline
    Bertie
    wrote on last edited by
    #1

    Hello,

    This I'm sure is an immensely stupid question, however it's so simple that I can't find the answer to it. I want to take the information from a PlainTextEdit, put it into a variable and use it elsewhere (for example to populate another box later on). I have the following, where LatEdit and EastingText are both PlainTextEdit's, but get the error 'LatEdit was not declared in this scope'. If I change it to 'num1 = "TEST";' then it will work, so I'm assuming it's me reading in the text incorrectly from the LatEdit control.

    @
    void MainWindow::on_pushButton_clicked()
    {
    QString num1;
    num1 = LatEdit->Plain;
    ui->EastingText->setPlainText(num1);
    }
    @

    Can anyone help me?

    Thanks

    [EDIT: code formatting, please wrap in @-tags, Volker]

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on last edited by
      #2

      Read "this":http://doc.qt.nokia.com/4.7/qplaintextedit.html, then try

      @
      QString num1 = ui->LatEdit->toPlainText();
      @

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • G Offline
        G Offline
        goetz
        wrote on last edited by
        #3

        You can find some information "here":http://lmgtfy.com/?q=c+math+library

        http://www.catb.org/~esr/faqs/smart-questions.html

        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