summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2011-05-03 22:37:25 +0200
committerLars Knoll <lars.knoll@nokia.com>2011-05-03 22:37:25 +0200
commit181df199d31a8018cfcfc31b548909fe4b57ccbd (patch)
tree76833450e7d545d8345a4f529ef5320f24188c1e /src
parent52352c6c572f15c10c4c3de641db81723aada468 (diff)
remove more QT3_SUPPORT code
Diffstat (limited to 'src')
-rw-r--r--src/gui/accessible/qaccessible.h3
-rw-r--r--src/gui/image/qbitmap.cpp87
-rw-r--r--src/gui/image/qbitmap.h23
-rw-r--r--src/gui/image/qicon.cpp94
-rw-r--r--src/gui/image/qicon.h19
-rw-r--r--src/gui/image/qimage.cpp553
-rw-r--r--src/gui/image/qimage.h49
-rw-r--r--src/gui/image/qimage_p.h3
-rw-r--r--src/gui/image/qmovie.h20
-rw-r--r--src/gui/image/qpicture.h3
-rw-r--r--src/gui/image/qpixmap.cpp185
-rw-r--r--src/gui/image/qpixmap.h28
-rw-r--r--src/gui/kernel/kernel.pri4
-rw-r--r--src/gui/kernel/qcursor.h12
-rw-r--r--src/gui/kernel/qdnd_x11.cpp4
-rw-r--r--src/gui/kernel/qevent.cpp232
-rw-r--r--src/gui/kernel/qevent.h77
-rw-r--r--src/gui/kernel/qguivariant.cpp28
-rw-r--r--src/gui/kernel/qpalette.cpp315
-rw-r--r--src/gui/kernel/qpalette.h73
-rw-r--r--src/gui/kernel/qwidget.cpp5
-rw-r--r--src/gui/kernel/qwidget.h3
-rw-r--r--src/gui/kernel/qwindowdefs.h3
-rw-r--r--src/gui/styles/qstyle.cpp28
24 files changed, 2 insertions, 1849 deletions
diff --git a/src/gui/accessible/qaccessible.h b/src/gui/accessible/qaccessible.h
index c71417352b..be3d4b5ffc 100644
--- a/src/gui/accessible/qaccessible.h
+++ b/src/gui/accessible/qaccessible.h
@@ -125,9 +125,6 @@ public:
Offscreen = 0x00010000,
Sizeable = 0x00020000,
Movable = 0x00040000,
-#ifdef QT3_SUPPORT
- Moveable = Movable,
-#endif
SelfVoicing = 0x00080000,
Focusable = 0x00100000,
Selectable = 0x00200000,
diff --git a/src/gui/image/qbitmap.cpp b/src/gui/image/qbitmap.cpp
index b861997cbb..6cd8363374 100644
--- a/src/gui/image/qbitmap.cpp
+++ b/src/gui/image/qbitmap.cpp
@@ -204,20 +204,6 @@ QBitmap &QBitmap::operator=(const QPixmap &pixmap)
return *this;
}
-
-#ifdef QT3_SUPPORT
-QBitmap::QBitmap(int w, int h, const uchar *bits, bool isXbitmap)
-{
- *this = fromData(QSize(w, h), bits, isXbitmap ? QImage::Format_MonoLSB : QImage::Format_Mono);
-}
-
-
-QBitmap::QBitmap(const QSize &size, const uchar *bits, bool isXbitmap)
-{
- *this = fromData(size, bits, isXbitmap ? QImage::Format_MonoLSB : QImage::Format_Mono);
-}
-#endif
-
/*!
Destroys the bitmap.
*/
@@ -332,77 +318,4 @@ QBitmap QBitmap::transformed(const QMatrix &matrix) const
return transformed(QTransform(matrix));
}
-#ifdef QT3_SUPPORT
-/*!
- \fn QBitmap QBitmap::xForm(const QMatrix &matrix) const
-
- Returns a copy of this bitmap, transformed according to the given
- \a matrix.
-
- Use transformed() instead.
-*/
-
-/*!
- \fn QBitmap::QBitmap(const QSize &size, bool clear)
-
- Constructs a bitmap with the given \a size. If \a clear is true,
- the bits are initialized to Qt::color0.
-
- Use the corresponding QBitmap() constructor instead, and then call
- the clear() function if the \a clear parameter is true.
-*/
-
-/*!
- \fn QBitmap::QBitmap(int width, int height, bool clear)
-
- Constructs a bitmap with the given \a width and \a height. If \a
- clear is true, the bits are initialized to Qt::color0.
-
- Use the corresponding QBitmap() constructor instead, and then call
- the clear() function if the \a clear parameter is true.
-*/
-
-/*!
- \fn QBitmap::QBitmap(int width, int height, const uchar *bits, bool isXbitmap)
-
- Constructs a bitmap with the given \a width and \a height, and
- sets the contents to the \a bits supplied. The \a isXbitmap flag
- should be true if \a bits was generated by the X11 bitmap
- program.
-
- Use the static fromData() function instead. If \a isXbitmap is
- true, use the default bit order(QImage_FormatMonoLSB) otherwise
- use QImage::Format_Mono.
-
- \omit
- The X bitmap bit order is little endian. The QImage
- documentation discusses bit order of monochrome images. Opposed to
- QImage, the data has to be byte aligned.
-
- Example (creates an arrow bitmap):
- \snippet doc/src/snippets/code/src_gui_image_qbitmap.cpp 0
- \endomit
-*/
-
-
-/*!
- \fn QBitmap::QBitmap(const QSize &size, const uchar *bits, bool isXbitmap)
-
- \overload
-
- Constructs a bitmap with the given \a size, and sets the contents
- to the \a bits supplied. The \a isXbitmap flag should be true if
- \a bits was generated by the X11 bitmap program.
-
- \omit
- The X bitmap bit order is little endian. The QImage documentation
- discusses bit order of monochrome images.
- \endomit
-
- Use the static fromData() function instead. If \a isXbitmap is
- true, use the default bit order(QImage_FormatMonoLSB) otherwise
- use QImage::Format_Mono.
-*/
-#endif
-
QT_END_NAMESPACE
diff --git a/src/gui/image/qbitmap.h b/src/gui/image/qbitmap.h
index f1771e3e43..9dff0816dd 100644
--- a/src/gui/image/qbitmap.h
+++ b/src/gui/image/qbitmap.h
@@ -74,34 +74,11 @@ public:
QBitmap transformed(const QMatrix &) const;
QBitmap transformed(const QTransform &matrix) const;
-#ifdef QT3_SUPPORT
- inline QT3_SUPPORT_CONSTRUCTOR QBitmap(int w, int h, bool clear);
- inline QT3_SUPPORT_CONSTRUCTOR QBitmap(const QSize &, bool clear);
- QT3_SUPPORT_CONSTRUCTOR QBitmap(int w, int h, const uchar *bits, bool isXbitmap=false);
- QT3_SUPPORT_CONSTRUCTOR QBitmap(const QSize &, const uchar *bits, bool isXbitmap=false);
- inline QT3_SUPPORT QBitmap xForm(const QMatrix &matrix) const { return transformed(QTransform(matrix)); }
- QT3_SUPPORT_CONSTRUCTOR QBitmap(const QImage &image) { *this = fromImage(image); }
- QT3_SUPPORT QBitmap &operator=(const QImage &image) { *this = fromImage(image); return *this; }
-#endif
typedef QExplicitlySharedDataPointer<QPixmapData> DataPtr;
};
Q_DECLARE_SHARED(QBitmap)
-#ifdef QT3_SUPPORT
-inline QBitmap::QBitmap(int w, int h, bool clear)
- : QPixmap(QSize(w, h), 1)
-{
- if (clear) this->clear();
-}
-
-inline QBitmap::QBitmap(const QSize &size, bool clear)
- : QPixmap(size, 1)
-{
- if (clear) this->clear();
-}
-#endif
-
QT_END_NAMESPACE
QT_END_HEADER
diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp
index cfd837da45..59687c709d 100644
--- a/src/gui/image/qicon.cpp
+++ b/src/gui/image/qicon.cpp
@@ -1151,100 +1151,6 @@ QDataStream &operator>>(QDataStream &s, QIcon &icon)
#endif //QT_NO_DATASTREAM
-
-#ifdef QT3_SUPPORT
-
-static int widths[2] = { 22, 32 };
-static int heights[2] = { 22, 32 };
-
-static QSize pixmapSizeHelper(QIcon::Size which)
-{
- int i = 0;
- if (which == QIcon::Large)
- i = 1;
- return QSize(widths[i], heights[i]);
-}
-
-/*!
- \enum QIcon::Size
- \compat
-
- \value Small Use QStyle::pixelMetric(QStyle::PM_SmallIconSize) instead.
- \value Large Use QStyle::pixelMetric(QStyle::PM_LargeIconSize) instead.
- \value Automatic N/A.
-*/
-
-/*!
- Use pixmap(QSize(...), \a mode, \a state), where the first
- argument is an appropriate QSize instead of a \l Size value.
-
- \sa pixmapSize()
-*/
-QPixmap QIcon::pixmap(Size size, Mode mode, State state) const
-{ return pixmap(pixmapSizeHelper(size), mode, state); }
-
-/*!
- Use pixmap(QSize(...), mode, \a state), where the first argument
- is an appropriate QSize instead of a \l Size value, and the
- second argument is QIcon::Normal or QIcon::Disabled, depending on
- the value of \a enabled.
-
- \sa pixmapSize()
-*/
-QPixmap QIcon::pixmap(Size size, bool enabled, State state) const
-{ return pixmap(pixmapSizeHelper(size), enabled ? Normal : Disabled, state); }
-
-/*!
- Use one of the other pixmap() overloads.
-*/
-QPixmap QIcon::pixmap() const
-{ return pixmap(pixmapSizeHelper(Small), Normal, Off); }
-
-/*!
- The pixmap() function now takes a QSize instead of a QIcon::Size,
- so there is no need for this function in new code.
-*/
-void QIcon::setPixmapSize(Size which, const QSize &size)
-{
- int i = 0;
- if (which == Large)
- i = 1;
- widths[i] = size.width();
- heights[i] = size.height();
-}
-
-/*!
- Use QStyle::pixelMetric() with QStyle::PM_SmallIconSize or
- QStyle::PM_LargeIconSize as the first argument, depending on \a
- which.
-*/
-QSize QIcon::pixmapSize(Size which)
-{
- return pixmapSizeHelper(which);
-}
-
-/*!
- \fn void QIcon::reset(const QPixmap &pixmap, Size size)
-
- Use the constructor that takes a QPixmap and operator=().
-*/
-
-/*!
- \fn void QIcon::setPixmap(const QPixmap &pixmap, Size size, Mode mode, State state)
-
- Use addPixmap(\a pixmap, \a mode, \a state) instead. The \a size
- parameter is ignored.
-*/
-
-/*!
- \fn void QIcon::setPixmap(const QString &fileName, Size size, Mode mode, State state)
-
- Use addFile(\a fileName, \a mode, \a state) instead. The \a size
- parameter is ignored.
-*/
-
-#endif // QT3_SUPPORT
-
/*!
\fn DataPtr &QIcon::data_ptr()
\internal
diff --git a/src/gui/image/qicon.h b/src/gui/image/qicon.h
index 170559182b..4e3960925e 100644
--- a/src/gui/image/qicon.h
+++ b/src/gui/image/qicon.h
@@ -114,21 +114,6 @@ public:
static QString themeName();
static void setThemeName(const QString &path);
-
-#ifdef QT3_SUPPORT
- enum Size { Small, Large, Automatic = Small };
- static QT3_SUPPORT void setPixmapSize(Size which, const QSize &size);
- static QT3_SUPPORT QSize pixmapSize(Size which);
- inline QT3_SUPPORT void reset(const QPixmap &pixmap, Size /*size*/) { *this = QIcon(pixmap); }
- inline QT3_SUPPORT void setPixmap(const QPixmap &pixmap, Size, Mode mode = Normal, State state = Off)
- { addPixmap(pixmap, mode, state); }
- inline QT3_SUPPORT void setPixmap(const QString &fileName, Size, Mode mode = Normal, State state = Off)
- { addPixmap(QPixmap(fileName), mode, state); }
- QT3_SUPPORT QPixmap pixmap(Size size, Mode mode, State state = Off) const;
- QT3_SUPPORT QPixmap pixmap(Size size, bool enabled, State state = Off) const;
- QT3_SUPPORT QPixmap pixmap() const;
-#endif
-
Q_DUMMY_COMPARISON_OPERATOR(QIcon)
private:
@@ -151,10 +136,6 @@ Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QIcon &);
Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QIcon &);
#endif
-#ifdef QT3_SUPPORT
-typedef QIcon QIconSet;
-#endif
-
QT_END_NAMESPACE
QT_END_HEADER
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index 50b372ea63..448e1b4be0 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -124,9 +124,6 @@ QBasicAtomicInt qimage_serial_number = Q_BASIC_ATOMIC_INITIALIZER(1);
QImageData::QImageData()
: ref(0), width(0), height(0), depth(0), nbytes(0), data(0),
-#ifdef QT3_SUPPORT
- jumptable(0),
-#endif
format(QImage::Format_ARGB32), bytes_per_line(0),
ser_no(qimage_serial_number.fetchAndAddRelaxed(1)),
detach_no(0),
@@ -220,11 +217,6 @@ QImageData::~QImageData()
delete paintEngine;
if (data && own_data)
free(data);
-#ifdef QT3_SUPPORT
- if (jumptable)
- free(jumptable);
- jumptable = 0;
-#endif
data = 0;
}
@@ -757,27 +749,6 @@ const uchar *qt_get_bitflip_array() // called from QPixma
return bitflip;
}
-#if defined(QT3_SUPPORT)
-static QImage::Format formatFor(int depth, QImage::Endian bitOrder)
-{
- QImage::Format format;
- if (depth == 1) {
- format = bitOrder == QImage::BigEndian ? QImage::Format_Mono : QImage::Format_MonoLSB;
- } else if (depth == 8) {
- format = QImage::Format_Indexed8;
- } else if (depth == 32) {
- format = QImage::Format_RGB32;
- } else if (depth == 24) {
- format = QImage::Format_RGB888;
- } else if (depth == 16) {
- format = QImage::Format_RGB16;
- } else {
- qWarning("QImage: Depth %d not supported", depth);
- format = QImage::Format_Invalid;
- }
- return format;
-}
-#endif
/*!
Constructs a null image.
@@ -991,42 +962,6 @@ QImage::QImage(const QString &fileName, const char *format)
load(fileName, format);
}
-/*!
- Constructs an image and tries to load the image from the file with
- the given \a fileName.
-
- The loader attempts to read the image using the specified \a
- format. If the \a format is not specified (which is the default),
- the loader probes the file for a header to guess the file format.
-
- If the loading of the image failed, this object is a null image.
-
- The file name can either refer to an actual file on disk or to one
- of the application's embedded resources. See the
- \l{resources.html}{Resource System} overview for details on how to
- embed images and other resource files in the application's
- executable.
-
- You can disable this constructor by defining \c
- QT_NO_CAST_FROM_ASCII when you compile your applications. This can
- be useful, for example, if you want to ensure that all
- user-visible strings go through QObject::tr().
-
- \sa QString::fromAscii(), isNull(), {QImage#Reading and Writing
- Image Files}{Reading and Writing Image Files}
-*/
-#ifndef QT_NO_CAST_FROM_ASCII
-QImage::QImage(const char *fileName, const char *format)
- : QPaintDevice()
-{
- // ### Qt 5: if you remove the QImage(const QByteArray &) QT3_SUPPORT
- // constructor, remove this constructor as well. The constructor here
- // exists so that QImage("foo.png") compiles without ambiguity.
- d = 0;
- load(QString::fromAscii(fileName), format);
-}
-#endif
-
#ifndef QT_NO_IMAGEFORMAT_XPM
extern bool qt_read_xpm_image_or_array(QIODevice *device, const char * const *source, QImage &image);
@@ -1097,178 +1032,6 @@ QImage::QImage(const QImage &image)
}
}
-#ifdef QT3_SUPPORT
-/*!
- \fn QImage::QImage(int width, int height, int depth, int numColors, Endian bitOrder)
-
- Constructs an image with the given \a width, \a height, \a depth,
- \a numColors colors and \a bitOrder.
-
- Use the constructor that accepts a width, a height and a format
- (i.e. specifying the depth and bit order), in combination with the
- setColorCount() function, instead.
-
- \oldcode
- QImage image(width, height, depth, numColors);
- \newcode
- QImage image(width, height, format);
-
- // For 8 bit images the default number of colors is 256. If
- // another number of colors is required it can be specified
- // using the setColorCount() function.
- image.setColorCount(numColors);
- \endcode
-*/
-
-QImage::QImage(int w, int h, int depth, int colorCount, Endian bitOrder)
- : QPaintDevice()
-{
- d = QImageData::create(QSize(w, h), formatFor(depth, bitOrder), colorCount);
-}
-
-/*!
- Constructs an image with the given \a size, \a depth, \a numColors
- and \a bitOrder.
-
- Use the constructor that accepts a size and a format
- (i.e. specifying the depth and bit order), in combination with the
- setColorCount() function, instead.
-
- \oldcode
- QSize mySize(width, height);
- QImage image(mySize, depth, numColors);
- \newcode
- QSize mySize(width, height);
- QImage image(mySize, format);
-
- // For 8 bit images the default number of colors is 256. If
- // another number of colors is required it can be specified
- // using the setColorCount() function.
- image.setColorCount(numColors);
- \endcode
-*/
-QImage::QImage(const QSize& size, int depth, int numColors, Endian bitOrder)
- : QPaintDevice()
-{
- d = QImageData::create(size, formatFor(depth, bitOrder), numColors);
-}
-
-/*!
- \fn QImage::QImage(uchar* data, int width, int height, int depth, const QRgb* colortable, int numColors, Endian bitOrder)
-
- Constructs an image with the given \a width, \a height, depth, \a
- colortable, \a numColors and \a bitOrder, that uses an existing
- memory buffer, \a data.
-
- Use the constructor that accepts a uchar pointer, a width, a
- height and a format (i.e. specifying the depth and bit order), in
- combination with the setColorTable() function, instead.
-
- \oldcode
- uchar *myData;
- QRgb *myColorTable;
-
- QImage image(myData, width, height, depth,
- myColorTable, numColors, IgnoreEndian);
- \newcode
- uchar *myData;
- QVector<QRgb> myColorTable;
-
- QImage image(myData, width, height, format);
- image.setColorTable(myColorTable);
- \endcode
-*/
-QImage::QImage(uchar* data, int w, int h, int depth, const QRgb* colortable, int numColors, Endian bitOrder)
- : QPaintDevice()
-{
- d = 0;
- Format f = formatFor(depth, bitOrder);
- if (f == Format_Invalid)
- return;
-
- const int bytes_per_line = ((w*depth+31)/32)*4; // bytes per scanline
- if (w <= 0 || h <= 0 || numColors < 0 || !data
- || INT_MAX/sizeof(uchar *) < uint(h)
- || INT_MAX/uint(depth) < uint(w)
- || bytes_per_line <= 0
- || INT_MAX/uint(bytes_per_line) < uint(h))
- return; // invalid parameter(s)
- d = new QImageData;
- d->ref.ref();
-
- d->own_data = false;
- d->data = data;
- d->width = w;
- d->height = h;
- d->depth = depth;
- d->format = f;
- if (depth == 32)
- numColors = 0;
-
- d->bytes_per_line = bytes_per_line;
- d->nbytes = d->bytes_per_line * h;
- if (colortable) {
- d->colortable.resize(numColors);
- for (int i = 0; i < numColors; ++i)
- d->colortable[i] = colortable[i];
- } else if (numColors) {
- setColorCount(numColors);
- }
-}
-
-#ifdef Q_WS_QWS
-
-/*!
- \fn QImage::QImage(uchar* data, int width, int height, int depth, int bytesPerLine, const QRgb* colortable, int numColors, Endian bitOrder)
-
- Constructs an image with the given \a width, \a height, \a depth,
- \a bytesPerLine, \a colortable, \a numColors and \a bitOrder, that
- uses an existing memory buffer, \a data. The image does not delete
- the buffer at destruction.
-
- \warning This constructor is only available in Qt for Embedded Linux.
-
- The data has to be 32-bit aligned, and each scanline of data in the image
- must also be 32-bit aligned, so it's no longer possible to specify a custom
- \a bytesPerLine value.
-*/
-QImage::QImage(uchar* data, int w, int h, int depth, int bpl, const QRgb* colortable, int numColors, Endian bitOrder)
- : QPaintDevice()
-{
- d = 0;
- Format f = formatFor(depth, bitOrder);
- if (f == Format_Invalid)
- return;
- if (!data || w <= 0 || h <= 0 || depth <= 0 || numColors < 0
- || INT_MAX/sizeof(uchar *) < uint(h)
- || INT_MAX/uint(depth) < uint(w)
- || bpl <= 0
- || INT_MAX/uint(bpl) < uint(h))
- return; // invalid parameter(s)
-
- d = new QImageData;
- d->ref.ref();
- d->own_data = false;
- d->data = data;
- d->width = w;
- d->height = h;
- d->depth = depth;
- d->format = f;
- if (depth == 32)
- numColors = 0;
- d->bytes_per_line = bpl;
- d->nbytes = d->bytes_per_line * h;
- if (colortable) {
- d->colortable.resize(numColors);
- for (int i = 0; i < numColors; ++i)
- d->colortable[i] = colortable[i];
- } else if (numColors) {
- setColorCount(numColors);
- }
-}
-#endif // Q_WS_QWS
-#endif // QT3_SUPPORT
-
/*!
Destroys the image and cleans up.
*/
@@ -1613,75 +1376,6 @@ int QImage::colorCount() const
return d ? d->colortable.size() : 0;
}
-
-#ifdef QT3_SUPPORT
-/*!
- \fn QImage::Endian QImage::bitOrder() const
-
- Returns the bit order for the image. If it is a 1-bpp image, this
- function returns either QImage::BigEndian or
- QImage::LittleEndian. Otherwise, this function returns
- QImage::IgnoreEndian.
-
- Use the format() function instead for the monochrome formats. For
- non-monochrome formats the bit order is irrelevant.
-*/
-
-/*!
- Returns a pointer to the scanline pointer table. This is the
- beginning of the data block for the image.
- Returns 0 in case of an error.
-
- Use the bits() or scanLine() function instead.
-*/
-uchar **QImage::jumpTable()
-{
- if (!d)
- return 0;
- detach();
-
- // in case detach() ran out of memory..
- if (!d)
- return 0;
-
- if (!d->jumptable) {
- d->jumptable = (uchar **)malloc(d->height*sizeof(uchar *));
- if (!d->jumptable)
- return 0;
- uchar *data = d->data;
- int height = d->height;
- uchar **p = d->jumptable;
- while (height--) {
- *p++ = data;
- data += d->bytes_per_line;
- }
- }
- return d->jumptable;
-}
-
-/*!
- \overload
-*/
-const uchar * const *QImage::jumpTable() const
-{
- if (!d)
- return 0;
- if (!d->jumptable) {
- d->jumptable = (uchar **)malloc(d->height*sizeof(uchar *));
- if (!d->jumptable)
- return 0;
- uchar *data = d->data;
- int height = d->height;
- uchar **p = d->jumptable;
- while (height--) {
- *p++ = data;
- data += d->bytes_per_line;
- }
- }
- return d->jumptable;
-}
-#endif
-
/*!
Sets the color table used to translate color indexes to QRgb
values, to the specified \a colors.
@@ -2223,116 +1917,6 @@ QImage::Format QImage::format() const
}
-#ifdef QT3_SUPPORT
-/*!
- Returns true if alpha buffer mode is enabled; otherwise returns
- false.
-
- Use the hasAlphaChannel() function instead.
-
-*/
-bool QImage::hasAlphaBuffer() const
-{
- if (!d)
- return false;
-
- switch (d->format) {
- case Format_ARGB32:
- case Format_ARGB32_Premultiplied:
- case Format_ARGB8565_Premultiplied:
- case Format_ARGB8555_Premultiplied:
- case Format_ARGB6666_Premultiplied:
- case Format_ARGB4444_Premultiplied:
- return true;
- default:
- return false;
- }
-}
-
-/*!
- Enables alpha buffer mode if \a enable is true, otherwise disables
- it. The alpha buffer is used to set a mask when a QImage is
- translated to a QPixmap.
-
- If a monochrome or indexed 8-bit image has alpha channels in their
- color tables they will automatically detect that they have an
- alpha channel, so this function is not required. To force alpha
- channels on 32-bit images, use the convertToFormat() function.
-*/
-
-void QImage::setAlphaBuffer(bool enable)
-{
- if (!d
- || d->format == Format_Mono
- || d->format == Format_MonoLSB
- || d->format == Format_Indexed8)
- return;
- if (enable && (d->format == Format_ARGB32 ||
- d->format == Format_ARGB32_Premultiplied ||
- d->format == Format_ARGB8565_Premultiplied ||
- d->format == Format_ARGB6666_Premultiplied ||
- d->format == Format_ARGB8555_Premultiplied ||
- d->format == Format_ARGB4444_Premultiplied))
- {
- return;
- }
- if (!enable && (d->format == Format_RGB32 ||
- d->format == Format_RGB555 ||
- d->format == Format_RGB666 ||
- d->format == Format_RGB888 ||
- d->format == Format_RGB444))
- {
- return;
- }
- detach();
- d->format = (enable ? Format_ARGB32 : Format_RGB32);
-}
-
-
-/*!
- \fn bool QImage::create(int width, int height, int depth, int numColors, Endian bitOrder)
-
- Sets the image \a width, \a height, \a depth, its number of colors
- (in \a numColors), and bit order. Returns true if successful, or
- false if the parameters are incorrect or if memory cannot be
- allocated.
-
- The \a width and \a height is limited to 32767. \a depth must be
- 1, 8, or 32. If \a depth is 1, \a bitOrder must be set to
- either QImage::LittleEndian or QImage::BigEndian. For other depths
- \a bitOrder must be QImage::IgnoreEndian.
-
- This function allocates a color table and a buffer for the image
- data. The image data is not initialized. The image buffer is
- allocated as a single block that consists of a table of scanLine()
- pointers (jumpTable()) and the image data (bits()).
-
- Use a QImage constructor instead.
-*/
-bool QImage::create(int width, int height, int depth, int numColors, Endian bitOrder)
-{
- if (d && !d->ref.deref())
- delete d;
- d = QImageData::create(QSize(width, height), formatFor(depth, bitOrder), numColors);
- return true;
-}
-
-/*!
- \fn bool QImage::create(const QSize& size, int depth, int numColors, Endian bitOrder)
- \overload
-
- The width and height are specified in the \a size argument.
-
- Use a QImage constructor instead.
-*/
-bool QImage::create(const QSize& size, int depth, int numColors, QImage::Endian bitOrder)
-{
- if (d && !d->ref.deref())
- delete d;
- d = QImageData::create(size, formatFor(depth, bitOrder), numColors);
- return true;
-}
-#endif // QT3_SUPPORT
/*****************************************************************************
Internal routines for converting image depth.
@@ -4022,30 +3606,6 @@ QImage QImage::convertToFormat(Format format, const QVector<QRgb> &colorTable, Q
return image;
}
-#ifdef QT3_SUPPORT
-/*!
- Converts the depth (bpp) of the image to the given \a depth and
- returns the converted image. The original image is not changed.
- Returns this image if \a depth is equal to the image depth, or a
- null image if this image cannot be converted. The \a depth
- argument must be 1, 8 or 32. If the image needs to be modified to
- fit in a lower-resolution result (e.g. converting from 32-bit to
- 8-bit), use the \a flags to specify how you'd prefer this to
- happen.
-
- Use the convertToFormat() function instead.
-*/
-
-QImage QImage::convertDepth(int depth, Qt::ImageConversionFlags flags) const
-{
- if (!d || d->depth == depth)
- return *this;
-
- Format format = formatFor (depth, QImage::LittleEndian);
- return convertToFormat(format, flags);
-}
-#endif
-
/*!
\fn bool QImage::valid(const QPoint &pos) const
@@ -4264,41 +3824,6 @@ void QImage::setPixel(int x, int y, uint index_or_rgb)
}
}
-#ifdef QT3_SUPPORT
-/*!
- Converts the bit order of the image to the given \a bitOrder and
- returns the converted image. The original image is not changed.
- Returns this image if the given \a bitOrder is equal to the image
- current bit order, or a null image if this image cannot be
- converted.
-
- Use convertToFormat() instead.
-*/
-
-QImage QImage::convertBitOrder(Endian bitOrder) const
-{
- if (!d || isNull() || d->depth != 1 || !(bitOrder == BigEndian || bitOrder == LittleEndian))
- return QImage();
-
- if ((d->format == Format_Mono && bitOrder == BigEndian)
- || (d->format == Format_MonoLSB && bitOrder == LittleEndian))
- return *this;
-
- QImage image(d->width, d->height, d->format == Format_Mono ? Format_MonoLSB : Format_Mono);
-
- const uchar *data = d->data;
- const uchar *end = data + d->nbytes;
- uchar *ndata = image.d->data;
- while (data < end)
- *ndata++ = bitflip[*data++];
-
- image.setDotsPerMeterX(dotsPerMeterX());
- image.setDotsPerMeterY(dotsPerMeterY());
-
- image.d->colortable = d->colortable;
- return image;
-}
-#endif
/*!
Returns true if all the colors in the image are shades of gray
(i.e. their red, green and blue components are equal); otherwise
@@ -5283,66 +4808,6 @@ QDataStream &operator>>(QDataStream &s, QImage &image)
#endif // QT_NO_DATASTREAM
-#ifdef QT3_SUPPORT
-/*!
- \fn QImage QImage::convertDepthWithPalette(int depth, QRgb* palette, int palette_count, Qt::ImageConversionFlags flags) const
-
- Returns an image with the given \a depth, using the \a
- palette_count colors pointed to by \a palette. If \a depth is 1 or
- 8, the returned image will have its color table ordered in the
- same way as \a palette.
-
- If the image needs to be modified to fit in a lower-resolution
- result (e.g. converting from 32-bit to 8-bit), use the \a flags to
- specify how you'd prefer this to happen.
-
- Note: currently no closest-color search is made. If colors are
- found that are not in the palette, the palette may not be used at
- all. This result should not be considered valid because it may
- change in future implementations.
-
- Currently inefficient for non-32-bit images.
-
- Use the convertToFormat() function in combination with the
- setColorTable() function instead.
-*/
-QImage QImage::convertDepthWithPalette(int d, QRgb* palette, int palette_count, Qt::ImageConversionFlags flags) const
-{
- Format f = formatFor(d, QImage::LittleEndian);
- QVector<QRgb> colortable;
- for (int i = 0; i < palette_count; ++i)
- colortable.append(palette[i]);
- return convertToFormat(f, colortable, flags);
-}
-
-/*!
- \relates QImage
-
- Copies a block of pixels from \a src to \a dst. The pixels
- copied from source (src) are converted according to
- \a flags if it is incompatible with the destination
- (\a dst).
-
- \a sx, \a sy is the top-left pixel in \a src, \a dx, \a dy is the
- top-left position in \a dst and \a sw, \a sh is the size of the
- copied block. The copying is clipped if areas outside \a src or \a
- dst are specified. If \a sw is -1, it is adjusted to
- src->width(). Similarly, if \a sh is -1, it is adjusted to
- src->height().
-
- Currently inefficient for non 32-bit images.
-
- Use copy() or QPainter::drawImage() instead.
-*/
-void bitBlt(QImage *dst, int dx, int dy, const QImage *src, int sx, int sy, int sw, int sh,
- Qt::ImageConversionFlags flags)
-{
- if (dst->isNull() || src->isNull())
- return;
- QPainter p(dst);
- p.drawImage(QPoint(dx, dy), *src, QRect(sx, sy, sw, sh), flags);
-}
-#endif
/*!
\fn bool QImage::operator==(const QImage & image) const
@@ -6322,24 +5787,6 @@ int QImage::bitPlaneCount() const
return bpc;
}
-
-#ifdef QT3_SUPPORT
-#if defined(Q_WS_X11)
-QT_BEGIN_INCLUDE_NAMESPACE
-#include <private/qt_x11_p.h>
-QT_END_INCLUDE_NAMESPACE
-#endif
-
-QImage::Endian QImage::systemBitOrder()
-{
-#if defined(Q_WS_X11)
- return BitmapBitOrder(X11->display) == MSBFirst ? BigEndian : LittleEndian;
-#else
- return BigEndian;
-#endif
-}
-#endif
-
/*!
\fn QImage QImage::copy(const QRect &rect, Qt::ImageConversionFlags flags) const
\compat
diff --git a/src/gui/image/qimage.h b/src/gui/image/qimage.h
index 496fe93c54..849f731f5e 100644
--- a/src/gui/image/qimage.h
+++ b/src/gui/image/qimage.h
@@ -283,50 +283,6 @@ public:
void setText(const char* key, const char* lang, const QString&);
#endif
-#ifdef QT3_SUPPORT
- enum Endian { BigEndian, LittleEndian, IgnoreEndian };
- QT3_SUPPORT_CONSTRUCTOR QImage(int width, int height, int depth, int numColors=0, Endian bitOrder=IgnoreEndian);
- QT3_SUPPORT_CONSTRUCTOR QImage(const QSize&, int depth, int numColors=0, Endian bitOrder=IgnoreEndian);
- QT3_SUPPORT_CONSTRUCTOR QImage(uchar *data, int w, int h, int depth, const QRgb *colortable, int numColors, Endian bitOrder);
-#ifdef Q_WS_QWS
- QT3_SUPPORT_CONSTRUCTOR QImage(uchar *data, int w, int h, int depth, int pbl, const QRgb *colortable, int numColors, Endian bitOrder);
-#endif
- inline QT3_SUPPORT Endian bitOrder() const {
- Format f = format();
- return f == Format_Mono ? BigEndian : (f == Format_MonoLSB ? LittleEndian : IgnoreEndian);
- }
- QT3_SUPPORT QImage convertDepth(int, Qt::ImageConversionFlags flags = Qt::AutoColor) const;
- QT3_SUPPORT QImage convertDepthWithPalette(int, QRgb* p, int pc, Qt::ImageConversionFlags flags = Qt::AutoColor) const;
- QT3_SUPPORT QImage convertBitOrder(Endian) const;
- QT3_SUPPORT bool hasAlphaBuffer() const;
- QT3_SUPPORT void setAlphaBuffer(bool);
- QT3_SUPPORT uchar **jumpTable();
- QT3_SUPPORT const uchar * const *jumpTable() const;
- inline QT3_SUPPORT void reset() { *this = QImage(); }
- static inline QT3_SUPPORT Endian systemByteOrder()
- { return QSysInfo::ByteOrder == QSysInfo::BigEndian ? BigEndian : LittleEndian; }
- inline QT3_SUPPORT QImage swapRGB() const { return rgbSwapped(); }
- inline QT3_SUPPORT QImage mirror(bool horizontally = false, bool vertically = true) const
- { return mirrored(horizontally, vertically); }
- QT3_SUPPORT bool create(const QSize&, int depth, int numColors=0, Endian bitOrder=IgnoreEndian);
- QT3_SUPPORT bool create(int width, int height, int depth, int numColors=0, Endian bitOrder=IgnoreEndian);
- inline QT3_SUPPORT QImage xForm(const QMatrix &matrix) const { return transformed(QTransform(matrix)); }
- inline QT3_SUPPORT QImage smoothScale(int w, int h, Qt::AspectRatioMode mode = Qt::IgnoreAspectRatio) const
- { return scaled(QSize(w, h), mode, Qt::SmoothTransformation); }
- inline QImage QT3_SUPPORT smoothScale(const QSize &s, Qt::AspectRatioMode mode = Qt::IgnoreAspectRatio) const
- { return scaled(s, mode, Qt::SmoothTransformation); }
- inline QT3_SUPPORT QImage scaleWidth(int w) const { return scaledToWidth(w); }
- inline QT3_SUPPORT QImage scaleHeight(int h) const { return scaledToHeight(h); }
- inline QT3_SUPPORT void invertPixels(bool invertAlpha) { invertAlpha ? invertPixels(InvertRgba) : invertPixels(InvertRgb); }
- inline QT3_SUPPORT QImage copy(int x, int y, int w, int h, Qt::ImageConversionFlags) const
- { return copy(QRect(x, y, w, h)); }
- inline QT3_SUPPORT QImage copy(const QRect &rect, Qt::ImageConversionFlags) const
- { return copy(rect); }
- static QT3_SUPPORT Endian systemBitOrder();
- inline QT3_SUPPORT_CONSTRUCTOR QImage(const QByteArray &data)
- { d = 0; *this = QImage::fromData(data); }
-#endif
-
protected:
virtual int metric(PaintDeviceMetric metric) const;
@@ -362,11 +318,6 @@ Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QImage &);
Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QImage &);
#endif
-#ifdef QT3_SUPPORT
-Q_GUI_EXPORT QT3_SUPPORT void bitBlt(QImage* dst, int dx, int dy, const QImage* src,
- int sx=0, int sy=0, int sw=-1, int sh=-1, Qt::ImageConversionFlags flags = Qt::AutoColor);
-#endif
-
QT_END_NAMESPACE
QT_END_HEADER
diff --git a/src/gui/image/qimage_p.h b/src/gui/image/qimage_p.h
index db6620b39c..93ab8a78ba 100644
--- a/src/gui/image/qimage_p.h
+++ b/src/gui/image/qimage_p.h
@@ -79,9 +79,6 @@ struct Q_GUI_EXPORT QImageData { // internal image data
int nbytes; // number of bytes data
QVector<QRgb> colortable;
uchar *data;
-#ifdef QT3_SUPPORT
- uchar **jumptable;
-#endif
QImage::Format format;
int bytes_per_line;
int ser_no; // serial number
diff --git a/src/gui/image/qmovie.h b/src/gui/image/qmovie.h
index b64df29c41..98fcf68ee6 100644
--- a/src/gui/image/qmovie.h
+++ b/src/gui/image/qmovie.h
@@ -51,11 +51,6 @@
#include <QtCore/qobject.h>
#include <QtGui/qimagereader.h>
-#ifdef QT3_SUPPORT
-#include <QtGui/qimage.h>
-#include <QtGui/qpixmap.h>
-#endif
-
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
@@ -151,21 +146,6 @@ public Q_SLOTS:
private:
Q_DISABLE_COPY(QMovie)
Q_PRIVATE_SLOT(d_func(), void _q_loadNextFrame())
-
-#ifdef QT3_SUPPORT
-public:
- inline QT3_SUPPORT bool isNull() const { return isValid(); }
- inline QT3_SUPPORT int frameNumber() const { return currentFrameNumber(); }
- inline QT3_SUPPORT bool running() const { return state() == Running; }
- inline QT3_SUPPORT bool paused() const { return state() == Paused; }
- inline QT3_SUPPORT bool finished() const { return state() == NotRunning; }
- inline QT3_SUPPORT void restart() { stop(); start(); }
- inline QT3_SUPPORT QImage frameImage() const { return currentImage(); }
- inline QT3_SUPPORT QPixmap framePixmap() const { return currentPixmap(); }
- inline QT3_SUPPORT void step() { jumpToNextFrame(); }
- inline QT3_SUPPORT void pause() { setPaused(true); }
- inline QT3_SUPPORT void unpause() { setPaused(false); }
-#endif
};
QT_END_NAMESPACE
diff --git a/src/gui/image/qpicture.h b/src/gui/image/qpicture.h
index c478ed962e..3bcd87e5a0 100644
--- a/src/gui/image/qpicture.h
+++ b/src/gui/image/qpicture.h
@@ -104,9 +104,6 @@ protected:
QPicture(QPicturePrivate &data);
int metric(PaintDeviceMetric m) const;
-#ifdef QT3_SUPPORT
- inline QT3_SUPPORT QPicture copy() const { QPicture p(*this); p.detach(); return p; }
-#endif
private:
bool exec(QPainter *p, QDataStream &ds, int i);
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index aee1f2bc03..a9f2353dd4 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -640,65 +640,6 @@ int QPixmap::depth() const
pixmap = pixmap.copy(QRect(QPoint(0, 0), size));
\endcode
*/
-#ifdef QT3_SUPPORT
-void QPixmap::resize_helper(const QSize &s)
-{
- int w = s.width();
- int h = s.height();
- if (w < 1 || h < 1) {
- *this = QPixmap();
- return;
- }
-
- if (size() == s)
- return;
-
- // QPixmap.data member may be QRuntimePixmapData so use pixmapData() function to get
- // the actual underlaying runtime pixmap data.
- QPixmapData *pd = pixmapData();
-
- // Create new pixmap
- QPixmap pm(QSize(w, h), pd ? pd->type : QPixmapData::PixmapType);
- bool uninit = false;
-#if defined(Q_WS_X11)
- QX11PixmapData *x11Data = pd && pd->classId() == QPixmapData::X11Class ? static_cast<QX11PixmapData*>(pd) : 0;
- if (x11Data) {
- pm.x11SetScreen(x11Data->xinfo.screen());
- uninit = x11Data->flags & QX11PixmapData::Uninitialized;
- }
-#elif defined(Q_WS_MAC)
- QMacPixmapData *macData = pd && pd->classId() == QPixmapData::MacClass ? static_cast<QMacPixmapData*>(pd) : 0;
- if (macData)
- uninit = macData->uninit;
-#endif
- if (!uninit && !isNull()) {
- // Copy old pixmap
- if (hasAlphaChannel())
- pm.fill(Qt::transparent);
- QPainter p(&pm);
- p.drawPixmap(0, 0, *this, 0, 0, qMin(width(), w), qMin(height(), h));
- }
-
-#if defined(Q_WS_X11)
- if (x11Data && x11Data->x11_mask) {
- QPixmapData *newPd = pm.pixmapData();
- QX11PixmapData *pmData = (newPd && newPd->classId() == QPixmapData::X11Class)
- ? static_cast<QX11PixmapData*>(newPd) : 0;
- if (pmData) {
- pmData->x11_mask = (Qt::HANDLE)XCreatePixmap(X11->display,
- RootWindow(x11Data->xinfo.display(),
- x11Data->xinfo.screen()),
- w, h, 1);
- GC gc = XCreateGC(X11->display, pmData->x11_mask, 0, 0);
- XCopyArea(X11->display, x11Data->x11_mask, pmData->x11_mask, gc, 0, 0,
- qMin(width(), w), qMin(height(), h), 0, 0);
- XFreeGC(X11->display, gc);
- }
- }
-#endif
- *this = pm;
-}
-#endif
/*!
\fn void QPixmap::resize(int width, int height)
@@ -1226,104 +1167,6 @@ Qt::HANDLE QPixmap::handle() const
#endif
-#ifdef QT3_SUPPORT
-static Qt::ImageConversionFlags colorModeToFlags(QPixmap::ColorMode mode)
-{
- Qt::ImageConversionFlags flags = Qt::AutoColor;
- switch (mode) {
- case QPixmap::Color:
- flags |= Qt::ColorOnly;
- break;
- case QPixmap::Mono:
- flags |= Qt::MonoOnly;
- break;
- default:
- break;// Nothing.
- }
- return flags;
-}
-
-/*!
- Use the constructor that takes a Qt::ImageConversionFlag instead.
-*/
-
-QPixmap::QPixmap(const QString& fileName, const char *format, ColorMode mode)
- : QPaintDevice()
-{
- init(0, 0, QPixmapData::PixmapType);
- if (!qt_pixmap_thread_test())
- return;
-
- load(fileName, format, colorModeToFlags(mode));
-}
-
-/*!
- Constructs a pixmap from the QImage \a image.
-
- Use the static fromImage() function instead.
-*/
-QPixmap::QPixmap(const QImage& image)
- : QPaintDevice()
-{
- init(0, 0, QPixmapData::PixmapType);
- if (!qt_pixmap_thread_test())
- return;
-
- if (data && data->pixelType() == QPixmapData::BitmapType)
- *this = QBitmap::fromImage(image);
- else
- *this = fromImage(image);
-}
-
-/*!
- \overload
-
- Converts the given \a image to a pixmap that is assigned to this
- pixmap.
-
- Use the static fromImage() function instead.
-*/
-
-QPixmap &QPixmap::operator=(const QImage &image)
-{
- if (data && data->pixelType() == QPixmapData::BitmapType)
- *this = QBitmap::fromImage(image);
- else
- *this = fromImage(image);
- return *this;
-}
-
-/*!
- Use the load() function that takes a Qt::ImageConversionFlag instead.
-*/
-
-bool QPixmap::load(const QString &fileName, const char *format, ColorMode mode)
-{
- return load(fileName, format, colorModeToFlags(mode));
-}
-
-/*!
- Use the loadFromData() function that takes a Qt::ImageConversionFlag instead.
-*/
-
-bool QPixmap::loadFromData(const uchar *buf, uint len, const char *format, ColorMode mode)
-{
- return loadFromData(buf, len, format, colorModeToFlags(mode));
-}
-
-/*!
- Use the static fromImage() function instead.
-*/
-bool QPixmap::convertFromImage(const QImage &image, ColorMode mode)
-{
- if (data && data->pixelType() == QPixmapData::BitmapType)
- *this = QBitmap::fromImage(image, colorModeToFlags(mode));
- else
- *this = fromImage(image, colorModeToFlags(mode));
- return !isNull();
-}
-
-#endif
/*****************************************************************************
QPixmap stream functions
@@ -1369,34 +1212,6 @@ QDataStream &operator>>(QDataStream &stream, QPixmap &pixmap)
#endif // QT_NO_DATASTREAM
-#ifdef QT3_SUPPORT
-Q_GUI_EXPORT void copyBlt(QPixmap *dst, int dx, int dy,
- const QPixmap *src, int sx, int sy, int sw, int sh)
-{
- Q_ASSERT_X(dst, "::copyBlt", "Destination pixmap must be non-null");
- Q_ASSERT_X(src, "::copyBlt", "Source pixmap must be non-null");
-
- if (src->hasAlphaChannel()) {
- if (dst->paintEngine()->hasFeature(QPaintEngine::PorterDuff)) {
- QPainter p(dst);
- p.setCompositionMode(QPainter::CompositionMode_Source);
- p.drawPixmap(dx, dy, *src, sx, sy, sw, sh);
- } else {
- QImage image = dst->toImage().convertToFormat(QImage::Format_ARGB32_Premultiplied);
- QPainter p(&image);
- p.setCompositionMode(QPainter::CompositionMode_Source);
- p.drawPixmap(dx, dy, *src, sx, sy, sw, sh);
- p.end();
- *dst = QPixmap::fromImage(image);
- }
- } else {
- QPainter p(dst);
- p.drawPixmap(dx, dy, *src, sx, sy, sw, sh);
- }
-
-}
-#endif
-
/*!
\internal
*/
diff --git a/src/gui/image/qpixmap.h b/src/gui/image/qpixmap.h
index f2e79c14f4..77f06b060b 100644
--- a/src/gui/image/qpixmap.h
+++ b/src/gui/image/qpixmap.h
@@ -224,26 +224,6 @@ public:
protected:
int metric(PaintDeviceMetric) const;
-#ifdef QT3_SUPPORT
-public:
- enum ColorMode { Auto, Color, Mono };
- QT3_SUPPORT_CONSTRUCTOR QPixmap(const QString& fileName, const char *format, ColorMode mode);
- QT3_SUPPORT bool load(const QString& fileName, const char *format, ColorMode mode);
- QT3_SUPPORT bool loadFromData(const uchar *buf, uint len, const char* format, ColorMode mode);
- QT3_SUPPORT_CONSTRUCTOR QPixmap(const QImage& image);
- QT3_SUPPORT QPixmap &operator=(const QImage &);
- inline QT3_SUPPORT QImage convertToImage() const { return toImage(); }
- QT3_SUPPORT bool convertFromImage(const QImage &, ColorMode mode);
- inline QT3_SUPPORT operator QImage() const { return toImage(); }
- inline QT3_SUPPORT QPixmap xForm(const QMatrix &matrix) const { return transformed(QTransform(matrix)); }
- inline QT3_SUPPORT bool selfMask() const { return false; }
-private:
- void resize_helper(const QSize &s);
-public:
- inline QT3_SUPPORT void resize(const QSize &s) { resize_helper(s); }
- inline QT3_SUPPORT void resize(int width, int height) { resize_helper(QSize(width, height)); }
-#endif
-
private:
QExplicitlySharedDataPointer<QPixmapData> data;
@@ -320,14 +300,6 @@ Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QPixmap &);
Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QPixmap &);
#endif
-/*****************************************************************************
- QPixmap (and QImage) helper functions
-*****************************************************************************/
-#ifdef QT3_SUPPORT
-QT3_SUPPORT Q_GUI_EXPORT void copyBlt(QPixmap *dst, int dx, int dy, const QPixmap *src,
- int sx=0, int sy=0, int sw=-1, int sh=-1);
-#endif // QT3_SUPPORT
-
QT_END_NAMESPACE
QT_END_HEADER
diff --git a/src/gui/kernel/kernel.pri b/src/gui/kernel/kernel.pri
index ea86977cf6..09ef146597 100644
--- a/src/gui/kernel/kernel.pri
+++ b/src/gui/kernel/kernel.pri
@@ -67,8 +67,8 @@ SOURCES += \
kernel/qlayout.cpp \
kernel/qlayoutengine.cpp \
kernel/qlayoutitem.cpp \
- kernel/qmime.cpp \
- kernel/qpalette.cpp \
+ kernel/qmime.cpp \
+ kernel/qpalette.cpp \
kernel/qshortcut.cpp \
kernel/qshortcutmap.cpp \
kernel/qstackedlayout.cpp \
diff --git a/src/gui/kernel/qcursor.h b/src/gui/kernel/qcursor.h
index c993763634..b47ec04d66 100644
--- a/src/gui/kernel/qcursor.h
+++ b/src/gui/kernel/qcursor.h
@@ -152,18 +152,6 @@ private:
#endif
};
-#ifdef QT3_SUPPORT
-// CursorShape is defined in X11/X.h
-#ifdef CursorShape
-#define X_CursorShape CursorShape
-#undef CursorShape
-#endif
-typedef Qt::CursorShape QCursorShape;
-#ifdef X_CursorShape
-#define CursorShape X_CursorShape
-#endif
-#endif
-
/*****************************************************************************
QCursor stream functions
*****************************************************************************/
diff --git a/src/gui/kernel/qdnd_x11.cpp b/src/gui/kernel/qdnd_x11.cpp
index 1c59d41a94..9ff1543e51 100644
--- a/src/gui/kernel/qdnd_x11.cpp
+++ b/src/gui/kernel/qdnd_x11.cpp
@@ -1350,10 +1350,6 @@ bool QDragManager::eventFilter(QObject * o, QEvent * e)
case QEvent::KeyRelease:
case QEvent::Wheel:
case QEvent::ShortcutOverride:
-#ifdef QT3_SUPPORT
- case QEvent::Accel:
- case QEvent::AccelAvailable:
-#endif
return true;
default:
return false;
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index 277a5e845d..5f0cfd7d69 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -180,36 +180,6 @@ QMouseEvent::~QMouseEvent()
{
}
-#ifdef QT3_SUPPORT
-/*!
- Use QMouseEvent(\a type, \a pos, \a button, \c buttons, \c
- modifiers) instead, where \c buttons is \a state &
- Qt::MouseButtonMask and \c modifiers is \a state &
- Qt::KeyButtonMask.
-*/
-QMouseEvent::QMouseEvent(Type type, const QPoint &pos, Qt::ButtonState button, int state)
- : QInputEvent(type), p(pos), b((Qt::MouseButton)button)
-{
- g = QCursor::pos();
- mouseState = Qt::MouseButtons((state ^ b) & Qt::MouseButtonMask);
- modState = Qt::KeyboardModifiers(state & (int)Qt::KeyButtonMask);
-}
-
-/*!
- Use QMouseEvent(\a type, \a pos, \a globalPos, \a button,
- \c buttons, \c modifiers) instead, where
- \c buttons is \a state & Qt::MouseButtonMask and
- \c modifiers is \a state & Qt::KeyButtonMask.
-*/
-QMouseEvent::QMouseEvent(Type type, const QPoint &pos, const QPoint &globalPos,
- Qt::ButtonState button, int state)
- : QInputEvent(type), p(pos), g(globalPos), b((Qt::MouseButton)button)
-{
- mouseState = Qt::MouseButtons((state ^ b) & Qt::MouseButtonMask);
- modState = Qt::KeyboardModifiers(state & (int)Qt::KeyButtonMask);
-}
-#endif
-
/*!
Constructs a mouse event object.
@@ -557,19 +527,6 @@ QWheelEvent::~QWheelEvent()
{
}
-#ifdef QT3_SUPPORT
-/*!
- Use one of the other constructors instead.
-*/
-QWheelEvent::QWheelEvent(const QPoint &pos, int delta, int state, Qt::Orientation orient)
- : QInputEvent(Wheel), p(pos), d(delta), o(orient)
-{
- g = QCursor::pos();
- mouseState = Qt::MouseButtons(state & Qt::MouseButtonMask);
- modState = Qt::KeyboardModifiers(state & (int)Qt::KeyButtonMask);
-}
-#endif
-
/*!
Constructs a wheel event object.
@@ -587,18 +544,6 @@ QWheelEvent::QWheelEvent(const QPoint &pos, const QPoint& globalPos, int delta,
: QInputEvent(Wheel, modifiers), p(pos), g(globalPos), d(delta), mouseState(buttons), o(orient)
{}
-#ifdef QT3_SUPPORT
-/*!
- Use one of the other constructors instead.
-*/
-QWheelEvent::QWheelEvent(const QPoint &pos, const QPoint& globalPos, int delta, int state,
- Qt::Orientation orient)
- : QInputEvent(Wheel), p(pos), g(globalPos), d(delta), o(orient)
-{
- mouseState = Qt::MouseButtons(state & Qt::MouseButtonMask);
- modState = Qt::KeyboardModifiers(state & (int) Qt::KeyButtonMask);
-}
-#endif
#endif // QT_NO_WHEELEVENT
/*!
@@ -992,34 +937,6 @@ bool QKeyEvent::matches(QKeySequence::StandardKey matchKey) const
\sa Qt::WA_KeyCompression
*/
-#ifdef QT3_SUPPORT
-/*!
- \fn QKeyEvent::QKeyEvent(Type type, int key, int ascii,
- int modifiers, const QString &text,
- bool autorep, ushort count)
-
- Use one of the other constructors instead.
-*/
-
-/*!
- \fn int QKeyEvent::ascii() const
-
- Use text() instead.
-*/
-
-/*!
- \fn Qt::ButtonState QKeyEvent::state() const
-
- Use QInputEvent::modifiers() instead.
-*/
-
-/*!
- \fn Qt::ButtonState QKeyEvent::stateAfter() const
-
- Use modifiers() instead.
-*/
-#endif
-
/*!
\class QFocusEvent
\brief The QFocusEvent class contains event parameters for widget focus
@@ -1090,23 +1007,6 @@ Qt::FocusReason QFocusEvent::reason() const
false.
*/
-#ifdef QT3_SUPPORT
-/*!
- \enum QFocusEvent::Reason
- \compat
-
- Use Qt::FocusReason instead.
-
- \value Mouse Same as Qt::MouseFocusReason.
- \value Tab Same as Qt::TabFocusReason.
- \value Backtab Same as Qt::BacktabFocusReason.
- \value MenuBar Same as Qt::MenuBarFocusReason.
- \value ActiveWindow Same as Qt::ActiveWindowFocusReason
- \value Other Same as Qt::OtherFocusReason
- \value Popup Same as Qt::PopupFocusReason
- \value Shortcut Same as Qt::ShortcutFocusReason
-*/
-#endif
/*!
\class QPaintEvent
@@ -1175,18 +1075,6 @@ QPaintEvent::QPaintEvent(const QRect &paintRect)
{}
-#ifdef QT3_SUPPORT
- /*!
- Constructs a paint event object with both a \a paintRegion and a
- \a paintRect, both of which represent the area of the widget that
- needs to be updated.
-
-*/
-QPaintEvent::QPaintEvent(const QRegion &paintRegion, const QRect &paintRect)
- : QEvent(Paint), m_rect(paintRect), m_region(paintRegion), m_erased(false)
-{}
-#endif
-
/*!
\internal
*/
@@ -1453,17 +1341,6 @@ QContextMenuEvent::QContextMenuEvent(Reason reason, const QPoint &pos, const QPo
: QInputEvent(ContextMenu, modifiers), p(pos), gp(globalPos), reas(reason)
{}
-#ifdef QT3_SUPPORT
-/*!
- Constructs a context menu event with the given \a reason for the
- position specified by \a pos in widget coordinates and \a globalPos
- in global screen coordinates. \a dummy is ignored.
-*/
-QContextMenuEvent::QContextMenuEvent(Reason reason, const QPoint &pos, const QPoint &globalPos,
- int /* dummy */)
- : QInputEvent(ContextMenu), p(pos), gp(globalPos), reas(reason)
-{}
-#endif
/*! \internal */
QContextMenuEvent::~QContextMenuEvent()
@@ -1489,24 +1366,6 @@ QContextMenuEvent::QContextMenuEvent(Reason reason, const QPoint &pos)
gp = QCursor::pos();
}
-#ifdef QT3_SUPPORT
-/*!
- Constructs a context menu event with the given \a reason for the
- position specified by \a pos in widget coordinates. \a dummy is
- ignored.
-*/
-QContextMenuEvent::QContextMenuEvent(Reason reason, const QPoint &pos, int /* dummy */)
- : QInputEvent(ContextMenu), p(pos), reas(reason)
-{
- gp = QCursor::pos();
-}
-
-Qt::ButtonState QContextMenuEvent::state() const
-{
- return Qt::ButtonState(int(QApplication::keyboardModifiers())|QApplication::mouseButtons());
-}
-#endif
-
/*!
\fn const QPoint &QContextMenuEvent::pos() const
@@ -2538,37 +2397,6 @@ void QDropEvent::setDropAction(Qt::DropAction action)
\sa setDropAction(), proposedAction(), {QEvent::accept()}{accept()}
*/
-#ifdef QT3_SUPPORT
-/*!
- Use dropAction() instead.
-
- The table below shows the correspondance between the return type
- of action() and the return type of dropAction().
-
- \table
- \header \i Old enum value \i New enum value
- \row \i QDropEvent::Copy \i Qt::CopyAction
- \row \i QDropEvent::Move \i Qt::MoveAction
- \row \i QDropEvent::Link \i Qt::LinkAction
- \row \i other \i Qt::CopyAction
- \endtable
-*/
-
-QT3_SUPPORT QDropEvent::Action QDropEvent::action() const
-{
- switch(drop_action) {
- case Qt::CopyAction:
- return Copy;
- case Qt::MoveAction:
- return Move;
- case Qt::LinkAction:
- return Link;
- default:
- return Copy;
- }
-}
-#endif
-
/*!
\fn void QDropEvent::setPoint(const QPoint &point)
\compat
@@ -3471,12 +3299,6 @@ QDebug operator<<(QDebug dbg, const QEvent *e) {
case QEvent::UngrabKeyboard:
n = "UngrabKeyboard";
break;
-#ifdef QT3_SUPPORT
- case QEvent::ChildInsertedRequest:
- n = "ChildInsertedRequest";
- break;
- case QEvent::ChildInserted: n = "ChildInserted";
-#endif
case QEvent::ChildAdded: n = n ? n : "ChildAdded";
case QEvent::ChildPolished: n = n ? n : "ChildPolished";
case QEvent::ChildRemoved: n = n ? n : "ChildRemoved";
@@ -3628,60 +3450,6 @@ QWindowStateChangeEvent::~QWindowStateChangeEvent()
{
}
-#ifdef QT3_SUPPORT
-
-/*!
- \class QMenubarUpdatedEvent
- \internal
- Event sent by QMenuBar to tell Q3Workspace to update itself.
-*/
-
-/*! \internal
-
-*/
-QMenubarUpdatedEvent::QMenubarUpdatedEvent(QMenuBar * const menuBar)
-:QEvent(QEvent::MenubarUpdated), m_menuBar(menuBar) {}
-
-/*!
- \fn QMenuBar *QMenubarUpdatedEvent::menuBar()
- \internal
-*/
-
-/*!
- \fn bool operator==(QKeyEvent *e, QKeySequence::StandardKey key)
-
- \relates QKeyEvent
-
- Returns true if \a key is currently bound to the key combination
- specified by \a e.
-
- Equivalent to \c {e->matches(key)}.
-*/
-
-/*!
- \fn bool operator==(QKeySequence::StandardKey key, QKeyEvent *e)
-
- \relates QKeyEvent
-
- Returns true if \a key is currently bound to the key combination
- specified by \a e.
-
- Equivalent to \c {e->matches(key)}.
-*/
-
-/*!
- \internal
-
- \class QKeyEventEx
- \ingroup events
-
- \brief The QKeyEventEx class provides more extended information about a keyevent.
-
- This class is for internal use only, and exists to aid the shortcut system on
- various platforms to get all the information it needs.
-*/
-
-#endif
/*!
\class QTouchEvent
diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h
index 93c2bc53b6..6128db4a64 100644
--- a/src/gui/kernel/qevent.h
+++ b/src/gui/kernel/qevent.h
@@ -107,15 +107,6 @@ public:
inline bool hasExtendedInfo() const { return reinterpret_cast<const QMouseEvent *>(d) == this; }
QPointF posF() const;
-#ifdef QT3_SUPPORT
- QT3_SUPPORT_CONSTRUCTOR QMouseEvent(Type type, const QPoint &pos, Qt::ButtonState button, int state);
- QT3_SUPPORT_CONSTRUCTOR QMouseEvent(Type type, const QPoint &pos, const QPoint &globalPos,
- Qt::ButtonState button, int state);
- inline QT3_SUPPORT Qt::ButtonState state() const
- { return Qt::ButtonState((mouseState^b)|int(modifiers())); }
- inline QT3_SUPPORT Qt::ButtonState stateAfter() const
- { return Qt::ButtonState(int(mouseState)|int(modifiers())); }
-#endif
protected:
QPoint p, g;
Qt::MouseButton b;
@@ -158,14 +149,6 @@ public:
inline Qt::MouseButtons buttons() const { return mouseState; }
Qt::Orientation orientation() const { return o; }
-#ifdef QT3_SUPPORT
- QT3_SUPPORT_CONSTRUCTOR QWheelEvent(const QPoint &pos, int delta, int state,
- Qt::Orientation orient = Qt::Vertical);
- QT3_SUPPORT_CONSTRUCTOR QWheelEvent(const QPoint &pos, const QPoint& globalPos, int delta, int state,
- Qt::Orientation orient = Qt::Vertical);
- inline QT3_SUPPORT Qt::ButtonState state() const
- { return static_cast<Qt::ButtonState>(int(buttons())|int(modifiers())); }
-#endif
protected:
QPoint p;
QPoint g;
@@ -248,22 +231,6 @@ public:
quint32 nativeVirtualKey() const;
quint32 nativeModifiers() const;
-#ifdef QT3_SUPPORT
- inline QT3_SUPPORT_CONSTRUCTOR QKeyEvent(Type type, int key, int /*ascii*/,
- int modifiers, const QString& text = QString(),
- bool autorep = false, ushort count = 1)
- : QInputEvent(type, Qt::KeyboardModifiers(modifiers & (int)Qt::KeyButtonMask)), txt(text), k(key),
- c(count), autor(autorep)
- {
- if (key >= Qt::Key_Back && key <= Qt::Key_MediaLast)
- ignore();
- }
- inline QT3_SUPPORT int ascii() const
- { return (txt.length() ? txt.unicode()->toLatin1() : 0); }
- inline QT3_SUPPORT Qt::ButtonState state() const { return Qt::ButtonState(QInputEvent::modifiers()); }
- inline QT3_SUPPORT Qt::ButtonState stateAfter() const { return Qt::ButtonState(modifiers()); }
-#endif
-
protected:
QString txt;
int k;
@@ -281,12 +248,6 @@ public:
inline bool gotFocus() const { return type() == FocusIn; }
inline bool lostFocus() const { return type() == FocusOut; }
-#ifdef QT3_SUPPORT
- enum Reason { Mouse=Qt::MouseFocusReason, Tab=Qt::TabFocusReason,
- Backtab=Qt::BacktabFocusReason, MenuBar=Qt::MenuBarFocusReason,
- ActiveWindow=Qt::ActiveWindowFocusReason, Other=Qt::OtherFocusReason,
- Popup=Qt::PopupFocusReason, Shortcut=Qt::ShortcutFocusReason };
-#endif
Qt::FocusReason reason();
Qt::FocusReason reason() const;
@@ -305,12 +266,6 @@ public:
inline const QRect &rect() const { return m_rect; }
inline const QRegion &region() const { return m_region; }
-#ifdef QT3_SUPPORT
- QT3_SUPPORT_CONSTRUCTOR QPaintEvent(const QRegion &paintRegion, const QRect &paintRect);
- inline QT3_SUPPORT bool erased() const { return m_erased; }
- inline QT3_SUPPORT void setErased(bool b) { m_erased = b; }
-#endif
-
protected:
friend class QApplication;
friend class QCoreApplication;
@@ -414,12 +369,6 @@ public:
inline Reason reason() const { return Reason(reas); }
-#ifdef QT3_SUPPORT
- QT3_SUPPORT_CONSTRUCTOR QContextMenuEvent(Reason reason, const QPoint &pos, const QPoint &globalPos, int);
- QT3_SUPPORT_CONSTRUCTOR QContextMenuEvent(Reason reason, const QPoint &pos, int);
-
- QT3_SUPPORT Qt::ButtonState state() const;
-#endif
protected:
QPoint p;
QPoint gp;
@@ -502,16 +451,6 @@ public:
QByteArray encodedData(const char*) const;
bool provides(const char*) const;
// END QT3_SUPPORT
-#ifdef QT3_SUPPORT
- inline void accept() { QEvent::accept(); }
- inline QT3_SUPPORT void accept(bool y) { setAccepted(y); }
- inline QT3_SUPPORT QByteArray data(const char* f) const { return encodedData(f); }
-
- enum Action { Copy, Link, Move, Private, UserAction = Private };
- QT3_SUPPORT Action action() const;
- inline QT3_SUPPORT void acceptAction(bool y = true) { if (y) { drop_action = default_action; accept(); } }
- inline QT3_SUPPORT void setPoint(const QPoint& np) { p = np; }
-#endif
protected:
@@ -542,10 +481,6 @@ public:
inline void accept(const QRect & r) { accept(); rect = r; }
inline void ignore(const QRect & r) { ignore(); rect = r; }
-#ifdef QT3_SUPPORT
- inline QT3_SUPPORT void accept(bool y) { setAccepted(y); }
-#endif
-
protected:
friend class QApplication;
QRect rect;
@@ -716,18 +651,6 @@ private:
Qt::WindowStates ostate;
};
-#ifdef QT3_SUPPORT
-class QMenuBar;
-class Q_GUI_EXPORT QMenubarUpdatedEvent: public QEvent
-{
-public:
- QMenubarUpdatedEvent(QMenuBar * const menBar);
- inline QMenuBar *menuBar() { return m_menuBar; }
-private:
- QMenuBar *m_menuBar;
-};
-#endif
-
#ifndef QT_NO_DEBUG_STREAM
Q_GUI_EXPORT QDebug operator<<(QDebug, const QEvent *);
#endif
diff --git a/src/gui/kernel/qguivariant.cpp b/src/gui/kernel/qguivariant.cpp
index badff80834..ef0cfc987c 100644
--- a/src/gui/kernel/qguivariant.cpp
+++ b/src/gui/kernel/qguivariant.cpp
@@ -70,10 +70,6 @@
QT_BEGIN_NAMESPACE
-#ifdef QT3_SUPPORT
-extern QDataStream &qt_stream_out_qcolorgroup(QDataStream &s, const QColorGroup &g);
-extern QDataStream &qt_stream_in_qcolorgroup(QDataStream &s, QColorGroup &g);
-#endif
Q_CORE_EXPORT const QVariant::Handler *qcoreVariantHandler();
@@ -107,11 +103,6 @@ static void construct(QVariant::Private *x, const void *copy)
case QVariant::Palette:
v_construct<QPalette>(x, copy);
break;
-#ifdef QT3_SUPPORT
- case QVariant::ColorGroup:
- v_construct<QColorGroup>(x, copy);
- break;
-#endif
#ifndef QT_NO_ICON
case QVariant::Icon:
v_construct<QIcon>(x, copy);
@@ -218,11 +209,6 @@ static void clear(QVariant::Private *d)
case QVariant::Palette:
v_clear<QPalette>(d);
break;
-#ifdef QT3_SUPPORT
- case QVariant::ColorGroup:
- v_clear<QColorGroup>(d);
- break;
-#endif
#ifndef QT_NO_ICON
case QVariant::Icon:
v_clear<QIcon>(d);
@@ -313,9 +299,6 @@ static bool isNull(const QVariant::Private *d)
case QVariant::Brush:
case QVariant::Color:
case QVariant::Palette:
-#ifdef QT3_SUPPORT
- case QVariant::ColorGroup:
-#endif
case QVariant::SizePolicy:
#ifndef QT_NO_SHORTCUT
case QVariant::KeySequence:
@@ -374,10 +357,6 @@ static bool compare(const QVariant::Private *a, const QVariant::Private *b)
return *v_cast<QColor>(a) == *v_cast<QColor>(b);
case QVariant::Palette:
return *v_cast<QPalette>(a) == *v_cast<QPalette>(b);
-#ifdef QT3_SUPPORT
- case QVariant::ColorGroup:
- return *v_cast<QColorGroup>(a) == *v_cast<QColorGroup>(b);
-#endif
#ifndef QT_NO_ICON
case QVariant::Icon:
/* QIcon::operator==() cannot be reasonably implemented for QIcon,
@@ -688,9 +667,6 @@ extern Q_CORE_EXPORT const QMetaTypeGuiHelper *qMetaTypeGuiHelper;
static const QLoad##TYPE qLoad##TYPE = qMetaTypeLoadHelper<TYPE>;
#endif
-#ifdef QT3_SUPPORT
-Q_DECL_METATYPE_HELPER(QColorGroup)
-#endif
Q_DECL_METATYPE_HELPER(QFont)
Q_DECL_METATYPE_HELPER(QPixmap)
Q_DECL_METATYPE_HELPER(QBrush)
@@ -745,11 +721,7 @@ Q_DECL_METATYPE_HELPER(QQuaternion)
#endif
static const QMetaTypeGuiHelper qVariantGuiHelper[] = {
-#ifdef QT3_SUPPORT
- Q_IMPL_METATYPE_HELPER(QColorGroup),
-#else
{0, 0, 0, 0},
-#endif
Q_IMPL_METATYPE_HELPER(QFont),
Q_IMPL_METATYPE_HELPER(QPixmap),
Q_IMPL_METATYPE_HELPER(QBrush),
diff --git a/src/gui/kernel/qpalette.cpp b/src/gui/kernel/qpalette.cpp
index 490d442616..f0117b46e5 100644
--- a/src/gui/kernel/qpalette.cpp
+++ b/src/gui/kernel/qpalette.cpp
@@ -63,103 +63,6 @@ static QColor qt_mix_colors(QColor a, QColor b)
(a.blue() + b.blue()) / 2, (a.alpha() + b.alpha()) / 2);
}
-#ifdef QT3_SUPPORT
-
-#ifndef QT_NO_DATASTREAM
-QDataStream &qt_stream_out_qcolorgroup(QDataStream &s, const QColorGroup &g)
-{
- if(s.version() == 1) {
- // Qt 1.x
- s << g.color(QPalette::Foreground) << g.color(QPalette::Background)
- << g.color(QPalette::Light) << g.color(QPalette::Dark)
- << g.color(QPalette::Mid) << g.color(QPalette::Text) << g.color(QPalette::Base);
- } else {
- int max = QPalette::NColorRoles;
- if (s.version() <= QDataStream::Qt_2_1)
- max = QPalette::HighlightedText + 1;
- else if (s.version() <= QDataStream::Qt_4_3)
- max = QPalette::AlternateBase + 1;
- for(int r = 0 ; r < max ; r++)
- s << g.brush((QPalette::ColorRole)r);
- }
- return s;
-}
-
-QDataStream &qt_stream_in_qcolorgroup(QDataStream &s, QColorGroup &g)
-{
- if(s.version() == 1) { // Qt 1.x
- QColor fg, bg, light, dark, mid, text, base;
- s >> fg >> bg >> light >> dark >> mid >> text >> base;
- QPalette p(bg);
- p.setColor(QPalette::Active, QPalette::Foreground, fg);
- p.setColor(QPalette::Active, QPalette::Light, light);
- p.setColor(QPalette::Active, QPalette::Dark, dark);
- p.setColor(QPalette::Active, QPalette::Mid, mid);
- p.setColor(QPalette::Active, QPalette::Text, text);
- p.setColor(QPalette::Active, QPalette::Base, base);
- g = p;
- g.setCurrentColorGroup(QPalette::Active);
- } else {
- int max = QPalette::NColorRoles;
- if (s.version() <= QDataStream::Qt_2_1)
- max = QPalette::HighlightedText + 1;
- else if (s.version() <= QDataStream::Qt_3_0)
- max = QPalette::LinkVisited + 1;
- else if (s.version() <= QDataStream::Qt_4_3)
- max = QPalette::AlternateBase + 1;
- QBrush tmp;
- for(int r = 0 ; r < max; r++) {
- s >> tmp;
- g.setBrush((QPalette::ColorRole)r, tmp);
- }
- }
- return s;
-}
-
-QDataStream &operator<<(QDataStream &s, const QColorGroup &g)
-{
- return qt_stream_out_qcolorgroup(s, g);
-}
-
-QDataStream &operator>>(QDataStream &s, QColorGroup &g)
-{
- return qt_stream_in_qcolorgroup(s, g);
-}
-#endif // QT_NO_DATASTREAM
-
-/*!
- Constructs a palette with the specified \a active, \a disabled and
- \a inactive color groups.
-*/
-QPalette::QPalette(const QColorGroup &active, const QColorGroup &disabled,
- const QColorGroup &inactive)
-{
- Q_ASSERT(QPalette::NColorRoles == QPalette::ToolTipText + 1);
- init();
- setColorGroup(Active, active);
- setColorGroup(Disabled, disabled);
- setColorGroup(Inactive, inactive);
-}
-
-QColorGroup QPalette::createColorGroup(ColorGroup cr) const
-{
- QColorGroup ret(*this);
- ret.setCurrentColorGroup(cr);
- return ret;
-}
-
-void QPalette::setColorGroup(ColorGroup cg, const QColorGroup &g)
-{
- setColorGroup(cg, g.brush(WindowText), g.brush(Button), g.brush(Light),
- g.brush(Dark), g.brush(Mid), g.brush(Text), g.brush(BrightText),
- g.brush(Base), g.brush(AlternateBase), g.brush(Window),
- g.brush(Midlight), g.brush(ButtonText), g.brush(Shadow),
- g.brush(Highlight), g.brush(HighlightedText), g.brush(Link),
- g.brush(LinkVisited), g.brush(ToolTipBase), g.brush(ToolTipText));
-}
-
-#endif // QT3_SUPPORT
-
/*!
\fn const QColor &QPalette::color(ColorRole role) const
@@ -897,27 +800,6 @@ bool QPalette::operator==(const QPalette &p) const
return true;
}
-#ifdef QT3_SUPPORT
-bool QColorGroup::operator==(const QColorGroup &other) const
-{
- if (isCopyOf(other))
- return true;
- for (int role = 0; role < int(NColorRoles); role++) {
- if(d->br[current_group][role] != other.d->br[other.current_group][role])
- return false;
- }
- return true;
-}
-
-/*!
- Returns the color group as a QVariant
-*/
-QColorGroup::operator QVariant() const
-{
- return QVariant(QVariant::ColorGroup, this);
-}
-#endif
-
/*!
\fn bool QPalette::isEqual(ColorGroup cg1, ColorGroup cg2) const
@@ -1205,202 +1087,5 @@ void QPalette::setColorGroup(ColorGroup cg, const QBrush &foreground, const QBru
Use simple assignment instead.
*/
-/*!
- \fn QColorGroup QPalette::normal() const
- \obsolete
-
- Returns the active color group. Use active() instead.
-
- Use createColorGroup(Active) instead.
-*/
-
-/*!
- \fn void QPalette::setNormal(const QColorGroup &colorGroup)
-
- Sets the normal color group to \a colorGroup.
-
- \sa QColorGroup
-*/
-
-/*!
- \fn QColorGroup QPalette::active() const
-
- Returns the active color group.
- \sa QColorGroup
-*/
-
-/*!
- \fn QColorGroup QPalette::disabled() const
-
- Returns the disabled color group.
- \sa QColorGroup
-*/
-
-/*!
- \fn QColorGroup QPalette::inactive() const
-
- Returns the inactive color group.
- \sa QColorGroup
-*/
-
-/*!
- \fn void QPalette::setActive(const QColorGroup &colorGroup)
-
- Sets the active color group to \a colorGroup.
- \sa QColorGroup
-*/
-
-/*!
- \fn void QPalette::setDisabled(const QColorGroup &colorGroup)
-
- Sets the disabled color group to \a colorGroup.
- \sa QColorGroup
-*/
-
-/*!
- \fn void QPalette::setInactive(const QColorGroup &colorGroup)
-
- Sets the inactive color group.
- \sa QColorGroup
-*/
-
-/*! \class QColorGroup
- \brief The QColorGroup class contains color groups for each widget state.
- \compat
-*/
-
-/*! \fn QColorGroup::QColorGroup()
-
- Use QPalette() instead.
-*/
-
-/*! \fn QColorGroup::QColorGroup(const QBrush &foreground, const QBrush &button, \
- const QBrush &light, const QBrush &dark, const QBrush &mid, \
- const QBrush &text, const QBrush &bright_text,
- const QBrush &base, const QBrush &background)
-
- Use QPalette(\a foreground, \a button, \a light, \a dark, \a mid,
- \a text, \a bright_text, \a base, \a background) instead.
-*/
-
-/*! \fn QColorGroup::QColorGroup(const QColor &foreground, const QColor &background, \
- const QColor &light, const QColor &dark, const QColor &mid, \
- const QColor &text, const QColor &base)
-
- Use QColorGroup(\a foreground, \a background, \a light, \a dark,
- \a mid, \a text, \a base) instead.
-*/
-
-/*! \fn QColorGroup::QColorGroup(const QColorGroup &other)
-
- Use QPalette(\a other) instead.
-*/
-
-/*! \fn QColorGroup::QColorGroup(const QPalette &pal)
-
- Use QPalette(\a pal) instead.
-*/
-
-/*! \fn const QColor &QColorGroup::foreground() const
-
- Use QPalette::windowText().color() instead.
-*/
-
-/*! \fn const QColor &QColorGroup::button() const
-
- Use QPalette::button().color() instead.
-*/
-
-/*! \fn const QColor &QColorGroup::light() const
-
- Use QPalette::light().color() instead.
-*/
-
-/*! \fn const QColor &QColorGroup::dark() const
-
- Use QPalette::dark().color() instead.
-*/
-
-/*! \fn const QColor &QColorGroup::mid() const
-
- Use QPalette::mid().color() instead.
-*/
-
-/*! \fn const QColor &QColorGroup::text() const
-
- Use QPalette::text().color() instead.
-*/
-
-/*! \fn const QColor &QColorGroup::base() const
-
- Use QPalette::base().color() instead.
-*/
-
-/*! \fn const QColor &QColorGroup::background() const
-
- Use QPalette::window().color() instead.
-*/
-
-/*! \fn const QColor &QColorGroup::midlight() const
-
- Use QPalette::midlight().color() instead.
-*/
-
-/*! \fn const QColor &QColorGroup::brightText() const
-
- Use QPalette::brightText().color() instead.
-*/
-
-/*! \fn const QColor &QColorGroup::buttonText() const
-
- Use QPalette::buttonText().color() instead.
-*/
-
-/*! \fn const QColor &QColorGroup::shadow() const
-
- Use QPalette::shadow().color() instead.
-*/
-
-/*! \fn const QColor &QColorGroup::highlight() const
-
- Use QPalette::highlight().color() instead.
-*/
-
-/*! \fn const QColor &QColorGroup::highlightedText() const
-
- Use QPalette::highlightedText().color() instead.
-*/
-
-/*! \fn const QColor &QColorGroup::link() const
-
- Use QPalette::link().color() instead.
-*/
-
-/*! \fn const QColor &QColorGroup::linkVisited() const
-
- Use QPalette::linkVisited().color() instead.
-*/
-
-/*! \fn QDataStream &operator<<(QDataStream &ds, const QColorGroup &colorGroup)
- \relates QColorGroup
- \compat
-*/
-
-/*! \fn QDataStream &operator>>(QDataStream &ds, QColorGroup &colorGroup)
- \relates QColorGroup
- \compat
-*/
-
-/*! \fn bool QColorGroup::operator==(const QColorGroup &other) const
-
- Returns true if this color group is equal to \a other; otherwise
- returns false.
-*/
-
-/*! \fn bool QColorGroup::operator!=(const QColorGroup &other) const
-
- Returns true if this color group is not equal to \a other;
- otherwise returns false.
-*/
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qpalette.h b/src/gui/kernel/qpalette.h
index dffd2cbec8..17f3d0f653 100644
--- a/src/gui/kernel/qpalette.h
+++ b/src/gui/kernel/qpalette.h
@@ -52,9 +52,6 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Gui)
-#ifdef QT3_SUPPORT
-class QColorGroup;
-#endif
class QPalettePrivate;
class QVariant;
@@ -72,9 +69,6 @@ public:
const QBrush &bright_text, const QBrush &base, const QBrush &window);
QPalette(const QColor &windowText, const QColor &window, const QColor &light,
const QColor &dark, const QColor &mid, const QColor &text, const QColor &base);
-#ifdef QT3_SUPPORT
- QT3_SUPPORT_CONSTRUCTOR QPalette(const QColorGroup &active, const QColorGroup &disabled, const QColorGroup &inactive);
-#endif
QPalette(const QPalette &palette);
~QPalette();
QPalette &operator=(const QPalette &palette);
@@ -142,19 +136,6 @@ public:
inline const QBrush &link() const { return brush(Link); }
inline const QBrush &linkVisited() const { return brush(LinkVisited); }
-#ifdef QT3_SUPPORT
- inline QT3_SUPPORT QPalette copy() const { QPalette p = *this; p.detach(); return p; }
- QT3_SUPPORT QColorGroup normal() const;
- inline QT3_SUPPORT void setNormal(const QColorGroup &cg) { setColorGroup(Active, cg); }
-
- QT3_SUPPORT QColorGroup active() const;
- QT3_SUPPORT QColorGroup disabled() const;
- QT3_SUPPORT QColorGroup inactive() const;
- inline QT3_SUPPORT void setActive(const QColorGroup &cg) { setColorGroup(Active, cg); }
- inline QT3_SUPPORT void setDisabled(const QColorGroup &cg) { setColorGroup(Disabled, cg); }
- inline QT3_SUPPORT void setInactive(const QColorGroup &cg) { setColorGroup(Inactive, cg); }
-#endif
-
bool operator==(const QPalette &p) const;
inline bool operator!=(const QPalette &p) const { return !(operator==(p)); }
bool isCopyOf(const QPalette &p) const;
@@ -184,11 +165,6 @@ private:
const QBrush &highlight, const QBrush &highlighted_text,
const QBrush &link, const QBrush &link_visited,
const QBrush &toolTipBase, const QBrush &toolTipText);
-#ifdef QT3_SUPPORT
- friend class QColorGroup;
- void setColorGroup(ColorGroup, const QColorGroup &);
- QColorGroup createColorGroup(ColorGroup) const;
-#endif
void init();
void detach();
@@ -206,55 +182,6 @@ inline void QPalette::setColor(ColorRole acr, const QColor &acolor)
inline void QPalette::setBrush(ColorRole acr, const QBrush &abrush)
{ setBrush(All, acr, abrush); }
-#ifdef QT3_SUPPORT
-class Q_GUI_EXPORT QColorGroup : public QPalette
-{
-public:
- inline QColorGroup() : QPalette() {}
- inline QColorGroup(const QBrush &foreground, const QBrush &button, const QBrush &light,
- const QBrush &dark, const QBrush &mid, const QBrush &text,
- const QBrush &bright_text, const QBrush &base, const QBrush &background)
- : QPalette(foreground, button, light, dark, mid, text, bright_text, base, background)
- {}
- inline QColorGroup(const QColor &foreground, const QColor &background, const QColor &light,
- const QColor &dark, const QColor &mid, const QColor &text, const QColor &base)
- : QPalette(foreground, background, light, dark, mid, text, base) {}
- inline QColorGroup(const QColorGroup &cg) : QPalette(cg) {}
- inline QColorGroup(const QPalette &pal) : QPalette(pal) {}
- bool operator==(const QColorGroup &other) const;
- inline bool operator!=(const QColorGroup &other) const { return !(operator==(other)); }
- operator QVariant() const;
-
- inline QT3_SUPPORT const QColor &foreground() const { return color(WindowText); }
- inline QT3_SUPPORT const QColor &button() const { return color(Button); }
- inline QT3_SUPPORT const QColor &light() const { return color(Light); }
- inline QT3_SUPPORT const QColor &dark() const { return color(Dark); }
- inline QT3_SUPPORT const QColor &mid() const { return color(Mid); }
- inline QT3_SUPPORT const QColor &text() const { return color(Text); }
- inline QT3_SUPPORT const QColor &base() const { return color(Base); }
- inline QT3_SUPPORT const QColor &background() const { return color(Window); }
- inline QT3_SUPPORT const QColor &midlight() const { return color(Midlight); }
- inline QT3_SUPPORT const QColor &brightText() const { return color(BrightText); }
- inline QT3_SUPPORT const QColor &buttonText() const { return color(ButtonText); }
- inline QT3_SUPPORT const QColor &shadow() const { return color(Shadow); }
- inline QT3_SUPPORT const QColor &highlight() const { return color(Highlight); }
- inline QT3_SUPPORT const QColor &highlightedText() const { return color(HighlightedText); }
- inline QT3_SUPPORT const QColor &link() const { return color(Link); }
- inline QT3_SUPPORT const QColor &linkVisited() const { return color(LinkVisited); }
-};
-
-#ifndef QT_NO_DATASTREAM
-Q_GUI_EXPORT QT3_SUPPORT QDataStream &operator<<(QDataStream &ds, const QColorGroup &cg);
-Q_GUI_EXPORT QT3_SUPPORT QDataStream &operator>>(QDataStream &ds, QColorGroup &cg);
-#endif
-
-inline QColorGroup QPalette::inactive() const { return createColorGroup(Inactive); }
-inline QColorGroup QPalette::disabled() const { return createColorGroup(Disabled); }
-inline QColorGroup QPalette::active() const { return createColorGroup(Active); }
-inline QColorGroup QPalette::normal() const { return createColorGroup(Active); }
-
-#endif
-
/*****************************************************************************
QPalette stream functions
*****************************************************************************/
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index e1f9ee70ce..7022c38581 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -11692,11 +11692,6 @@ void QWidget::languageChange() { } // compat
\endcode
*/
-/*!
- \fn QColorGroup QWidget::colorGroup() const
-
- Use QColorGroup(palette()) instead.
-*/
/*!
\fn QWidget *QWidget::parentWidget(bool sameWindow) const
diff --git a/src/gui/kernel/qwidget.h b/src/gui/kernel/qwidget.h
index 7186c441f6..d3a08a86c7 100644
--- a/src/gui/kernel/qwidget.h
+++ b/src/gui/kernel/qwidget.h
@@ -855,7 +855,6 @@ public:
const QT3_SUPPORT QPixmap *backgroundPixmap() const;
void QT3_SUPPORT setBackgroundPixmap(const QPixmap &);
QT3_SUPPORT void setBackgroundColor(const QColor &);
- QT3_SUPPORT QColorGroup colorGroup() const;
QT3_SUPPORT QWidget *parentWidget(bool sameWindow) const;
inline QT3_SUPPORT void setKeyCompression(bool b) { setAttribute(Qt::WA_KeyCompression, b); }
inline QT3_SUPPORT void setFont(const QFont &f, bool) { setFont(f); }
@@ -1052,8 +1051,6 @@ inline QWidget *QWidget::parentWidget(bool sameWindow) const
return 0;
return static_cast<QWidget *>(QObject::parent());
}
-inline QColorGroup QWidget::colorGroup() const
-{ return QColorGroup(palette()); }
inline void QWidget::setPaletteForegroundColor(const QColor &c)
{ QPalette p = palette(); p.setColor(foregroundRole(), c); setPalette(p); }
inline const QBrush& QWidget::backgroundBrush() const { return palette().brush(backgroundRole()); }
diff --git a/src/gui/kernel/qwindowdefs.h b/src/gui/kernel/qwindowdefs.h
index ab8af5fbb2..dd6d13a338 100644
--- a/src/gui/kernel/qwindowdefs.h
+++ b/src/gui/kernel/qwindowdefs.h
@@ -57,9 +57,6 @@ class QWidget;
class QDialog;
class QColor;
class QPalette;
-#ifdef QT3_SUPPORT
-class QColorGroup;
-#endif
class QCursor;
class QPoint;
class QSize;
diff --git a/src/gui/styles/qstyle.cpp b/src/gui/styles/qstyle.cpp
index dd816d379c..500e827397 100644
--- a/src/gui/styles/qstyle.cpp
+++ b/src/gui/styles/qstyle.cpp
@@ -2187,34 +2187,6 @@ int QStyle::sliderValueFromPosition(int min, int max, int pos, int span, bool up
// pos <= span < sqrt(INT_MAX+0.0625)+0.25 ~ sqrt(INT_MAX)
}
-/*### \fn void QStyle::drawItem(QPainter *p, const QRect &r,
- int flags, const QColorGroup &colorgroup, bool enabled,
- const QString &text, int len = -1,
- const QColor *penColor = 0) const
-
- Use one of the drawItem() overloads that takes a QPalette instead
- of a QColorGroup.
-*/
-
-/*### \fn void QStyle::drawItem(QPainter *p, const QRect &r,
- int flags, const QColorGroup colorgroup, bool enabled,
- const QPixmap &pixmap,
- const QColor *penColor = 0) const
-
- Use one of the drawItem() overloads that takes a QPalette instead
- of a QColorGroup.
-*/
-
-/*### \fn void QStyle::drawItem(QPainter *p, const QRect &r,
- int flags, const QColorGroup colorgroup, bool enabled,
- const QPixmap *pixmap,
- const QString &text, int len = -1,
- const QColor *penColor = 0) const
-
- Use one of the drawItem() overloads that takes a QPalette instead
- of a QColorGroup.
-*/
-
/*!
Returns the style's standard palette.