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. A problem about QGraphicsTextItem
Forum Updated to NodeBB v4.3 + New Features

A problem about QGraphicsTextItem

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 849 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.
  • B Offline
    B Offline
    by9881
    wrote on last edited by
    #1

    Hello everyone , I'm new here. And I'm sorry that I don't good at English.
    In the demo in example/widgets/graphicsview/digramscene, it is a program for creating simple diagrams. One of features is inserting a DiagramTextItem, which is a subclass of QGraphicsTextItem, and you can type some text in it. But if you want to modify the text, you have to first double click the item, then click on the cursor again (although there is already a cursor after your double-click, it dosen't work when you press a key). I think this behavior is really strange, do you have a solution? My Qt version is Qt5.2 64 bit on linux.
    Thank you for attention.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      ScottR
      wrote on last edited by
      #2

      Add a " setFocus(Qt::MouseFocusReason);" to DiagramTextItem::mouseDoubleClickEvent()

      1 Reply Last reply
      0
      • B Offline
        B Offline
        by9881
        wrote on last edited by
        #3

        Oh,thank you very much.

        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