lineargradient2d QML Value Type
Bietet eine Typübereinstimmung für „lineargradient2d“ mit „ QCanvasLinearGradient “. Mehr...
| Import Statement: | import QtCanvas2D |
| Since: | Qt 6.12 |
| Status: | Technology preview |
Dieser Typ befindet sich in der Technologievorschau und kann sich noch ändern.
Methoden
- void addColorStop(real offset, string color)
- point endPosition()
- void setEndPosition(real x, real y)
- void setEndPosition(point end)
- void setStartPosition(real x, real y)
- void setStartPosition(point start)
- point startPosition()
Ausführliche Beschreibung
Dieser Werttyp wird durch den Import „ QtCanvas2D “ bereitgestellt.
Siehe auch „ QCanvasLinearGradient “.
Methodendokumentation
void addColorStop(real offset, string color)
Fügt dem Farbverlauf an der angegebenen Position offset einen Farbstopp mit dem angegebenen Farbwert color hinzu. 0,0 entspricht dem Versatz am einen Ende des Farbverlaufs, 1,0 dem Versatz am anderen Ende.
Beispiel:
const gradient = ctx.createLinearGradient(0, 0, 100, 100);
gradient.addColorStop(0.0, Qt.rgba(1, 0, 0, 1));
gradient.addColorStop(0.5, "#ff8040");
gradient.addColorStop(1.0, "red");point endPosition()
Gibt den Endpunkt eines linearen Farbverlaufs zurück.
Siehe auch ` setEndPosition()`.
void setEndPosition(real x, real y)
Legt den Endpunkt des linearen Farbverlaufs auf ( x, y) fest.
Siehe auch endPosition().
void setEndPosition(point end)
Setzt den Endpunkt des linearen Farbverlaufs auf „ end “.
Dies ist eine überladene Funktion.
void setStartPosition(real x, real y)
Legt den Startpunkt des linearen Farbverlaufs auf ( x, y) fest.
Siehe auch startPosition().
void setStartPosition(point start)
Legt den Startpunkt des linearen Farbverlaufs auf „ start “ fest.
Dies ist eine überladene Funktion.
point startPosition()
Gibt den Startpunkt eines linearen Farbverlaufs zurück.
Siehe auch „ setStartPosition()“.
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.