Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qtgradientstopsmodel_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5//
6// W A R N I N G
7// -------------
8//
9// This file is not part of the Qt API. It exists for the convenience
10// of Qt Designer. This header file may change from version to version
11// without notice, or even be removed.
12//
13// We mean it.
14//
15
16#ifndef QTGRADIENTSTOPSMODEL_H
17#define QTGRADIENTSTOPSMODEL_H
18
19#include <QtCore/qmap.h>
20#include <QtCore/qobject.h>
21
23
24class QColor;
25
27
29{
30public:
31 qreal position() const;
32 QColor color() const;
34
35private:
36 void setColor(QColor color);
37 void setPosition(qreal position);
39 explicit QtGradientStop(QtGradientStopsModel *model = nullptr);
40 ~QtGradientStop();
42};
43
45{
47public:
49
50 explicit QtGradientStopsModel(QObject *parent = nullptr);
52
53 PositionStopMap stops() const;
54 QtGradientStop *at(qreal pos) const;
55 QColor color(qreal pos) const; // calculated between points
58 bool isSelected(QtGradientStop *stop) const;
62
63 QtGradientStop *addStop(qreal pos, QColor color);
64 void removeStop(QtGradientStop *stop);
65 void moveStop(QtGradientStop *stop, qreal newPos);
66 void swapStops(QtGradientStop *stop1, QtGradientStop *stop2);
67 void changeStop(QtGradientStop *stop, QColor newColor);
68 void selectStop(QtGradientStop *stop, bool select);
70
71 void moveStops(double newPosition); // moves current stop to newPos and all selected stops are moved accordingly
72 void clear();
73 void clearSelection();
74 void flipAll();
75 void selectAll();
76 void deleteStops();
77
81 void stopMoved(QtGradientStop *stop, qreal newPos);
83 void stopChanged(QtGradientStop *stop, const QColor &newColor);
84 void stopSelected(QtGradientStop *stop, bool selected);
86
87private:
91};
92
93QT_END_NAMESPACE
94
95#endif
QtGradientStopsModel * gradientModel() const
QGradientStops makeGradientStops(const PositionColorMap &data) const
PositionColorMap stopsData(const PositionStopMap &stops) const
void slotStopChanged(QtGradientStop *stop, QColor newColor)
void slotCurrentStopChanged(QtGradientStop *stop)
void slotStopsSwapped(QtGradientStop *stop1, QtGradientStop *stop2)
void slotStopSelected(QtGradientStop *stop, bool selected)
void slotStopMoved(QtGradientStop *stop, qreal newPos)
void setUi(Ui::QtGradientEditor *editor)
void setGradientStops(const QGradientStops &stops)
void selectStop(QtGradientStop *stop, bool select)
QList< QtGradientStop * > selectedStops() const
QtGradientStopsModel * clone() const
void stopSelected(QtGradientStop *stop, bool selected)
void removeStop(QtGradientStop *stop)
void changeStop(QtGradientStop *stop, QColor newColor)
QtGradientStop * at(qreal pos) const
bool isSelected(QtGradientStop *stop) const
QtGradientStop * currentStop() const
void stopChanged(QtGradientStop *stop, const QColor &newColor)
QtGradientStop * addStop(qreal pos, QColor color)
QtGradientStop * firstSelected() const
void moveStops(double newPosition)
void stopRemoved(QtGradientStop *stop)
QColor color(qreal pos) const
QtGradientStopsModel(QObject *parent=nullptr)
void stopMoved(QtGradientStop *stop, qreal newPos)
void currentStopChanged(QtGradientStop *stop)
void swapStops(QtGradientStop *stop1, QtGradientStop *stop2)
void stopsSwapped(QtGradientStop *stop1, QtGradientStop *stop2)
PositionStopMap stops() const
QtGradientStop * lastSelected() const
void moveStop(QtGradientStop *stop, qreal newPos)
void setCurrentStop(QtGradientStop *stop)
Combined button and popup list for selecting options.