Qt popup menue in QPlainTextEdit



  • I have a QPlaintTextEdit and what I'm trying to do is when I press on some words in it appear something like this menu that appears when I press on function or variable in Qt IDE as an example
    alt text
    but I don't know even its name or what I should search for so if there is any hint or code can I use to do this
    all my text in the plain text Edit will be in red I want to specify a description to each word and make this menu appear when pointing on it
    Update
    when I do more search I found it and support by Qt called QToolTip it can be created on any Qt widget but how to use it inside QPlaintTextEdit or QTextEdit on words? any help or idea for that
    Thanks in Advance


  • Lifetime Qt Champion

    Hi,

    You'd likely need to implement the mouseMoveEvent function and check whether there's something under the cursor but only do the check if the mouse hasn't move after a defined time otherwise you'll likely just lose processing time for nothing.

    Hope it helps


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.