remove internal QColor constructors

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2022-06-26 19:11:34 +03:00
parent 342271693d
commit e12df82e5c
3 changed files with 0 additions and 57 deletions

View file

@ -341,33 +341,6 @@ QColor::QColor(QRgb color)
ct.argb.blue = qBlue(color) * 0x101;
}
/*!
\internal
Constructs a color with the given \a spec.
This function is primarly present to avoid that QColor::Invalid
becomes a valid color by accident.
*/
QColor::QColor(Spec spec)
{
switch (spec) {
case QColor::Invalid: {
invalidate();
break;
}
case QColor::Rgb: {
setRgb(0, 0, 0);
break;
}
case QColor::Hsv: {
setHsv(0, 0, 0);
break;
}
}
}
/*!
\fn QColor::QColor(const QString &name)
@ -1866,13 +1839,6 @@ QDataStream &operator>>(QDataStream &stream, QColor &color)
the alpha-channel is ignored.
*/
/*!
\fn QColor::QColor(int x, int y, int z, Spec colorSpec)
Use one of the other QColor constructors, or one of the static convenience
functions, instead.
*/
/*!
\fn QColor::rgb(int *r, int *g, int *b) const

View file

@ -45,7 +45,6 @@ public:
QColor(const QString& name);
QColor(const char *name);
QColor(const QColor &color);
QColor(Spec spec);
bool isValid() const;
@ -140,9 +139,6 @@ public:
static bool isValidColor(const QString &name);
private:
// do not allow a spec to be used as an alpha value
QColor(int, int, int, Spec);
void invalidate();
Spec cspec;

View file

@ -98,9 +98,6 @@ private slots:
void assignmentOoperator();
void equalityOperator();
void specConstructor_data();
void specConstructor();
#ifdef Q_WS_X11
void allowX11ColorNames();
void setallowX11ColorNames();
@ -824,22 +821,6 @@ void tst_QColor::equalityOperator()
Q_DECLARE_METATYPE(QColor::Spec);
void tst_QColor::specConstructor_data()
{
QTest::addColumn<QColor::Spec>("spec");
QTest::newRow("Invalid") << QColor::Invalid;
QTest::newRow("Rgb") << QColor::Rgb;
QTest::newRow("Hsv") << QColor::Hsv;
}
void tst_QColor::specConstructor()
{
QFETCH(QColor::Spec, spec);
QColor color = spec;
QCOMPARE(color.spec(), spec);
}
#ifdef Q_WS_X11
void tst_QColor::allowX11ColorNames()
{