Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. Text selection in model-view implementation
Forum Updated to NodeBB v4.3 + New Features

Text selection in model-view implementation

Scheduled Pinned Locked Moved Unsolved Qt for Python
3 Posts 2 Posters 671 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.
  • I Offline
    I Offline
    iLLiCiT
    wrote on last edited by
    #1

    Hi, I want to ask if is possible (and how if possible) to make QTreeView's item's text selectable by mouse like when:

    label = QLabel("Selectable text")
    label.setTextInteractionFlags(Qt.TextSelectableByMouse)
    

    I'm using customized QTreeView, QAbstractListModel and QStyledItemDelegate.
    Delegate is painting QTextDocument.

    Not sure if these information are enough.

    Can anyone help me please?

    1 Reply Last reply
    0
    • I Offline
      I Offline
      iLLiCiT
      wrote on last edited by
      #2

      I want to be able to do this kind of selection:
      0_1566545885531_db43cbdf-6714-4267-b355-1671cc501e8a-image.png

      • select text from item and be able to copy selection with shortcut. Like QLabel when you set interaction flag TextSelectableByMouse
      1 Reply Last reply
      0
      • I Offline
        I Offline
        iLLiCiT
        wrote on last edited by
        #3

        I describe it incomprehensibly or it's not possible?

        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