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. How to select only part of a text of QGraphicTextItem
Forum Updated to NodeBB v4.3 + New Features

How to select only part of a text of QGraphicTextItem

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 1 Posters 407 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.
  • M Offline
    M Offline
    MS_GX
    wrote on last edited by
    #1

    I can make a QGraphicsTextItem selectable by using setTextInteractionFlags(QtGui.Qt.TextSelectableByMouse) which allows me also to copy the selected text.

    However, with this method I am only able to select the entire text if the item. But I would like to be able to select just a part of it (via a cursor maybe, but this is not absolutely necessary) and then copy the selected part.

    I there a solution for this already available?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      MS_GX
      wrote on last edited by
      #3

      I did not propagate the mousePressEvent.

      See here: https://forum.qt.io/topic/120951/ideal-way-to-show-markable-text-in-qgraphicsscene/4

      1 Reply Last reply
      1
      • M Offline
        M Offline
        MS_GX
        wrote on last edited by
        #2

        This is still unsolved :( Is QGraphicsTextItem even the right item for this application?

        1 Reply Last reply
        0
        • M Offline
          M Offline
          MS_GX
          wrote on last edited by
          #3

          I did not propagate the mousePressEvent.

          See here: https://forum.qt.io/topic/120951/ideal-way-to-show-markable-text-in-qgraphicsscene/4

          1 Reply Last reply
          1

          • Login

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