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. Widgets inside a text-editor

Widgets inside a text-editor

Scheduled Pinned Locked Moved Solved General and Desktop
texttexteditwidgetembed
2 Posts 2 Posters 1.6k 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.
  • R Offline
    R Offline
    Ramin
    wrote on 26 Nov 2015, 16:53 last edited by
    #1

    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...

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 26 Nov 2015, 19:39 last edited by mrjj
      #2

      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."

      1 Reply Last reply
      1

      1/2

      26 Nov 2015, 16:53

      • Login

      • Login or register to search.
      1 out of 2
      • First post
        1/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved