QApplication: Deprecate ColorSpec, setColorSpec() and colorSpec().

The code did not have any effect even (already in Qt 4).
Deprecate functions and mark as \obsolete.

Change-Id: I8d85d9ee8f089f489af6263b33f7c2866e65096a
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This commit is contained in:
Friedemann Kleint 2016-04-21 08:25:23 +02:00 committed by Friedemann Kleint
parent 964b31033f
commit c10a1c8f14
5 changed files with 14 additions and 11 deletions

View File

@ -261,7 +261,7 @@ QT_BEGIN_NAMESPACE
alpha-channel to feature \l {QColor#Alpha-Blended
Drawing}{alpha-blended drawing}.
\sa QPalette, QBrush, QApplication::setColorSpec()
\sa QPalette, QBrush
*/
#define QCOLOR_INT_RANGE_CHECK(fn, var) \

View File

@ -77,6 +77,7 @@ QApplication::setStyle(QStyleFactory::create("Fusion"));
//! [1]
// ### fixme: Qt 6: Remove [2]
//! [2]
int main(int argc, char *argv[])
{

View File

@ -337,8 +337,10 @@ void QApplicationPrivate::createEventDispatcher()
\sa QCoreApplication, QAbstractEventDispatcher, QEventLoop, QSettings
*/
// ### fixme: Qt 6: Remove ColorSpec and accessors.
/*!
\enum QApplication::ColorSpec
\obsolete
\value NormalColor the default color allocation policy
\value CustomColor the same as NormalColor for X11; allocates colors
@ -395,8 +397,6 @@ QString QApplicationPrivate::styleSheet; // default application styles
#endif
QPointer<QWidget> QApplicationPrivate::leaveAfterRelease = 0;
int QApplicationPrivate::app_cspec = QApplication::NormalColor;
QPalette *QApplicationPrivate::sys_pal = 0; // default system palette
QPalette *QApplicationPrivate::set_pal = 0; // default palette set by programmer
@ -1275,17 +1275,21 @@ QStyle* QApplication::setStyle(const QString& style)
/*!
Returns the color specification.
\obsolete
\sa QApplication::setColorSpec()
*/
int QApplication::colorSpec()
{
return QApplicationPrivate::app_cspec;
return QApplication::NormalColor;
}
/*!
Sets the color specification for the application to \a spec.
\obsolete
This call has no effect.
The color specification controls how the application allocates colors when
run on a display with a limited amount of colors, e.g. 8 bit / 256 color
@ -1341,10 +1345,7 @@ int QApplication::colorSpec()
void QApplication::setColorSpec(int spec)
{
if (Q_UNLIKELY(qApp))
qWarning("QApplication::setColorSpec: This function must be "
"called before the QApplication object is created");
QApplicationPrivate::app_cspec = spec;
Q_UNUSED(spec)
}
/*!

View File

@ -98,8 +98,10 @@ public:
static void setStyle(QStyle*);
static QStyle *setStyle(const QString&);
enum ColorSpec { NormalColor=0, CustomColor=1, ManyColor=2 };
static int colorSpec();
static void setColorSpec(int);
#if QT_DEPRECATED_SINCE(5, 8)
QT_DEPRECATED static int colorSpec();
QT_DEPRECATED static void setColorSpec(int);
#endif // QT_DEPRECATED_SINCE(5, 8)
#if QT_DEPRECATED_SINCE(5, 0)
QT_DEPRECATED static inline void setGraphicsSystem(const QString &) {}
#endif

View File

@ -183,7 +183,6 @@ public:
static QWidgetList *popupWidgets;
static QStyle *app_style;
static bool overrides_native_style;
static int app_cspec;
static QPalette *sys_pal;
static QPalette *set_pal;