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. [SOLVED] How to remove Gray color background on selected text in QGraphicsTextItem after deselection.
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] How to remove Gray color background on selected text in QGraphicsTextItem after deselection.

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

    Whenever we select some part of text in QGraphcisTextItem programs create default blue color background over that text and if we deselect QGraphcisTextItem , then program leaves gray color background with white color text.

    can anybody suggest how to remove this gray color background ?????

    1 Reply Last reply
    0
    • A Offline
      A Offline
      Asperamanca
      wrote on last edited by
      #2

      I am not entirely sure based on your description, but I suspect that the text stays selected while the GraphicsItem loses focus.

      Try reimplementing focusOut of the QGraphicsTextItem, and remove the text selection manually.

      1 Reply Last reply
      0
      • N Offline
        N Offline
        niks1989
        wrote on last edited by
        #3

        @Asperamancacabq

        thanx for suggesting a way ..
        i did a bit different

        i overrode itemchange() and in that checked section of ItemSelectedChange
        if selection false then call clearselection() from QTextCursor object.

        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