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. Select QGraphicsObject when QTextEdit got clicked
Qt 6.11 is out! See what's new in the release blog

Select QGraphicsObject when QTextEdit got clicked

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 288 Views 2 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.
  • HojjatJafaryH Offline
    HojjatJafaryH Offline
    HojjatJafary
    wrote on last edited by
    #1

    I have a QGraphicsObject with a QTextEdit on top of it thought QGraphicsProxyWidget,
    I want the QGraphicsObject get selected when clicked on the QTextEdit.

    Pl45m4P 1 Reply Last reply
    0
    • HojjatJafaryH HojjatJafary

      I have a QGraphicsObject with a QTextEdit on top of it thought QGraphicsProxyWidget,
      I want the QGraphicsObject get selected when clicked on the QTextEdit.

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by Pl45m4
      #2

      @HojjatJafary

      Why dont you connect them?!

      If your QTextEdit hasFocus (https://doc.qt.io/qt-5/qwidget.html#focus-prop), select your QGraphicsObject (https://doc.qt.io/qt-5/qgraphicsitem.html#setSelected)
      (Set QGraphicsItem::ItemIsSelectable flag first)


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      1 Reply Last reply
      1
      • HojjatJafaryH Offline
        HojjatJafaryH Offline
        HojjatJafary
        wrote on last edited by
        #3

        Thanks, I just needed an event filter to detect focus changes.

        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