Corcovado
16-02-2006, 12:37
Hallo,
Ich habe eine einfache Frage, vllt noch etwas allg. Info: ich bin gerade bei folgendem Tutorial http://doc.trolltech.com/3.0/tutorial1-12.html und versuche mich gerade an folgender Aufgabe:
If you did the "round shot" exercise from the previous chapter, try changing the shotRect() to a shotRegion() that returns a QRegion so you can have really accurate collision detection.
Ich habe in der Funktion shotRegion() den Returntype von QRect durch QRegion ersetzt - ein drawEllipse() hat mir bisher nicht geholfen, weil ich auch dem bisher keine Region geben konnte. Wie kann ich jetzt die Funktion QPainter::drawRect( const QRect & r), so ersetzen, dass ich statt des Parameters "const QRect & r" etwa "const QRegion & r" (type Ellipse) uebergeben kann?
Zusammenfassend:
Wie kann ich einem QPainter eine QRegion statt eines QRect zum "painten" uebergeben?
Ich habe eine einfache Frage, vllt noch etwas allg. Info: ich bin gerade bei folgendem Tutorial http://doc.trolltech.com/3.0/tutorial1-12.html und versuche mich gerade an folgender Aufgabe:
If you did the "round shot" exercise from the previous chapter, try changing the shotRect() to a shotRegion() that returns a QRegion so you can have really accurate collision detection.
Ich habe in der Funktion shotRegion() den Returntype von QRect durch QRegion ersetzt - ein drawEllipse() hat mir bisher nicht geholfen, weil ich auch dem bisher keine Region geben konnte. Wie kann ich jetzt die Funktion QPainter::drawRect( const QRect & r), so ersetzen, dass ich statt des Parameters "const QRect & r" etwa "const QRegion & r" (type Ellipse) uebergeben kann?
Zusammenfassend:
Wie kann ich einem QPainter eine QRegion statt eines QRect zum "painten" uebergeben?