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. Unexpected behaviour for QPixmap on QGraphicsScene
Qt 6.11 is out! See what's new in the release blog

Unexpected behaviour for QPixmap on QGraphicsScene

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.5k 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Having developed a previous program in QT for a course of mine, I now thought about doing a project for myself. This will be a small game, just to keep busy. I've set up my GUI and everything is fine, but now I'm trying to show a small *.png and it comes out all... pixelly. To illustrate, I've added a small screenshot. In this screenshot, two things are being drawn.

    The background is a QGraphicsView with a QGraphicsScene.
    On the latter, I use the addLine and addPixmap funtions. For the line I've made a custom pen with width 8 and color black. The Pixmap uses a small *.png I've found on the net. Both come out pixelly (lacking a better word).

    Where should I look in solving this issue...? Any help is highly appreciated.!

    http://imageshack.us/photo/my-images/339/screenshotat20120506170.png/(Screenshot)!

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

      I've never seen anything like this, but here's a few things I'd check:

      -) Are any transformations set on those items?
      -) Is a transformation set on the GraphicsView?
      -) Which rendering engine are you using? Raster? OpenGL?
      -) Is anti aliasing enabled or disabled?
      -) What happens if, instead of using QGraphicsLineItem and QGraphicsPixmapItem (I'm just guessing that you use those), use a custom QGraphicsItem and do your own painting?

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        After trying a lot of different things, I decided to rebuild the project (I had only just started). After rebuilding it, no problems anymore... I must have screwed something somewhere during the initial design of the form, I suspect. Any ways, thanks Asperamanca for your reply.

        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