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] textEdit textChanged return key

[SOLVED] textEdit textChanged return key

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

    how to get the following code to work. in the textEdit textChanged function, i am trying to get to code to recognize the return key. if the return key was pressed, it will set the pushbutton text to "test".

    your code has to work for this code below because there is no way to get the code to work with the keypressevent.

    is it possible to get the very end string of textEdit text and say if it is return then do something.

    the error i get for the code below is warning: 'keyEvent' is used uninitialized in this function

    @void MainWindow::on_plainTextEdit_textChanged()
    {
    QKeyEvent *keyEvent;

    if (keyEvent->key() == Qt::Key_Return)
        ui->pushButton->setText("test");
    

    }@

    1 Reply Last reply
    0
    • K Offline
      K Offline
      kalster
      wrote on last edited by
      #2

      I found a solution to my textEdit problem and it can be found "here...":http://developer.qt.nokia.com/forums/viewthread/8828/

      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