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. QGraphicsTextItem doesn't have methods: setDefaultTextColor and setPos
Forum Updated to NodeBB v4.3 + New Features

QGraphicsTextItem doesn't have methods: setDefaultTextColor and setPos

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 169 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.
  • sergey.glazyrinS Offline
    sergey.glazyrinS Offline
    sergey.glazyrin
    wrote on last edited by
    #1

    Hello guys!
    I am writing first time using Qt, trying to modify Clementine music player and add some useful feature. I almost completed what I wanted to do. But now I need just add text to the window which is QGraphicsScene, so I am trying to add text using method: addText("text")

    It works, but then I need to change color and position of the text in this view. But Kdevelop doesn't recognize that this QGraphicsTextItem (returned by method addText) has methods: setDefaultTextColor and setPos.

    According to documentation it should have.

    Qt: 5-15.

    1 Reply Last reply
    0
    • sergey.glazyrinS Offline
      sergey.glazyrinS Offline
      sergey.glazyrin
      wrote on last edited by
      #2

      Solution was easy. I had to add

      #include <QGraphicsTextItem>
      

      and it just works.

      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