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] showing a window while a user is editing a QLineEdit field
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] showing a window while a user is editing a QLineEdit field

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

    Is there a way that I could popup a window while a user is editing a QLineEdit field without interrupting the edit process?

    1 Reply Last reply
    0
    • P Offline
      P Offline
      p-himik
      wrote on last edited by
      #2

      Maybe "QToolTip":http://developer.qt.nokia.com/doc/qt-4.7/qtooltip.html will be enough for you?

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

        Perhaps you can use a QCompleter in popupCompleter mode? What do you want to achieve exactly?

        1 Reply Last reply
        0
        • F Offline
          F Offline
          fluca1978
          wrote on last edited by
          #4

          If you need a complete window, and popup is not enough for you, you have to manually catch the signal of editing, open a new window, place it in the screen, and set the focus back to the edit component. It depends on what are you needs.

          1 Reply Last reply
          0
          • Y Offline
            Y Offline
            yanbellavance
            wrote on last edited by
            #5

            Well the tooltip seems to work only with mouse over, perhaps I can generate an event to get it to show up instead. I have not tried the popup but I supposed it would of done the same thing. Will give it a try. As for fluca1978's solution, I want to make sure there are no simpler implementations before going that route but thanks for the idea.

            Here is what I want to do: When the user is filling in data that is invalid, I want to show a non obtrusive message to this regard, ie it will not interrupt the process of editing the field. Now I have all the code written to validate the data and I am currently implementing this message with a QMessageBox but this ends the editing process and the user needs to close the box and reenable editing.

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

              This basically works for me:

              @
              void MainWindow::displayToolTip()
              {
              QPoint pos = mapToGlobal(ui->textEdit->pos());
              QToolTip::showText(pos, QString("The text edit has %1 chars").arg(ui->textEdit->toPlainText().count()));
              }
              @

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

              1 Reply Last reply
              0
              • Y Offline
                Y Offline
                yanbellavance
                wrote on last edited by
                #7

                [quote author="Volker" date="1320789006"]This basically works for me:

                @
                void MainWindow::displayToolTip()
                {
                QPoint pos = mapToGlobal(ui->textEdit->pos());
                QToolTip::showText(pos, QString("The text edit has %1 chars").arg(ui->textEdit->toPlainText().count()));
                }
                @

                [/quote]

                I did this originally but the tooltip wasn't alway showing, probably due to me making the changes too fast. thanks.

                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