Commit Graph

510 Commits

Author SHA1 Message Date
Craig Scott
0ebe0414d2 Fix incorrect hardware address on systems without getifaddrs()
On unix systems for which QT_NO_GETIFADDRS is defined, the way that the
hardware address field is extracted from the result of a call to
qt_safe_ioctl() is incorrect. The address of the ifreq.ifr_addr struct
is taken rather than the appropriate member within that struct, sa_data,
resulting in a memory offset and subsequently the hardware address has
garbage in the first two of six fields. This commit modifies the code
to pass the sa_data member instead of the address of the struct as a
whole.

Task-number: QTBUG-19165
Merge-request: 2614
Reviewed-by: Martin Petersson
(cherry picked from commit 004ad12669ef696eeba70fd57d1eb0c67c806d1d)
2011-05-20 10:46:47 +02:00
Martin Petersson
5a19d52ae7 Make QHostAddress.toString() follow RFC-5952 for IPv6 address format.
Task-number: QTBUG-18426
Reviewed-by: Peter Hartmann
(cherry picked from commit ebc134db484eee31491836b619aad1ee86e3070e)
2011-05-20 10:44:12 +02:00
Qt Continuous Integration System
3a88b3c9e6 Merge branch 'master' of git://scm.dev.nokia.troll.no/qt/qtbase-staging
* 'master' of git://scm.dev.nokia.troll.no/qt/qtbase-staging:
  Full translucent background support in xcb and xlib backend.
  Lighthouse xcb and xlib: Add support for transparency of GLX windows.
  Lighthouse minimal: Add support for transparency
  Compile fixes for Xlib plugin.
2011-05-20 03:08:34 +10:00
Samuel Rødal
3d34c9b78e Full translucent background support in xcb and xlib backend.
Make sure to pick an alpha visual also for non-GL surface types, and to
ask for alpha in the window format if the WA_TranslucentBackground
attribute is set.

Reviewed-by: Janusz Lewandowski
(cherry picked from commit 6241e39cff9311c943430ff2f31236b13618f2ac)
2011-05-19 19:03:23 +02:00
Janusz Lewandowski
dd43611b97 Lighthouse xcb and xlib: Add support for transparency of GLX windows.
Merge-request: 1231
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
(cherry picked from commit a3b627e1c5ce03a2500ab35c64729b1995639dcc)
2011-05-19 19:03:22 +02:00
Janusz Lewandowski
463e31fd58 Lighthouse minimal: Add support for transparency
Merge-request: 1231
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
(cherry picked from commit c15b41056e60abdbb4d835e27a360f01be618a4f)
2011-05-19 19:03:22 +02:00
Samuel Rødal
852e9766ed Compile fixes for Xlib plugin.
(cherry picked from commit 4af11f2c6666c55657569f946c33816f33711225)
2011-05-19 19:03:17 +02:00
Qt Continuous Integration System
f60b3e90e6 Merge branch 'master' of git://scm.dev.nokia.troll.no/qt/qtbase-staging
* 'master' of git://scm.dev.nokia.troll.no/qt/qtbase-staging:
  Don't crash if windowmanager is not initialized
  Compile fix for 64bit Linux.
2011-05-20 00:58:20 +10:00
Lasse Holmstedt
611837baec Don't crash if windowmanager is not initialized
This can happen if there is e.g. no wayland server.

Reviewed-by: sroedal
(cherry picked from commit aea5e35f57d061b133d2fa613d10f5e0118f5706)
2011-05-19 16:54:12 +02:00
Qt Continuous Integration System
a813d7c24a Merge branch 'master' of git://scm.dev.nokia.troll.no/qt/qtbase-staging
* 'master' of git://scm.dev.nokia.troll.no/qt/qtbase-staging:
  Wayland: send surface id + process id pairs to compositor
2011-05-19 22:53:06 +10:00
Lasse Holmstedt
a98ebc599a Wayland: send surface id + process id pairs to compositor
This enables doing window/process management since we can now
actually map the process we've launched to a window.

Reviewed-by: Samuel Rødal
(cherry picked from commit 457c33d9fd308542c9290fd60bf86960f9251255)
2011-05-19 14:44:00 +02:00
Qt Continuous Integration System
c1031d334f Merge branch 'master' of git://scm.dev.nokia.troll.no/qt/qtbase-staging
* 'master' of git://scm.dev.nokia.troll.no/qt/qtbase-staging:
  Remove warning from QColor::setNamedColor().
2011-05-19 21:55:04 +10:00
Qt Continuous Integration System
fe0a4972b8 Merge branch 'master' of git://scm.dev.nokia.troll.no/qt/qtbase-staging
* 'master' of git://scm.dev.nokia.troll.no/qt/qtbase-staging:
  Fixed compile of qdrawhelper_neon.cpp.
2011-05-19 21:21:09 +10:00
Samuel Rødal
0377b7f96d Remove warning from QColor::setNamedColor().
This warning is pointless as the user can anyway check if the color is
valid after making the call by calling isValid(). Using isValidColor()
could be used but it has a big performance overhead as validation then
needs to be done twice.

Task-number: QTBUG-19098
Reviewed-by: Erik Verbruggen
(cherry picked from commit a423ff5474b89028eeca95b254f5184311c8223b)
2011-05-19 13:17:53 +02:00
Samuel Rødal
4ec4d78711 Fixed compile of qdrawhelper_neon.cpp.
We need to use the quad-word intrinsic and reinterpret the cast to
a signed int vector.

Reviewed-by: Kim Motoyoshi Kalland <kim.kalland@nokia.com>
(cherry picked from commit d2d7aef223a3bad368c6b7c7f7f4617f4acf323c)
2011-05-19 13:16:50 +02:00
Qt Continuous Integration System
77cd5455b2 Merge branch 'master' of git://scm.dev.nokia.troll.no/qt/qtbase-staging
* 'master' of git://scm.dev.nokia.troll.no/qt/qtbase-staging:
  Compile IPC tests.
  Always call XInitThreads.
  Remove redundant #ifdef's from benchmarks
  Improve coding style of qdatastream test
  Don't use Qt3Support in arthur test suite.
  Remove Qt3Support code from QMenuBar autotest
  Remove Qt3Support code from QSplitter autotest
  Remove Qt3Support code from QSharedPointer autotest
  Remove Qt3Support code from QComboBox autotest
  Remove Qt3Support test code from accessibility autotest
  tests: allow unstable tests to be marked with CONFIG+=insignificant_test
2011-05-19 20:04:29 +10:00
Samuel Rødal
ea7277690d Better setWindowFlags() support in XCB window.
We need to re-create the native window in setParent, as used to be done
in QWidgetPrivate::setParent_sys in qwidget_x11.cpp.
2011-05-19 10:53:30 +02:00
Morten Sorvig
e0e696dd05 Remove QMAKE_MACOS_DEPLOYMENT_TARGET.
Not needed any more, 10.5 and up supports setting
the deployment target/minimum version on the
compiler command line.
2011-05-19 09:18:46 +02:00
Gunnar Sletta
105513a888 Always call XInitThreads.
Any Qt application that embeds a QSGView needs to call this
because of the threaded renderer. Today applications that
use threaded GL silently fail. In a few weeks time, the
refactor branch will be merged, which will obsolete this
change, so it is a temporary measure to get tests and
examples running.
2011-05-19 08:34:52 +02:00
Qt Continuous Integration System
4299467335 Merge branch 'master' of git://scm.dev.nokia.troll.no/qt/qtbase-staging
* 'master' of git://scm.dev.nokia.troll.no/qt/qtbase-staging:
  tests: fixed compilation of tst_qtextstream
  QUiLoader, QAbstractFormBuilder: Introduce errorString().
  Enable configuration for Xcb
  Fall back to using paths for large fonts in drawStaticText()
  Add ability to work around non-standard GLES implementations
  Fix broken drawing with large fonts using QStaticText and FreeType
  Remove Q_ASSERT's from qdbustype autotest
  Remove autotest code for Qt3Support library.
2011-05-19 10:07:06 +10:00
Friedemann Kleint
449b8a9317 QUiLoader, QAbstractFormBuilder: Introduce errorString().
Introduce errorString() to be able to obtain load errors
in Qt Designer. Remove automatic Qt 3 form conversion
from Qt Designer (since uic3 no longer exists) and move
all form load error checking logic including language
check into QAbstractFormBuilder.
Make language accessible in FormBuilderExtra in case
Jambi is revived.

Reviewed-by: hjk
2011-05-18 16:55:47 +02:00
Eckhart Koppen
b9ee8487e9 Enable configuration for Xcb
The xcb platform plugin can now be enabled using -xcb at configuration
time. A configuration time compilation check will be added at a later
point.

Reviewed-by: Samuel Rødal
2011-05-18 17:35:04 +03:00
Eskil Abrahamsen Blomfeldt
f4c1c2f939 Fall back to using paths for large fonts in drawStaticText()
QStaticText had an implicit risk which meant you had to make sure the
text size did not grow unreasonably large. This was intended to avoid
hiding the performance impact of using QStaticText for such a purpose,
but it's too inconvenient. Thus, the same fall back as in drawTextItem()
has been introduced. This will also fix a bug recently introduced when
we started using the FT cache to draw static text in the raster engine,
since this will fail for large fonts.

Task-number: QTBUG-19084, QTBUG-19370
Reviewed-by: Jiang Jiang
(cherry picked from commit 0aa9b30432cec3b7f366983f451fc9a7f8f83243)
2011-05-18 15:57:38 +02:00
Paul Olav Tvete
e8c95790d9 Add ability to work around non-standard GLES implementations
Reviewed-by: Gunnar
2011-05-18 15:31:14 +02:00
Olivier Goffart
b57a7e6994 QT_USE_QSTRINGBUILDER to fix source compatibility
In 4.8 we added support for using StringBuilder with QByteArray.
But this is breaking source compatibility for people that used
QT_USE_FAST_OPERATOR_PLUS in Qt 4.7. So we introduce a new macro

Notice that QT_USE_FAST_CONCATENATION was not working without
QT_USE_FAST_OPERATOR_PLUS, so we remove the checking of that macro.

Reviewed-by: joao
(cherry picked from commit 8447f5616be731d78081f326bb9cb3f5aa9087a4)
2011-05-18 15:17:17 +02:00
Eskil Abrahamsen Blomfeldt
5fcd60f256 Fix broken drawing with large fonts using QStaticText and FreeType
In FreeType, there's a fall back to QFontEngine::alphaMapForGlyph()
when the fonts are very large. Since this uses a QPainterPath containing
an unhinted glyph, the use of hinted metrics would sometimes lead to
the glyphs being clipped because they would be positioned slightly
outside the image they were painted into. When outline drawing is on,
it makes sense to return unhinted metrics, since the glyphs we will
actually use are unhinted.

Task-number: QTBUG-19067
Reviewed-by: Jiang Jiang
2011-05-18 14:55:03 +02:00
Samuel Rødal
2a5cc5fc62 Support Qt::WindowStaysOnTopHint and other window flags in XCB backend. 2011-05-18 12:28:09 +02:00
Morten Sorvig
864815ef2e Port Qt 5 to Mac. 2011-05-18 12:09:17 +02:00
Samuel Rødal
516f4e283b Add QWindow::setWindowModality().
Also set corresponding window manager hints in xcb plugin.
2011-05-18 09:32:17 +02:00
Samuel Rødal
10a3b10726 Re-implement transient window support in XCB backend.
If a QWindow has a parent but is top-level the corresponding
QPlatformWindow should not be re-parented but instead be made transient
for the parent window if possible.
2011-05-16 17:28:56 +02:00
Samuel Rødal
25f70314e0 Implement QWindow minimum/maximum/base size hints and size increments. 2011-05-16 16:40:32 +02:00
Lars Knoll
276d60a4d6 Merge remote branch 'origin/master' into refactor
Conflicts:
	src/modules/qt_openvg.pri
	src/widgets/to_be_moved/qlinecontrol_p.h
2011-05-16 10:19:02 +02:00
Eckhart Koppen
73e1f35fa3 Removed duplicate setting of QT dependencies
Reviewed-by: TrustMe
2011-05-13 18:36:12 +03:00
Samuel Rødal
850b602c7a Initial QPlatformWindow window state setting API and xcb implementation. 2011-05-13 15:13:15 +02:00
Eckhart Koppen
a9c2c15487 Updated default Qt version to 5.0.0
Changed default version in qbase.pri and qpluginbase.pri in case no
version is given at all.
2011-05-13 15:38:00 +03:00
Eckhart Koppen
36c29abc0d Removed deprecated functions in QList
Removed detach, detach2, detach3 and append which were marked
as required only up to 4.5.x
2011-05-13 13:47:56 +03:00
Eckhart Koppen
23d98f70b9 Updated Qt and QtBase module version number to 5.0.0
Updated version in qglobal.h as well as the module version itself
2011-05-13 13:22:30 +03:00
Eckhart Koppen
7d756ed718 Updated data stream version for Qt 4.9 and 5.0
For now, using the same version as 4.8. This needs to be corrected
when the actual data stream version is known.
2011-05-13 13:15:04 +03:00
Laszlo Agocs
542ba35f2f Fix deadlocks in wayland clipboard that can occur in special scenarios.
setMimeData() emits the changed signal always so to prevent duplicated
signals keyboardFocus() must only emit when the change came from
another wayland client. However direct connection may cause issues
when invoking the slot from a wayland callback, so use a metacall
to make sure we return from the callback. Unnecessary data transfer
and potential deadlock is now also avoided when a client is requesting
the mime data from itself.

Reviewed-by: Jørgen Lind
2011-05-13 09:27:11 +02:00
Jason McDonald
dd1a7a6379 Merge branch 'master' of git://scm.dev.nokia.troll.no/qt/qtbase-staging 2011-05-13 10:42:41 +10:00
Jason McDonald
d9119535a2 Make error checking in QSignalSpy consistent
QSignalSpy's constructor failed gracefully for some problems with the
parameters, but not for null parameters, for which there was only a
Q_ASSERT.  This commit makes the handling of null parameters consistent
with the handling of other errors -- output a meaningful error message
with qWarning() and return, so that isValid() will subsequently return
false.

Change-Id: I7f5677a4c10185e30403ce3e12a022de8c13bc1c
Task-number: QTBUG-14283
Reviewed-by: Rohan McGovern
2011-05-13 10:42:06 +10:00
Lars Knoll
1a1471718d fix compilation with namespaces
Reviewed-by: Bjørn Erik Nilsen
(cherry picked from commit 7a1c29f101b95c9cc2cb53f8b80d231b5a994a9a)
2011-05-12 22:52:49 +02:00
Lars Knoll
4214ddc1d9 Fix compilation with namespaces enabled
Reviewed-by: Samuel Rødal
(cherry picked from commit bff68fc7094a50af57f7da23ecf9b25cab00f188)
2011-05-12 16:36:48 +02:00
Frederik Gladhorn
38ed8c2ddd Make QLineControl send accessibility updates.
To make it emit the signals for the right object, it needs its parent to
be the QGraphicsItem/SGItem/QLineEdit.
According to IA2 it should emit TextUpdated and CursorMoved signals.
TextChanged is deprecated.
More fine grained signals would be desireable but this makes changes work at all.

Reviewed-by: Morten Sorvig
2011-05-12 15:59:33 +02:00
Jan-Arve Sæther
1625b25a9f Revert "Fix double painting when adding an item into a linear layout"
(It did not really fix the issue.)

This reverts commit 33f525e636ef8fa64a15d3e66c56adaea0075bda.

Conflicts:

	src/gui/graphicsview/qgraphicslinearlayout.cpp
	tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
(cherry picked from commit fee052e3e37b3335fe563cb8a1881bf59f9e25d0)
2011-05-12 15:51:02 +02:00
Sergio Ahumada
446a7ba4ff Fix licence headers again for MR 900
See commit b00089261eafbdf5f92ed94d7fb20b402bfcaeb2

Reviewed-by: Gabriel de Dietrich
(cherry picked from commit bc16ebdb7aeff70fe8149297183636ea7fd14ed1)
2011-05-12 15:48:46 +02:00
Jan-Arve Sæther
913ff73200 Avoid flicker when invalidate is propagated in a widget/layout hierarchy
* Do not call invalidate from activateRecursive().
  This resulted in that a layout was invalidated as many times as there
  were items in the layout.

* Several improvements. Do not call resize(size()) too often.
  Calling resize() from the widgetEvent() is not very nice though...

* Remove commented out code

* make sure layout is activated even if the widget does not change size

* activate the layout if the resize is same as size()

* In order to not break existing apps, make this an opt-in feature
  with QGraphicsLayout::setInstantInvalidatePropagation(true);

Reviewed-by: Frederik Gladhorn
Reviewed-by: John Tapsell
2011-05-12 15:47:26 +02:00
Gabriel de Dietrich
1ce725cb60 Fix licence headers again for MR 900
See commit b00089261eafbdf5f92ed94d7fb20b402bfcaeb2

Reviewed-by: Trust me
(cherry picked from commit 7b6a7f475119878681c9d0c06b29896ec3fe72c3)
2011-05-12 15:43:54 +02:00
Lars Knoll
6697f2a899 Merge remote branch 'origin/master' into refactor
Conflicts:
	src/gui/gui.pro
	src/gui/painting/painting.pri
	src/opengl/opengl.pro
	src/openvg/openvg.pro
2011-05-12 12:48:12 +02:00
Lars Knoll
1f806aa1b4 New algorithm for drawing thin lines
Added a new QCosmeticStroker class for drawing thin
lines. The class can handle both aliased and antialiased
lines.

The code replaces all the midpoint line drawing algorithms in
the raster paintengine and gives correct subpixel positioning
for lines.

It gives around 30% to 50% speedup against the midpoint algorithm. If
we missed that fast path, the speedup is around between a factor of
6 to 8 for lines and aliased paths and 100 and 400 for antialiased
paths.

Reviewed-by: Kim
(cherry picked from commit 37c329a3e35fabc88fbcad824a69f37c671d2132)
2011-05-12 10:36:29 +02:00
Lars Knoll
e577d02cc9 move files in src/gui into their final locations
Rename the guikernel subdir to kernel
and guiutil to util.
2011-05-11 20:18:42 +02:00
Samuel Rødal
e40443f7df Prevent crash in OpenGL engine when scaling images / pixmaps.
Make sure the resulting image / pixmap is valid if the source was valid.

Task-number: QTBUG-19157
Reviewed-by: Kim
Reviewed-by: Benjamin Poulain
(cherry picked from commit 1c5da7207a21cc44a4a08d291c290ffcd9b958fd)
2011-05-11 17:34:42 +02:00
Stephen Kelly
d49c561b73 Add the QIdentityProxyModel.
Older commit history is in KDE svn:
http://websvn.kde.org/trunk/KDE/kdelibs/kdeui/itemviews/kidentityproxymodel.cpp?view=log

Ammended to update the license headers.

Merge-request: 900
Reviewed-by: Gabriel de Dietrich <gabriel.dietrich-de@nokia.com>

Conflicts:

	doc/src/frameworks-technologies/model-view-programming.qdoc
	tests/auto/headers/tst_headers.cpp

(cherry picked from b00089261eafbdf5f92ed94d7fb20b402bfcaeb2)
2011-05-11 17:37:48 +02:00
Shane Kearns
9d1a7b21c0 update def files
Reviewed-by: Trust Me
(cherry picked from commit 84cf56543c3e9add4f06ed65cf419561117ee739)
2011-05-11 16:40:09 +02:00
Martin Petersson
483807d4f2 emit QNetWorkAccessManager::finished on QNetworkReply::abort()
If we can not get online when the request is made then we are in the
WaitingForSession state. This will happen for example if the device
is in flight mode. This fix follows the same logic as in
_q_networkSessionFailed, but we should look into why we have the
WaitingForSession check in finished().

Task-number: QT-4747
Reviewed-by: Markus Goetz
(cherry picked from commit 0c9cb9a34d6b472cb53bf1af4616af55b593b616)
2011-05-11 16:39:59 +02:00
Oswald Buddenhagen
23db871a44 make QLibraryInfo return clean paths
as a side effect, don't use QDir for path resolution - it doesn't buy us
anything.

Task-number: QTBUG-1371
Reviewed-by: joerg
(cherry picked from commit 9cd62e4f7b23894a672297f6eebda64cdbd53cb0)
2011-05-11 16:39:45 +02:00
Oswald Buddenhagen
86a6ffbc3e make relative paths in qt.conf work inside qmake
Task-number: QTBUG-11602
Reviewed-by: joerg
(cherry picked from commit e6bb6ba76942d98e4b50a7fd32bf44e211f2fa5e)
2011-05-11 16:39:43 +02:00
Shane Kearns
119da2c8d4 Sockets: Fix potential null pointer usages
QAbstractSocketEngine::createSocketEngine can return 0 as well as throw.
In two cases the pointer was being used before the null check, in a 3rd
case the null check was missing.

Reviewed-by: Markus Goetz
(cherry picked from commit 19edac88af53eea7f733cabbaee77f9b725b7ea9)
2011-05-11 16:39:40 +02:00
Markus Goetz
10646142ae QNAM: Re-order checks in migrateBackend()
Do the easy checks first, will avoid a crash in the HTTP code
if request is serviced from the cache.

Task-number: QTBUG-18770
Reviewed-by: Peter Hartmann
(cherry picked from commit d03a28a289cf0665290e6ea0375b31cbb2d6649e)
2011-05-11 16:39:29 +02:00
Miikka Heikkinen
a2e836f3c1 Fix initial main window dimensions for "fullscreen with softkeys" case
The application main window defaults to fullscreen size when initially
constructed, even if softkeys are specified for it, as the screen
furniture is constructed later in show_sys. This resulted in the main
window being partially under softkeys.
Fixed by invoking handleClientAreaChange() explicitly in show_sys in
fullscreen with softkeys case.

Task-number: QTBUG-19043
Reviewed-by: Sami Merila
(cherry picked from commit e8fc93973a41f193665baa5fdc26cba951bd692f)
2011-05-11 16:39:20 +02:00
Bjørn Erik Nilsen
1e41e3076a Fixes crash in QWidget::effectiveWinId.
Widgets are left in a transitional (and incosistent) state while being
re-parented, which caused QWidget::effectiveWinId() to crash in certain
circumstances. See patch for more details.

Auto test included.

Reviewed-by: ogoffart
(cherry picked from commit 6db0153cd7e35e4a919a76ae2aadbf2d2510bfb7)
2011-05-11 16:38:49 +02:00
Shane Kearns
7ee981a834 Fix crash when QSocketNotifier used with an invalid descriptor
select code for open C file/socket descriptors was crashing in FD_SET
if a QSocketNotifier was created with an invalid descriptor.

Added two autotests to QSocketNotifier, one to check notifiers with
bogus socket descriptors don't crash, the other to check that notifiers
with posix socket descriptors do work. (symbian socket engine doesn't
use them so they are not implicitly tested)

Reviewed-by: mread
Task-Number: QTBUG-18138
(cherry picked from commit 8a9a6afcf02f089f932bc81431ab46a60af32134)
2011-05-11 16:37:58 +02:00
Shane Kearns
fe56131236 Optimisation - buffer packet read in pendingDatagramSize
In Symbian, the OS function to get the size of a pending datagram also
includes the size of the packet header (which is different for IPv4 and
IPv6). We were reading the datagram with the "peek" flag set to
implement pendingDatagramSize, then reading again normally when the
client called read/readDatagram.

This change removes the "peek" flag, and buffers the datagram in the
socket engine, returning it and clearing the buffer when read or
readDatagram is called.
If there is no buffered data, the existing code path is followed - it
isn't mandatory to call pendingDatagramSize before reading from the
socket.

Reviewed-by: Markus Goetz
(cherry picked from commit dd8de4c2437397748daba49569cbc7f89a8bfbee)
2011-05-11 16:37:23 +02:00
Shane Kearns
7d505004f5 Remove warnings when disabling notifications on a closed socket
The generic layer calls setReadNotificationEnabled(false) on sockets
after they are closed. This no longer causes a warning from the symbian
socket engine. A warning will only be emitted if trying to enable
notifications on a closed socket.

Task-number: QTBUG-18713
Reviewed-by: Markus Goetz
(cherry picked from commit 0aa780235c24ed724fcf6a9095a6467e34b9346e)
2011-05-11 16:37:18 +02:00
Qt Continuous Integration System
1a1af689fc Merge branch 'master' of git://scm.dev.nokia.troll.no/qt/qtbase-staging
* 'master' of git://scm.dev.nokia.troll.no/qt/qtbase-staging:
  Fix tst_QVariant::invalidColor
  Move QTextCursor::MoveStyle to Qt namespace
  Add some QRawFont related low level functions to avoid extra copying
2011-05-11 23:47:33 +10:00
Jiang Jiang
16628b76c0 Move QTextCursor::MoveStyle to Qt namespace
We cannot use QTextCursor::MoveStyle enums in QTextLine because
QTextCursor is not a QObject, while referring to that enum in
Q_PROPERTY requires it to be. That's why we need to move the
enums in Qt namespace.

Reviewed-by: David Boddie
(cherry picked from commit 5eba82b752e85a5d6cb3a893214ed2646d75f362)
2011-05-11 15:28:09 +02:00
Jiang Jiang
3032ba0f8e Add some QRawFont related low level functions to avoid extra copying
Added functions:

- QRawFont::glyphIndexesForChars(const QChar *chars, int numChars,
  quint32 *glyphIndexes, int *numGlyphs) const
- QRawFont::advancesForGlyphIndexes(const quint32 *glyphIndexes,
  QPointF *advances, int numGlyphs) const

Reviewed-by: Eskil
(cherry picked from commit 965af9eb2932efae5d736df54c3859460017b6a5)
2011-05-11 15:26:34 +02:00
Samuel Rødal
47b36ae639 Deliver leave event to proper widget (not the top-level). 2011-05-11 14:40:01 +02:00
Qt Continuous Integration System
3f8923d3a5 Merge branch 'master' of git://scm.dev.nokia.troll.no/qt/qtbase-staging
* 'master' of git://scm.dev.nokia.troll.no/qt/qtbase-staging:
  Fix to commit 7fce0a73cc.
2011-05-11 22:30:28 +10:00
Kim Motoyoshi Kalland
587f7f753a Fix to commit 7fce0a73cc. 2011-05-11 14:24:45 +02:00
Samuel Rødal
ed2a2dc6da Improved popup and mouse event handling.
Use QApplicationPrivate::sendMouseEvent() to ensure hover events are
sent. Copy most of the popup handling code from qapplication_x11.cpp
2011-05-11 13:57:33 +02:00
Qt Continuous Integration System
eb5ad10b2c Merge branch 'master' of git://scm.dev.nokia.troll.no/qt/qtbase-staging
* 'master' of git://scm.dev.nokia.troll.no/qt/qtbase-staging:
  Check if OES_texture_npot is present on OpenGL ES 2.
2011-05-11 20:41:00 +10:00
Samuel Rødal
0719af99b7 Compile fixes after merge. 2011-05-11 12:39:14 +02:00
Samuel Rødal
5e2b0aa1b3 Merge remote branch 'staging/master' into refactor
Conflicts:
	src/gui/painting/qdrawhelper_p.h
	src/gui/painting/qgraphicssystemfactory.cpp
	src/gui/painting/qpainter.cpp
	src/gui/painting/qunifiedtoolbarsurface_mac.cpp
	src/gui/painting/qunifiedtoolbarsurface_mac_p.h
	src/openvg/openvg.pro
	src/openvg/qpaintengine_vg.cpp
	src/openvg/qwindowsurface_vg.cpp
	src/openvg/qwindowsurface_vgegl.cpp
	src/plugins/platforms/wayland/qwaylanddisplay.cpp
	src/widgets/graphicsview/qgraphicsscene.cpp
2011-05-11 12:39:09 +02:00
Kim Motoyoshi Kalland
7fce0a73cc Check if OES_texture_npot is present on OpenGL ES 2.
Unless the OES_texture_npot extension is present, non-power-
of-two textures have some restrictions on OpenGL ES 2.

Reviewed-by: Samuel
2011-05-11 11:59:50 +02:00
Qt Continuous Integration System
2de195b450 Merge branch 'master' of git://scm.dev.nokia.troll.no/qt/qtbase-staging
* 'master' of git://scm.dev.nokia.troll.no/qt/qtbase-staging:
  Prevent crash in wayland mimedata in case there is no offer.
2011-05-11 02:07:56 +10:00
Laszlo Agocs
8e8e0b26b6 Prevent crash in wayland mimedata in case there is no offer. 2011-05-10 18:03:43 +02:00
Qt Continuous Integration System
ff112f47c8 Merge branch 'master' of git://scm.dev.nokia.troll.no/qt/qtbase-earth-staging
* 'master' of git://scm.dev.nokia.troll.no/qt/qtbase-earth-staging:
  Add QT_xxx_VERSION macros for each library in qtbase
2011-05-11 00:10:15 +10:00
Laszlo Agocs
20594a6d5b Prevent having Status undefined in xlib platform plug-in.
Commit 4b75ceea08 changed
qcoreapplication_p.h to include qsettings.h, which undefines Status.
This breaks the xlib platform plug-in (and its includes).
2011-05-10 15:42:01 +02:00
Liang Qi
45cdd701fa Add QT_xxx_VERSION macros for each library in qtbase
Provide version info for each library like QTCORE_VERSION and etc.

Task-number: QTMODULARIZATION-44
Reviewed-by: axis
2011-05-10 15:15:15 +02:00
Olivier Goffart
48b7c870ec Merge remote-tracking branch 'staging/master' 2011-05-10 13:15:10 +02:00
Eskil Abrahamsen Blomfeldt
f0857b7667 Compile on Mac
Missing API update in Q_WS_MAC block

Reviewed-by: Jiang Jiang
(cherry picked from commit 4b95d9939db75d7bd55db4bbbf2d67af459f7eb5)
2011-05-10 13:14:41 +02:00
Oswald Buddenhagen
1e331968e1 ifdef out mac/no_coreservices path more cleanly
the symbian path was also dead
(cherry picked from commit 76ac26383922b4c452592a9175e7f3b9b3fd2513)
2011-05-10 12:54:57 +02:00
Oswald Buddenhagen
00bfc268c4 fix build on symbian
provide dummy implementation of QProcessEnvironment::systemEnvironment()
(cherry picked from commit e4920a4b4bc454ad309324a62db0e9257bba7367)
2011-05-10 12:54:56 +02:00
Alexander Potashev
342d2a253c Allow different text for undo actions and items in QUndoView
Now the texts used for undo actions and for items in QUndoView can
be set separately. This introduces an extended format of text that
can be passed to QUndoCommand::setText or QUndoCommand constructor.

The action text can now contain two strings separated by a "\n". The
first string (that goes before "\n") is then returned by
QUndoCommand::text() and used as name of item in QUndoView.
The second string (that goes after "\n") is returned by
QUndoCommand::actionText() and used when the text properties of the
undo and redo actions are updated.

If the text passed to QUndoCommand does not contain "\n", everything
works as before, and both QUndoCommand::text() and
QUndoCommand::actionText() return the same string.

Even though action text in English usually does not need different forms
for undo actions and QUndoView item, translators can employ this new
command text format, for example to adjust the grammatical case used in
command text to match the context of "Undo %1"/"Redo %1".

Merge-request: 2610
Reviewed-by: ossi
(cherry picked from commit 9b784789c75d59b27530bbf1d12676cc44f64f46)
2011-05-10 12:54:56 +02:00
Alexander Potashev
ec4d346f95 Allow using not only prefixes for undo command text
Functions QUndo{Group,Stack}::create{Undo,Redo}Action() now use action
text templates "Undo %1" and "Redo %1" if no custom prefix was provided.

This makes more flexible translations possible. The surrounding text
(like "Undo" and "Redo") can now be suffixed to the command name as
German and Korean languages require ("%1 rueckgaengig machen" for German).

Also, now the default action text (when no command can be undone) can be
translated differently from the prefix. For example, it can be
translated as "Undo action", not just "Undo".

When a non-empty prefix is passed to QUndo*****::create****Action(),
those functions work as before, and the features described above become
unavailable.

Task-number: QTBUG-14442
Merge-request: 1212
Reviewed-by: ossi
(cherry picked from commit 213c25ad24e4f3b0a44f82f23d34746cd294f8d6)
2011-05-10 12:54:56 +02:00
Pino Toscano
e04ad81dc4 QFileSystemEngine::currentPath(): use QFileSystemEntry() also for the no-PATH_MAX case
... in the same way as done in the other code path.

This makes qmake/QtCore compile again on glibc systems without PATH_MAX (e.g. GNU/Hurd).

Merge-request: 1218
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
(cherry picked from commit c8812fe6e642520532d65744caefcea790d59de8)
2011-05-10 12:54:56 +02:00
Bradley T. Hughes
a6c8d0ba56 Do not allow multiple threads to acquire a QMutex
After the mutex optimizations on Mac, we did not handle the case where
semaphore_wait() could return KERN_ABORTED. Under heavy contention, this
happens, and when running in release mode, the assert in qmutex.cpp is not
executed. The code silently allows multiple threads to continue as if it
had acquired the mutex exclusively.

Fix this by checking for KERN_ABORTED from semaphore_wait(), and retry the
wait. We do not handle KERN_ABORTED for timed waits, simply return false and
let the code doing the tryLock() handle it how it deems best.

Reviewed-by: joao
(cherry picked from commit b54af0a9d6406356616889826e31925d2fa05718)
2011-05-10 12:54:56 +02:00
Robin Burchell
0bb70c3164 Ensure that QDateTimeEdit::calendarWidget() will always return a valid widget.
This case may be triggered in the (admittedly slightly abnormal) case where a
user wishes to embed the calendar widget in a layout or, for whatever reason, do
something else that will change its ownership.

We work around this by detecting when it is deleted and recreating the widget.

This will also have a positive side effect if setCalendarWidget() is called with
a widget which is then subsequently deleted, returning the default widget
instead of a pointer to (now deleted) memory.

Reviewed-by: Denis Dzyubenko

Merge-request: 2568
Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
(cherry picked from commit 124ec3200f8453142717fcfe7a4aa0a55164aaa6)
2011-05-10 12:54:56 +02:00
Oswald Buddenhagen
202df2ae89 don't crash in QProcessEnvironment::systemEnvironment()
as the implementations moved to platform-specific files, the
QSharedDataPointer<QProcessEnvironmentPrivate>::detach() specialization
needs to go to the private header.

Reviewed-by: thiago
(cherry picked from commit c79246683a5033f605acd59d1c37d68381383a06)
2011-05-10 12:54:56 +02:00
Peter Hartmann
f38a639a41 HTTP backend: do not load resources from cache that must be revalidated
The header field "Cache-Control: must-revalidate" is a strict
requirement for loading the resource from the server, and not reading it
from the cache without revalidating first. With this patch, PreferCache
will load such from the network instead of loading them from the cache,
and AlwaysCache will throw a ContentNotFound error.

Reviewed-by: Markus Goetz
Task-number: QTBUG-18983
(cherry picked from commit 0e449f38894b1bd2dbb2f14206a011424679f063)
2011-05-10 12:54:56 +02:00
Denis Dzyubenko
bf89190cfb Compile fix for QLocale on Symbian.
The previous change added new ELangEnglish_India that doesn't
necesserally present in all SDKs.

Reviewed-by: trustme
(cherry picked from commit 154ab1cb4c4cdf34f21fc93b078f91cc79048bd4)
2011-05-10 12:54:56 +02:00
Denis Dzyubenko
563ab2e16c Added Kazakh language to the QLocale mapping table on Symbian.
Reviewed-by: trustme
(cherry picked from commit c6808af66d45541546b30c8e6de155b9812b4ef9)
2011-05-10 12:54:55 +02:00
Denis Dzyubenko
fc7aaa5c48 Added support for QLocale::uiLanguages on Symbian.
Extended the mapping table that matches symbian device languages to a
locale name and language code.

Task-number: QTBUG-7329
Reviewed-by: trustme
(cherry picked from commit 93233fc811920002d5b5b8272d9b5b8d5d3e2b98)
2011-05-10 12:54:55 +02:00
Olivier Goffart
74dda83074 Fix drawing text in item view:
Put back code that was removed by mistake in e8019cf8feb402303e6d253f5ca58bebfda42679

Task-number: QTBUG-18998
(cherry picked from commit bbbd4b8f3949b58d4fd21854241cb46cbc024a80)
2011-05-10 12:54:55 +02:00
João Abecasis
1787e557e8 Don't rely on uninitialized data
HB_GetCharAttributes used to require a zero-initialized array for
attributes, as it selectively sets relevant bits for each character. We
ease that requirement by always initializing the attributes buffer
explicitly with memset.

Task-number: QT-4911
Reviewed-by: Ritt Konstantin
(cherry picked from commit 4cb9db404224c55859713c282aa90409e375c372)
2011-05-10 12:54:55 +02:00
João Abecasis
e6e6e4c169 Don't realloc user-provided buffer
When QTextBoundaryFinder doesn't own the buffer, don't realloc it and
get a new one instead.

Reviewed-by: Ritt Konstantin
(cherry picked from commit 320f172c851a4720299297c8b3b757eb1202c568)
2011-05-10 12:54:55 +02:00
Samuel Rødal
978fc98bff Fixed bug in X11 backend when creating translucent windows.
We forgot to send the ParentAboutToChange event, which meant QGLWidget
didn't destroy the old EGL surface. This could cause two EGL surfaces to
be created for the same QGLWidget, which leads to undefined behaviour on
some platforms.
(cherry picked from commit 5a834d7141cc7d29d022911ccec16e628d94acf1)
2011-05-10 12:54:54 +02:00
Janne Anttila
2d07ca2cbd Clarified sendCustomRequest documentation to include HTTPS
Reviewed-By: mgoetz
(cherry picked from commit 16b8c940dac02ec77e6ff9fe4150c32db1811e74)
2011-05-10 12:54:54 +02:00
Olivier Goffart
94beee1c37 Fix compilation
Conflicts between 61c6d66b7efd8de4a83b021e7c4ef2b1a803ece2 and 940f16babab76b328b7c9bfdb5435102c689b76b
(cherry picked from commit 7a20cf9d4419cf1a5a9a4ed450b03caa8716fd58)
2011-05-10 12:54:54 +02:00