diff options
Diffstat (limited to 'src/gui')
26 files changed, 78 insertions, 46 deletions
diff --git a/src/gui/accessible/qaccessible.h b/src/gui/accessible/qaccessible.h index c77aa0bcb9..016e9b6d07 100644 --- a/src/gui/accessible/qaccessible.h +++ b/src/gui/accessible/qaccessible.h @@ -282,10 +282,10 @@ public: Canvas = 0x00000035, Animation = 0x00000036, Equation = 0x00000037, - ButtonDropDown = 0x00000038, + ButtonDropDown = 0x00000038, // The object represents a button that expands a grid. ButtonMenu = 0x00000039, ButtonDropGrid = 0x0000003A, - Whitespace = 0x0000003B, + Whitespace = 0x0000003B, // The object represents blank space between other objects. PageTabList = 0x0000003C, Clock = 0x0000003D, Splitter = 0x0000003E, diff --git a/src/gui/doc/qtgui.qdocconf b/src/gui/doc/qtgui.qdocconf index 469aa00472..fcf6cdf57c 100644 --- a/src/gui/doc/qtgui.qdocconf +++ b/src/gui/doc/qtgui.qdocconf @@ -2,22 +2,22 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) project = QtGui description = Qt GUI Reference Documentation -url = http://qt-project.org/doc/qtgui -version = 5.1.0 +url = http://qt-project.org/doc/qt-$QT_VER/qtgui +version = $QT_VERSION examplesinstallpath = gui qhp.projects = QtGui qhp.QtGui.file = qtgui.qhp -qhp.QtGui.namespace = org.qt-project.qtgui.510 +qhp.QtGui.namespace = org.qt-project.qtgui.$QT_VERSION_TAG qhp.QtGui.virtualFolder = qtgui qhp.QtGui.indexTitle = Qt GUI qhp.QtGui.indexRoot = -qhp.QtGui.filterAttributes = qtgui 5.1.0 qtrefdoc -qhp.QtGui.customFilters.Qt.name = Qtgui 5.1.0 -qhp.QtGui.customFilters.Qt.filterAttributes = qtgui 5.1.0 +qhp.QtGui.filterAttributes = qtgui $QT_VERSION qtrefdoc +qhp.QtGui.customFilters.Qt.name = Qtgui $QT_VERSION +qhp.QtGui.customFilters.Qt.filterAttributes = qtgui $QT_VERSION qhp.QtGui.subprojects = classes qhp.QtGui.subprojects.classes.title = C++ Classes diff --git a/src/gui/doc/snippets/code/src_gui_painting_qpainter.cpp b/src/gui/doc/snippets/code/src_gui_painting_qpainter.cpp index 79cef3b5ef..6a012879d4 100644 --- a/src/gui/doc/snippets/code/src_gui_painting_qpainter.cpp +++ b/src/gui/doc/snippets/code/src_gui_painting_qpainter.cpp @@ -213,7 +213,7 @@ painter.drawPixmap(target, image, source); //! [17] QPainter painter(this); -painter.drawText(rect, Qt::AlignCenter, tr("Qt by\nNokia")); +painter.drawText(rect, Qt::AlignCenter, tr("Qt\nProject")); //! [17] diff --git a/src/gui/image/qbmphandler.cpp b/src/gui/image/qbmphandler.cpp index 062714c769..6abde5e420 100644 --- a/src/gui/image/qbmphandler.cpp +++ b/src/gui/image/qbmphandler.cpp @@ -143,7 +143,7 @@ static QDataStream &operator<<(QDataStream &s, const BMP_INFOHDR &bi) return s; } -static int calc_shift(int mask) +static int calc_shift(uint mask) { int result = 0; while (mask && !(mask & 1)) { @@ -207,9 +207,9 @@ static bool read_dib_body(QDataStream &s, const BMP_INFOHDR &bi, int offset, int #endif int w = bi.biWidth, h = bi.biHeight, nbits = bi.biBitCount; int t = bi.biSize, comp = bi.biCompression; - int red_mask = 0; - int green_mask = 0; - int blue_mask = 0; + uint red_mask = 0; + uint green_mask = 0; + uint blue_mask = 0; int red_shift = 0; int green_shift = 0; int blue_shift = 0; diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index de1e555771..975ef54d6b 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -99,8 +99,6 @@ QImageData::QImageData() format(QImage::Format_ARGB32), bytes_per_line(0), ser_no(qimage_serial_number.fetchAndAddRelaxed(1)), detach_no(0), - ldpmx(qt_defaultDpiX() * 100 / qreal(2.54)), - ldpmy(qt_defaultDpiY() * 100 / qreal(2.54)), dpmx(qt_defaultDpiX() * 100 / qreal(2.54)), dpmy(qt_defaultDpiY() * 100 / qreal(2.54)), offset(0, 0), own_data(true), ro_data(false), has_alpha_clut(false), @@ -4984,11 +4982,11 @@ int QImage::metric(PaintDeviceMetric metric) const return d->depth; case PdmDpiX: - return qRound(d->ldpmx * 0.0254); + return qRound(d->dpmx * 0.0254); break; case PdmDpiY: - return qRound(d->ldpmy * 0.0254); + return qRound(d->dpmy * 0.0254); break; case PdmPhysicalDpiX: diff --git a/src/gui/image/qimage_p.h b/src/gui/image/qimage_p.h index e79eb9d562..18c686e917 100644 --- a/src/gui/image/qimage_p.h +++ b/src/gui/image/qimage_p.h @@ -82,10 +82,8 @@ struct Q_GUI_EXPORT QImageData { // internal image data int ser_no; // serial number int detach_no; - qreal ldpmx; // logical dots per meter X (or 0) - qreal ldpmy; // logical dots per meter Y (or 0) - qreal dpmx; // device dots per meter X (or 0) - qreal dpmy; // device dots per meter Y (or 0) + qreal dpmx; // dots per meter X (or 0) + qreal dpmy; // dots per meter Y (or 0) QPoint offset; // offset in pixels uint own_data : 1; diff --git a/src/gui/image/qimagereader.cpp b/src/gui/image/qimagereader.cpp index 286169426e..89930f3b20 100644 --- a/src/gui/image/qimagereader.cpp +++ b/src/gui/image/qimagereader.cpp @@ -162,11 +162,14 @@ enum _qt_BuiltInFormatType { #endif #ifndef QT_NO_IMAGEFORMAT_JPEG _qt_JpgFormat, + _qt_JpegFormat, #endif #ifdef QT_BUILTIN_GIF_READER _qt_GifFormat, #endif +#ifndef QT_NO_IMAGEFORMAT_BMP _qt_BmpFormat, +#endif #ifndef QT_NO_IMAGEFORMAT_PPM _qt_PpmFormat, _qt_PgmFormat, @@ -195,11 +198,14 @@ static const _qt_BuiltInFormatStruct _qt_BuiltInFormats[] = { #endif #ifndef QT_NO_IMAGEFORMAT_JPEG {_qt_JpgFormat, "jpg", "image/jpeg"}, + {_qt_JpegFormat, "jpeg"}, #endif #ifdef QT_BUILTIN_GIF_READER {_qt_GifFormat, "gif", "image/gif"}, #endif +#ifndef QT_NO_IMAGEFORMAT_BMP {_qt_BmpFormat, "bmp", "image/bmp"}, +#endif #ifndef QT_NO_IMAGEFORMAT_PPM {_qt_PpmFormat, "ppm", "image/x-portable-pixmap"}, {_qt_PgmFormat, "pgm", "image/x-portable-graymap"}, @@ -423,6 +429,7 @@ static QImageIOHandler *createReadHandlerHelper(QIODevice *device, #endif #ifndef QT_NO_IMAGEFORMAT_JPEG case _qt_JpgFormat: + case _qt_JpegFormat: if (QJpegHandler::canRead(device)) handler = new QJpegHandler; break; diff --git a/src/gui/image/qimagewriter.cpp b/src/gui/image/qimagewriter.cpp index 9ce3a774ed..8823f9293d 100644 --- a/src/gui/image/qimagewriter.cpp +++ b/src/gui/image/qimagewriter.cpp @@ -728,7 +728,9 @@ void supportedImageHandlerMimeTypes(QFactoryLoader *loader, QList<QByteArray> QImageWriter::supportedImageFormats() { QSet<QByteArray> formats; +#ifndef QT_NO_IMAGEFORMAT_BMP formats << "bmp"; +#endif #ifndef QT_NO_IMAGEFORMAT_PPM formats << "pbm" << "pgm" << "ppm"; #endif diff --git a/src/gui/image/qpicture.cpp b/src/gui/image/qpicture.cpp index bfc31930dd..f6de22851d 100644 --- a/src/gui/image/qpicture.cpp +++ b/src/gui/image/qpicture.cpp @@ -1278,6 +1278,7 @@ QList<QByteArray> QPicture::outputFormats() \ingroup painting \ingroup io + \inmodule QtGui QPictureIO contains a QIODevice object that is used for picture data I/O. The programmer can install new picture file formats in addition diff --git a/src/gui/image/qpictureformatplugin.cpp b/src/gui/image/qpictureformatplugin.cpp index bef72595ad..29d6912201 100644 --- a/src/gui/image/qpictureformatplugin.cpp +++ b/src/gui/image/qpictureformatplugin.cpp @@ -53,6 +53,7 @@ QT_BEGIN_NAMESPACE for custom picture format plugins. \ingroup plugins + \inmodule QtGui The picture format plugin is a simple plugin interface that makes it easy to create custom picture formats that can be used diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index ed477e767b..85f0dc2d92 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -763,6 +763,8 @@ bool QPixmap::load(const QString &fileName, const char *format, Qt::ImageConvers return false; } + detach(); + QFileInfo info(fileName); QString key = QLatin1String("qt_pixmap") % info.absoluteFilePath() diff --git a/src/gui/image/qpixmapcache.cpp b/src/gui/image/qpixmapcache.cpp index 47d6f33634..f4d2afed7a 100644 --- a/src/gui/image/qpixmapcache.cpp +++ b/src/gui/image/qpixmapcache.cpp @@ -75,22 +75,20 @@ QT_BEGIN_NAMESPACE behavior of the QHash and QCache classes. The cache becomes full when the total size of all pixmaps in the - cache exceeds cacheLimit(). The initial cache limit is - 2048 KB (2 MB) on embedded platforms, 10240 KB (10 MB) on desktop - platforms; you can change this by calling setCacheLimit() with the - required value. + cache exceeds cacheLimit(). The initial cache limit is 10240 KB (10 MB); + you can change this by calling setCacheLimit() with the required value. A pixmap takes roughly (\e{width} * \e{height} * \e{depth})/8 bytes of memory. The \e{Qt Quarterly} article - \l{http://qt.nokia.com/doc/qq/qq12-qpixmapcache.html}{Optimizing + \l{http://doc.qt.digia.com/qq/qq12-qpixmapcache.html}{Optimizing with QPixmapCache} explains how to use QPixmapCache to speed up applications by caching the results of painting. \sa QCache, QPixmap */ -static int cache_limit = 10240; // 10 MB cache limit for desktop +static int cache_limit = 10240; // 10 MB cache limit /*! \class QPixmapCache::Key @@ -596,8 +594,7 @@ bool QPixmapCache::replace(const Key &key, const QPixmap &pixmap) /*! Returns the cache limit (in kilobytes). - The default cache limit is 2048 KB on embedded platforms, 10240 KB on - desktop platforms. + The default cache limit is 10240 KB. \sa setCacheLimit() */ @@ -610,8 +607,7 @@ int QPixmapCache::cacheLimit() /*! Sets the cache limit to \a n kilobytes. - The default setting is 2048 KB on embedded platforms, 10240 KB on - desktop platforms. + The default setting is 10240 KB. \sa cacheLimit() */ diff --git a/src/gui/itemmodels/qstandarditemmodel.cpp b/src/gui/itemmodels/qstandarditemmodel.cpp index 3a6c0804ab..d6161671b1 100644 --- a/src/gui/itemmodels/qstandarditemmodel.cpp +++ b/src/gui/itemmodels/qstandarditemmodel.cpp @@ -1470,7 +1470,7 @@ void QStandardItem::insertRow(int row, const QList<QStandardItem*> &items) } /*! - Inserts \a items at \a row. The column count wont be changed. + Inserts \a items at \a row. The column count won't be changed. \sa insertRow(), insertColumn() */ diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index 33e3b7e1b7..e9527bdc48 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -58,6 +58,7 @@ QT_BEGIN_NAMESPACE /*! \class QEnterEvent \ingroup events + \inmodule QtGui \brief The QEnterEvent class contains parameters that describe an enter event. @@ -144,6 +145,7 @@ QInputEvent::~QInputEvent() /*! \class QMouseEvent \ingroup events + \inmodule QtGui \brief The QMouseEvent class contains parameters that describe a mouse event. @@ -412,6 +414,7 @@ QMouseEvent::~QMouseEvent() /*! \class QHoverEvent \ingroup events + \inmodule QtGui \brief The QHoverEvent class contains parameters that describe a mouse event. @@ -797,6 +800,7 @@ QWheelEvent::QWheelEvent(const QPointF &pos, const QPointF& globalPos, \brief The QKeyEvent class describes a key event. \ingroup events + \inmodule QtGui Key events are sent to the widget with keyboard input focus when keys are pressed or released. @@ -1728,6 +1732,7 @@ QContextMenuEvent::QContextMenuEvent(Reason reason, const QPoint &pos) /*! \class QInputMethodEvent::Attribute + \inmodule QtGui \brief The QInputMethodEvent::Attribute class stores an input method attribute. */ @@ -1752,7 +1757,7 @@ QInputMethodEvent::QInputMethodEvent() } /*! - Construcs an event of type QEvent::InputMethod. The + Constructs an event of type QEvent::InputMethod. The preedit text is set to \a preeditText, the attributes to \a attributes. diff --git a/src/gui/kernel/qgenericplugin.cpp b/src/gui/kernel/qgenericplugin.cpp index c3301a4e34..98709804de 100644 --- a/src/gui/kernel/qgenericplugin.cpp +++ b/src/gui/kernel/qgenericplugin.cpp @@ -48,6 +48,7 @@ QT_BEGIN_NAMESPACE /*! \class QGenericPlugin \ingroup plugins + \inmodule QtGui \brief The QGenericPlugin class is an abstract base class for plugins. diff --git a/src/gui/kernel/qgenericpluginfactory.cpp b/src/gui/kernel/qgenericpluginfactory.cpp index cecaf060ce..8e3b45d1a8 100644 --- a/src/gui/kernel/qgenericpluginfactory.cpp +++ b/src/gui/kernel/qgenericpluginfactory.cpp @@ -61,6 +61,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, /*! \class QGenericPluginFactory \ingroup plugins + \inmodule QtGui \brief The QGenericPluginFactory class creates plugin drivers. diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index c73eeadbfb..3a8428b332 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -851,15 +851,6 @@ void QGuiApplicationPrivate::createPlatformIntegration() // Load the platform integration QString platformPluginPath = QLatin1String(qgetenv("QT_QPA_PLATFORM_PLUGIN_PATH")); - // On Mac, look inside the application bundle for the platform plugin. - // TODO (msorvig): Create proper cross-platform solution for loading - // deployed platform plugins -#ifdef Q_OS_MAC - const QString bundlePluginPath = QCoreApplication::applicationDirPath() + QLatin1String("../Plugins/"); - if (platformPluginPath.isEmpty() && QDir(bundlePluginPath).exists()) { - platformPluginPath = bundlePluginPath; - } -#endif QByteArray platformName; #ifdef QT_QPA_DEFAULT_PLATFORM_NAME diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp index bf3de0de8d..645c13a2ea 100644 --- a/src/gui/kernel/qopenglcontext.cpp +++ b/src/gui/kernel/qopenglcontext.cpp @@ -165,7 +165,7 @@ QOpenGLContext *QOpenGLContextPrivate::setCurrentContext(QOpenGLContext *context QGuiGLThreadContext *threadContext = qwindow_context_storage.localData(); if (!threadContext) { if (!QThread::currentThread()) { - qWarning("No QTLS available. currentContext wont work"); + qWarning("No QTLS available. currentContext won't work"); return 0; } threadContext = new QGuiGLThreadContext; @@ -667,7 +667,7 @@ QScreen *QOpenGLContext::screen() const } /*! - internal: Needs to have a pointer to qGLContext. But since this is in Qt GUI we cant + internal: Needs to have a pointer to qGLContext. But since this is in Qt GUI we can't have any type information. \internal diff --git a/src/gui/kernel/qplatformsystemtrayicon_qpa.cpp b/src/gui/kernel/qplatformsystemtrayicon_qpa.cpp index 0976bf320d..13de2c658a 100644 --- a/src/gui/kernel/qplatformsystemtrayicon_qpa.cpp +++ b/src/gui/kernel/qplatformsystemtrayicon_qpa.cpp @@ -48,6 +48,7 @@ QT_BEGIN_NAMESPACE /*! \class QPlatformSystemTrayIcon + \inmodule QtGui \brief The QPlatformSystemTrayIcon class abstracts the system tray icon and interaction. \sa QSystemTray diff --git a/src/gui/kernel/qplatformwindow.cpp b/src/gui/kernel/qplatformwindow.cpp index 88a82b12a3..1eec6bfefc 100644 --- a/src/gui/kernel/qplatformwindow.cpp +++ b/src/gui/kernel/qplatformwindow.cpp @@ -42,6 +42,7 @@ #include "qplatformwindow.h" #include "qplatformwindow_p.h" +#include <private/qguiapplication_p.h> #include <qpa/qwindowsysteminterface.h> #include <QtGui/qwindow.h> #include <QtGui/qscreen.h> @@ -437,6 +438,29 @@ bool QPlatformWindow::frameStrutEventsEnabled() const } /*! + Call this method to put together a window title composed of + \a title + \a separator + the application display name + + If the display name isn't set, and the title is empty, the raw app name is used. +*/ +QString QPlatformWindow::formatWindowTitle(const QString &title, const QString &separator) +{ + QString fullTitle = title; + if (QGuiApplicationPrivate::displayName) { + // Append display name, if set. + if (!fullTitle.isEmpty()) + fullTitle += separator; + fullTitle += *QGuiApplicationPrivate::displayName; + } else if (fullTitle.isEmpty()) { + // Don't let the window title be completely empty, use the app name as fallback. + fullTitle = QCoreApplication::applicationName(); + } + return fullTitle; +} + +/*! \class QPlatformWindow \since 4.8 \internal diff --git a/src/gui/kernel/qplatformwindow.h b/src/gui/kernel/qplatformwindow.h index 2fa5d3ed0b..e3e460b54c 100644 --- a/src/gui/kernel/qplatformwindow.h +++ b/src/gui/kernel/qplatformwindow.h @@ -129,6 +129,8 @@ public: virtual bool frameStrutEventsEnabled() const; protected: + static QString formatWindowTitle(const QString &title, const QString &separator); + QScopedPointer<QPlatformWindowPrivate> d_ptr; private: Q_DISABLE_COPY(QPlatformWindow) diff --git a/src/gui/kernel/qsurfaceformat.cpp b/src/gui/kernel/qsurfaceformat.cpp index 6d42613727..25b603bb9c 100644 --- a/src/gui/kernel/qsurfaceformat.cpp +++ b/src/gui/kernel/qsurfaceformat.cpp @@ -130,7 +130,6 @@ public: \value StereoBuffers Used to request stereo buffers in the surface format. \value DebugContext Used to request a debug context with extra debugging information. - This requires OpenGL version 3.0 or higher. \value DeprecatedFunctions Used to request that deprecated functions be included in the OpenGL context profile. If not specified, you should get a forward compatible context without support functionality marked as deprecated. This requires OpenGL version 3.0 or higher. diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index bf3eb67778..69ae30389e 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -1316,7 +1316,7 @@ void QWindow::setFramePosition(const QPoint &point) if (d->platformWindow) { d->platformWindow->setGeometry(QRect(point, size())); } else { - d->geometry.setTopLeft(point); + d->geometry.moveTopLeft(point); } } diff --git a/src/gui/opengl/qopengl.h b/src/gui/opengl/qopengl.h index adb8cbd962..a4a626a0c4 100644 --- a/src/gui/opengl/qopengl.h +++ b/src/gui/opengl/qopengl.h @@ -93,6 +93,7 @@ typedef GLfloat GLdouble; # if defined(Q_OS_WIN) # include <QtCore/qt_windows.h> # endif +# define GL_GLEXT_LEGACY // Prevents GL/gl.h form #including system glext.h # include <GL/gl.h> # include <QtGui/qopenglext.h> # endif // Q_OS_MAC diff --git a/src/gui/painting/qpaintdevice.qdoc b/src/gui/painting/qpaintdevice.qdoc index 5582f777a5..7397dc7fc2 100644 --- a/src/gui/painting/qpaintdevice.qdoc +++ b/src/gui/painting/qpaintdevice.qdoc @@ -31,6 +31,7 @@ can be painted on with QPainter. \ingroup painting + \inmodule QtGui A paint device is an abstraction of a two-dimensional space that can be drawn on using a QPainter. Its default coordinate system has diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index fd867ebde6..801a5689c1 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -296,6 +296,7 @@ QRasterPaintEnginePrivate::QRasterPaintEnginePrivate() : \class QRasterPaintEngine \preliminary \ingroup qws + \inmodule QtGui \since 4.2 \brief The QRasterPaintEngine class enables hardware acceleration |