Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. German
  4. QGraphicsPathItem wird nicht angezeigt, QPainterPath schon
Forum Updated to NodeBB v4.3 + New Features

QGraphicsPathItem wird nicht angezeigt, QPainterPath schon

Scheduled Pinned Locked Moved German
2 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.
  • S Offline
    S Offline
    sepp_w
    wrote on last edited by
    #1

    Hallo Gemeinde,
    ich bin noch recht neu bei Qt und habe folgendes Problem:
    Ich habe eine Klasse die von QGraphicsView erbt und einige drawXXX() Funktionen (public) anbietet.
    Wenn ich in so einer Funktion

    @QPainterPath path;
    (...)
    scene()->addPath(path);@

    mache, wird der Path angezeigt.
    Wenn ich aber

    @QPainterPath path;
    (...)
    QGraphicsPathItem item2(path);
    scene()->addItem(&item2);@

    mache hingegen nicht.
    Hat jemand eine Idee woran das liegen kann?
    Vielen Dank schonmal und Liebe Grüße

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

      Wenn du das QGraphicsPathItem wirklich am Stack anlegst, wird es zerstört, bevor es gezeichnet werden kann.

      Bei scene()->addPath wird wohl eine Kopie gezogen.

      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