From 54c9b1a80c04a5ecc685dc29e27a27de81d8cc1b Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 3 May 2011 22:51:17 +0200 Subject: even less QT3_SUPPORT the new libQtGui should now be free of any Qt3 related methods. --- src/gui/kernel/qkeysequence.h | 3 - src/gui/kernel/qsound.cpp | 23 ----- src/gui/kernel/qsound.h | 5 - src/gui/painting/qmatrix.cpp | 36 ------- src/gui/painting/qprinter.cpp | 159 ------------------------------ src/gui/painting/qprinter.h | 54 ---------- src/gui/painting/qregion.cpp | 11 --- src/gui/painting/qregion.h | 6 -- src/gui/statemachine/qguistatemachine.cpp | 23 ----- src/gui/text/qfont.cpp | 49 --------- src/gui/text/qfont.h | 8 -- src/gui/text/qfontdatabase.h | 4 - src/gui/text/qfontmetrics.h | 9 -- src/gui/text/qtextcontrol_p.h | 5 - 14 files changed, 395 deletions(-) (limited to 'src') diff --git a/src/gui/kernel/qkeysequence.h b/src/gui/kernel/qkeysequence.h index 9eabb89d29..c61501036a 100644 --- a/src/gui/kernel/qkeysequence.h +++ b/src/gui/kernel/qkeysequence.h @@ -161,9 +161,6 @@ public: NoMatch, PartialMatch, ExactMatch -#ifdef QT3_SUPPORT - , Identical = ExactMatch -#endif }; QString toString(SequenceFormat format = PortableText) const; diff --git a/src/gui/kernel/qsound.cpp b/src/gui/kernel/qsound.cpp index a61310a4eb..55a98758c3 100644 --- a/src/gui/kernel/qsound.cpp +++ b/src/gui/kernel/qsound.cpp @@ -189,29 +189,6 @@ QSound::QSound(const QString& filename, QObject* parent) server().init(this); } -#ifdef QT3_SUPPORT -/*! - \obsolete - - Constructs a QSound object from the file specified by the given \a - filename and with the given \a parent and \a name. Use the - QSound() construcor and QObject::setObjectName() instead. - - \oldcode - QSound *mySound = new QSound(filename, parent, name); - \newcode - QSounc *mySound = new QSound(filename, parent); - mySound->setObjectName(name); - \endcode -*/ -QSound::QSound(const QString& filename, QObject* parent, const char* name) - : QObject(*new QSoundPrivate(filename), parent) -{ - setObjectName(QString::fromAscii(name)); - server().init(this); -} -#endif - /*! Destroys this sound object. If the sound is not finished playing, the stop() function is called before the sound object is diff --git a/src/gui/kernel/qsound.h b/src/gui/kernel/qsound.h index 70957762b2..a0d058011a 100644 --- a/src/gui/kernel/qsound.h +++ b/src/gui/kernel/qsound.h @@ -76,11 +76,6 @@ public Q_SLOTS: void play(); void stop(); -public: -#ifdef QT3_SUPPORT - QT3_SUPPORT_CONSTRUCTOR QSound(const QString& filename, QObject* parent, const char* name); - static inline QT3_SUPPORT bool available() { return isAvailable(); } -#endif private: Q_DECLARE_PRIVATE(QSound) friend class QAuServer; diff --git a/src/gui/painting/qmatrix.cpp b/src/gui/painting/qmatrix.cpp index 38f78e1a46..a7523fd3cb 100644 --- a/src/gui/painting/qmatrix.cpp +++ b/src/gui/painting/qmatrix.cpp @@ -730,42 +730,6 @@ QPainterPath QMatrix::map(const QPainterPath &path) const return copy; } -/*! - \fn QRegion QMatrix::mapToRegion(const QRect &rectangle) const - - Returns the transformed rectangle \a rectangle as a QRegion - object. A rectangle which has been rotated or sheared may result - in a non-rectangular region being returned. - - Use the mapToPolygon() or map() function instead. -*/ -#ifdef QT3_SUPPORT -QRegion QMatrix::mapToRegion(const QRect &rect) const -{ - QRegion result; - if (isIdentity()) { - result = rect; - } else if (m12() == 0.0F && m21() == 0.0F) { - int x = qRound(m11()*rect.x() + dx()); - int y = qRound(m22()*rect.y() + dy()); - int w = qRound(m11()*rect.width()); - int h = qRound(m22()*rect.height()); - if (w < 0) { - w = -w; - x -= w - 1; - } - if (h < 0) { - h = -h; - y -= h - 1; - } - result = QRect(x, y, w, h); - } else { - result = QRegion(mapToPolygon(rect)); - } - return result; - -} -#endif /*! \fn QPolygon QMatrix::mapToPolygon(const QRect &rectangle) const diff --git a/src/gui/painting/qprinter.cpp b/src/gui/painting/qprinter.cpp index f5ba8e76db..5f93a2c735 100644 --- a/src/gui/painting/qprinter.cpp +++ b/src/gui/painting/qprinter.cpp @@ -72,10 +72,6 @@ #include #include -#if defined(QT3_SUPPORT) -# include "qprintdialog.h" -#endif // QT3_SUPPORT - QT_BEGIN_NAMESPACE #define ABORT_IF_ACTIVE(location) \ @@ -2085,161 +2081,6 @@ QPrinter::PrintRange QPrinter::printRange() const return PrintRange(d->printRange); } -#if defined(QT3_SUPPORT) - -void QPrinter::setOutputToFile(bool f) -{ - if (f) { - if (outputFileName().isEmpty()) - setOutputFileName(QLatin1String("untitled_printer_document")); - } else { - setOutputFileName(QString()); - } -} - -bool qt_compat_QPrinter_printSetup(QPrinter *printer, QPrinterPrivate *pd, QWidget *parent) -{ - Q_UNUSED(pd); - QPrintDialog dlg(printer, parent); - return dlg.exec() != 0; -} - - -#ifdef Q_WS_MAC -bool qt_compat_QPrinter_pageSetup(QPrinter *p, QWidget *parent) -{ - QPageSetupDialog psd(p, parent); - return psd.exec() != 0; -} - -/*! - Executes a page setup dialog so that the user can configure the type of - page used for printing. Returns true if the contents of the dialog are - accepted; returns false if the dialog is canceled. -*/ -bool QPrinter::pageSetup(QWidget *parent) -{ - return qt_compat_QPrinter_pageSetup(this, parent); -} - -/*! - Executes a print setup dialog so that the user can configure the printing - process. Returns true if the contents of the dialog are accepted; returns - false if the dialog is canceled. -*/ -bool QPrinter::printSetup(QWidget *parent) -{ - Q_D(QPrinter); - return qt_compat_QPrinter_printSetup(this, d, parent); -} -#endif // Q_WS_MAC - -/*! - Use QPrintDialog instead. - - \oldcode - if (printer->setup(parent)) - ... - \newcode - QPrintDialog dialog(printer, parent); - if (dialog.exec()) - ... - \endcode -*/ -bool QPrinter::setup(QWidget *parent) -{ - Q_D(QPrinter); - return qt_compat_QPrinter_printSetup(this, d, parent) -#ifdef Q_WS_MAC - && qt_compat_QPrinter_pageSetup(this, parent); -#endif - ; -} - -/*! - Use QPrintDialog::minPage() instead. -*/ -int QPrinter::minPage() const -{ - Q_D(const QPrinter); - return d->minPage; -} - -/*! - Use QPrintDialog::maxPage() instead. -*/ -int QPrinter::maxPage() const -{ - Q_D(const QPrinter); - return d->maxPage; -} - -/*! - Use QPrintDialog::setMinMax() instead. -*/ -void QPrinter::setMinMax( int minPage, int maxPage ) -{ - Q_D(QPrinter); - Q_ASSERT_X(minPage <= maxPage, "QPrinter::setMinMax", - "'min' must be less than or equal to 'max'"); - d->minPage = minPage; - d->maxPage = maxPage; - d->options |= QPrintDialog::PrintPageRange; -} - -/*! - Returns true if the printer is set up to collate copies of printed documents; - otherwise returns false. - - Use QPrintDialog::isOptionEnabled(QPrintDialog::PrintCollateCopies) - instead. - - \sa collateCopies() -*/ -bool QPrinter::collateCopiesEnabled() const -{ - Q_D(const QPrinter); - return (d->options & QPrintDialog::PrintCollateCopies); -} - -/*! - Use QPrintDialog::setOption(QPrintDialog::PrintCollateCopies) - or QPrintDialog::setOptions(QPrintDialog::options() - & ~QPrintDialog::PrintCollateCopies) instead, depending on \a - enable. -*/ -void QPrinter::setCollateCopiesEnabled(bool enable) -{ - Q_D(QPrinter); - - if (enable) - d->options |= QPrintDialog::PrintCollateCopies; - else - d->options &= ~QPrintDialog::PrintCollateCopies; -} - -/*! - Use QPrintDialog instead. -*/ -void QPrinter::setOptionEnabled( PrinterOption option, bool enable ) -{ - Q_D(QPrinter); - if (enable) - d->options |= QPrintDialog::PrintDialogOption(1 << option); - else - d->options &= ~QPrintDialog::PrintDialogOption(1 << option); -} - -/*! - Use QPrintDialog instead. -*/ -bool QPrinter::isOptionEnabled( PrinterOption option ) const -{ - Q_D(const QPrinter); - return (d->options & QPrintDialog::PrintDialogOption(option)); -} - -#endif // QT3_SUPPORT /*! \class QPrintEngine diff --git a/src/gui/painting/qprinter.h b/src/gui/painting/qprinter.h index a2b7fcf4b1..8b4dcb3857 100644 --- a/src/gui/painting/qprinter.h +++ b/src/gui/painting/qprinter.h @@ -143,10 +143,6 @@ public: DuplexShortSide }; -#ifdef QT3_SUPPORT - enum PrinterOption { PrintToFile, PrintSelection, PrintPageRange }; -#endif // QT3_SUPPORT - void setOutputFormat(OutputFormat format); OutputFormat outputFormat() const; @@ -259,33 +255,6 @@ public: void setPageMargins(qreal left, qreal top, qreal right, qreal bottom, Unit unit); void getPageMargins(qreal *left, qreal *top, qreal *right, qreal *bottom, Unit unit) const; -#ifdef QT3_SUPPORT -#ifdef Q_WS_MAC - QT3_SUPPORT bool pageSetup(QWidget *parent = 0); - QT3_SUPPORT bool printSetup(QWidget *parent = 0); -#endif - - QT3_SUPPORT bool setup(QWidget *parent = 0); - - QT3_SUPPORT void setMinMax(int minPage, int maxPage); - QT3_SUPPORT int minPage() const; - QT3_SUPPORT int maxPage() const; - - QT3_SUPPORT void setCollateCopiesEnabled(bool); - QT3_SUPPORT bool collateCopiesEnabled() const; - - QT3_SUPPORT void setOptionEnabled(PrinterOption, bool enable); - QT3_SUPPORT bool isOptionEnabled(PrinterOption) const; - - inline QT3_SUPPORT QSize margins() const; - inline QT3_SUPPORT void margins(uint *top, uint *left, uint *bottom, uint *right) const; - - inline QT3_SUPPORT bool aborted() { return printerState() == Aborted; } - - QT3_SUPPORT void setOutputToFile(bool); - inline QT3_SUPPORT bool outputToFile() const { return !outputFileName().isEmpty(); } -#endif - protected: int metric(PaintDeviceMetric) const; void setEngines(QPrintEngine *printEngine, QPaintEngine *paintEngine); @@ -305,29 +274,6 @@ private: friend class QPageSetupWidget; }; -#ifdef QT3_SUPPORT -inline QSize QPrinter::margins() const -{ - QRect page = pageRect(); - QRect paper = paperRect(); - return QSize(page.left() - paper.left(), page.top() - paper.top()); -} - -inline void QPrinter::margins(uint *top, uint *left, uint *bottom, uint *right) const -{ - QRect page = pageRect(); - QRect paper = paperRect(); - if (top) - *top = page.top() - paper.top(); - if (left) - *left = page.left() - paper.left(); - if (bottom) - *bottom = paper.bottom() - page.bottom(); - if (right) - *right = paper.right() - page.right(); -} -#endif - #endif // QT_NO_PRINTER QT_END_NAMESPACE diff --git a/src/gui/painting/qregion.cpp b/src/gui/painting/qregion.cpp index d713346902..ae9dc63a8f 100644 --- a/src/gui/painting/qregion.cpp +++ b/src/gui/painting/qregion.cpp @@ -252,17 +252,6 @@ QRegion::QRegion(int x, int y, int w, int h, RegionType t) d = tmp.d; } -#ifdef QT3_SUPPORT -/*! - Use the constructor tha takes a Qt::FillRule as the second - argument instead. -*/ -QRegion::QRegion(const QPolygon &pa, bool winding) -{ - new (this) QRegion(pa, winding ? Qt::WindingFill : Qt::OddEvenFill); -} -#endif - /*! \fn QRegion::~QRegion() \internal diff --git a/src/gui/painting/qregion.h b/src/gui/painting/qregion.h index 1cd38d41b8..3093dc08c4 100644 --- a/src/gui/painting/qregion.h +++ b/src/gui/painting/qregion.h @@ -74,9 +74,6 @@ public: QRegion(int x, int y, int w, int h, RegionType t = Rectangle); QRegion(const QRect &r, RegionType t = Rectangle); QRegion(const QPolygon &pa, Qt::FillRule fillRule = Qt::OddEvenFill); -#ifdef QT3_SUPPORT - QT3_SUPPORT_CONSTRUCTOR QRegion(const QPolygon &pa, bool winding); -#endif QRegion(const QRegion ®ion); QRegion(const QBitmap &bitmap); ~QRegion(); @@ -86,9 +83,6 @@ public: { qSwap(d, other.d); return *this; } #endif inline void swap(QRegion &other) { qSwap(d, other.d); } -#ifdef QT3_SUPPORT - inline QT3_SUPPORT bool isNull() const { return isEmpty(); } -#endif bool isEmpty() const; bool contains(const QPoint &p) const; diff --git a/src/gui/statemachine/qguistatemachine.cpp b/src/gui/statemachine/qguistatemachine.cpp index 2a0de3c1c7..031c135158 100644 --- a/src/gui/statemachine/qguistatemachine.cpp +++ b/src/gui/statemachine/qguistatemachine.cpp @@ -155,15 +155,6 @@ static QEvent *cloneEvent(QEvent *e) return new QChildEvent(*static_cast(e)); case QEvent::ChildPolished: return new QChildEvent(*static_cast(e)); -#ifdef QT3_SUPPORT - case QEvent::ChildInsertedRequest: - return new QEvent(*e); - case QEvent::ChildInserted: - return new QChildEvent(*static_cast(e)); - case QEvent::LayoutHint: - Q_ASSERT_X(false, "cloneEvent()", "not implemented"); - break; -#endif case QEvent::ChildRemoved: return new QChildEvent(*static_cast(e)); case QEvent::ShowWindowRequest: @@ -266,15 +257,6 @@ static QEvent *cloneEvent(QEvent *e) case QEvent::ShortcutOverride: return new QKeyEvent(*static_cast(e)); -#ifdef QT3_SUPPORT - case QEvent::Accel: - Q_ASSERT_X(false, "cloneEvent()", "not implemented"); - break; - case QEvent::AccelAvailable: - Q_ASSERT_X(false, "cloneEvent()", "not implemented"); - break; -#endif - #ifndef QT_NO_WHATSTHIS case QEvent::WhatsThisClicked: return new QWhatsThisClickedEvent(*static_cast(e)); @@ -321,11 +303,6 @@ static QEvent *cloneEvent(QEvent *e) case QEvent::AcceptDropsChange: return new QEvent(*e); -#ifdef QT3_SUPPORT - case QEvent::MenubarUpdated: - return new QMenubarUpdatedEvent(*static_cast(e)); -#endif - case QEvent::ZeroTimerEvent: Q_ASSERT_X(false, "cloneEvent()", "not implemented"); break; diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp index b8cfb1f902..f2e76531d9 100644 --- a/src/gui/text/qfont.cpp +++ b/src/gui/text/qfont.cpp @@ -1096,18 +1096,6 @@ int QFont::pixelSize() const return d->request.pixelSize; } -#ifdef QT3_SUPPORT -/*! \obsolete - - Sets the logical pixel height of font characters when shown on - the screen to \a pixelSize. -*/ -void QFont::setPixelSizeFloat(qreal pixelSize) -{ - setPixelSize((int)pixelSize); -} -#endif - /*! \fn bool QFont::italic() const @@ -1875,43 +1863,6 @@ QFont QFont::resolve(const QFont &other) const \internal */ -#ifdef QT3_SUPPORT - -/*! \obsolete - - Please use QApplication::font() instead. -*/ -QFont QFont::defaultFont() -{ - return QApplication::font(); -} - -/*! \obsolete - - Please use QApplication::setFont() instead. -*/ -void QFont::setDefaultFont(const QFont &f) -{ - QApplication::setFont(f); -} - -/*! - \fn qreal QFont::pointSizeFloat() const - \compat - - Use pointSizeF() instead. -*/ - -/*! - \fn void QFont::setPointSizeFloat(qreal size) - \compat - - Use setPointSizeF() instead. -*/ -#endif - - - /***************************************************************************** QFont substitution management diff --git a/src/gui/text/qfont.h b/src/gui/text/qfont.h index 8dbc746813..18c39cbe31 100644 --- a/src/gui/text/qfont.h +++ b/src/gui/text/qfont.h @@ -283,14 +283,6 @@ public: inline uint resolve() const { return resolve_mask; } inline void resolve(uint mask) { resolve_mask = mask; } -#ifdef QT3_SUPPORT - static QT3_SUPPORT QFont defaultFont(); - static QT3_SUPPORT void setDefaultFont(const QFont &); - QT3_SUPPORT void setPixelSizeFloat(qreal); - QT3_SUPPORT qreal pointSizeFloat() const { return pointSizeF(); } - QT3_SUPPORT void setPointSizeFloat(qreal size) { setPointSizeF(size); } -#endif - private: QFont(QFontPrivate *); diff --git a/src/gui/text/qfontdatabase.h b/src/gui/text/qfontdatabase.h index ae1130eadc..c9ca5dcb60 100644 --- a/src/gui/text/qfontdatabase.h +++ b/src/gui/text/qfontdatabase.h @@ -45,10 +45,6 @@ #include #include #include -#ifdef QT3_SUPPORT -#include -#include -#endif QT_BEGIN_HEADER diff --git a/src/gui/text/qfontmetrics.h b/src/gui/text/qfontmetrics.h index 5fe8676993..56e5a5c6bb 100644 --- a/src/gui/text/qfontmetrics.h +++ b/src/gui/text/qfontmetrics.h @@ -122,15 +122,6 @@ public: inline bool operator !=(const QFontMetrics &other) { return !operator==(other); } // 5.0 - remove me inline bool operator !=(const QFontMetrics &other) const { return !operator==(other); } -#ifdef QT3_SUPPORT - inline QRect boundingRect(const QString &text, int len) const - { return boundingRect(text.left(len)); } - inline QRect boundingRect(int x, int y, int w, int h, int flags, const QString& str, int len, - int tabstops=0, int *tabarray=0) const - { return boundingRect(QRect(x, y, w, h), flags, str.left(len), tabstops, tabarray); } - inline QSize size(int flags, const QString& str, int len, int tabstops=0, int *tabarray=0) const - { return size(flags, str.left(len), tabstops, tabarray); } -#endif private: #if defined(Q_WS_MAC) friend class QFontPrivate; diff --git a/src/gui/text/qtextcontrol_p.h b/src/gui/text/qtextcontrol_p.h index 31fa843a3a..dce0ca90a5 100644 --- a/src/gui/text/qtextcontrol_p.h +++ b/src/gui/text/qtextcontrol_p.h @@ -64,11 +64,6 @@ #include #include -#ifdef QT3_SUPPORT -#include -#include -#endif - QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -- cgit v1.2.3