Widgets inside a text-editor



  • What's the best way in Qt to have another widget (e.g. a dropbox) embedded inside a texteditor but also "inline" with the standard text?

    For example, this [drop box [v]] is inline with this line of text. As I insert text behind the dropbox, it would move along with the text as if it were just another character.

    Would you know any such widget/component that implements such functionality using Qt? I can imagine implementing it from scratch would be text rendering nightmare...


  • Qt Champions 2016

    Hi
    Have a look at
    http://doc.qt.io/qt-5.5/qtextobjectinterface.html#details
    http://doc.qt.io/qt-5/qtextobjectinterface.html
    and the "Text Object Example"
    It seems possible to create your own widget to support such feature but
    I have no tested it and do not know if object would receive events.
    also docs says
    "Copy and Paste operations ignore custom text objects."


Log in to reply
 

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