Commit Graph

9623 Commits

Author SHA1 Message Date
Caroline Chao
01a985ac5b Test: Remove QSKIP from tst_QLineEdit::taskQTBUG_7395_readOnlyShortcut
The test is passing on Ubuntu 11.10.

Adding qWaitForWindowExposed after the line edit show() call to ensure
the line edit is actually shown on the screen.

Task-number: QTBUG-24518
Change-Id: I2af65bef76d171b36032120738dfbd7cfff51d7f
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-09-25 18:36:01 +02:00
Joerg Bornemann
461a01c1df qmake: support for Visual Studio 2012 project files added
The differences to VS 2010 project files are the
version number (surprise!) and the PlatformToolSet tag which
sets the version of the toolchain.

Change-Id: If26f08fad1a69d7e6cd28cc5e860ff964f19b264
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2012-09-25 07:26:37 +02:00
Marc Mutz
07c44f7bd3 QFileInfoGatherer: general cleanups
- fix typo in comment
- make translateDriveName file-static
- use QList::reserve()
- explicit ctor
- annotate functions called by owning thread/run()
- iconProvider() and resolveSymlinks() shouldn't be slots
- private instead of protected
- run() marked Q_DECL_OVERRIDE
- annotate which members are protected by 'mutex'

Change-Id: Ic176a030b0597c98f48185efd17260fd62532460
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2012-09-25 00:08:16 +02:00
João Abecasis
0c2b7b1020 Fix default-constructed QFileSystemEntry
Member variables for lastSeparator, first and lastDotInFileName are now
initialized to -1 (non-existing), where the previous value of zero would
mean a separator/dot at that position and resulted in path() returning
'/', instead of '.'.

Tests were expanded for better coverage of empty state and
default-constructed instances.

Change-Id: Ie27547886b52224d38b5be0b4f920c9927fd440f
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-09-25 00:08:16 +02:00
Lars Knoll
ba2c485c55 Ignore the QT_NAMESPACE for moc runs
Moc should not see a defined QT_NAMESPACE, to
keep the names of all symbols consistent with
an un-namespaced Qt.

Change-Id: Ia72afabaa0820b02a0863148510122ce942a5082
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-09-25 00:08:16 +02:00
Lars Knoll
6ddef0007a Test case for moc handling defines
Added some test cases that check that moc
correctly expands #defines

Change-Id: I7fe6eed129d46ca9281d73064571cae43b32410d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-09-25 00:08:16 +02:00
Lars Knoll
789f929907 Moc: Correctly expand macros with arguments
Moc now supports full expansion of macros with arguments
with the exception of some keywords such as Q_OBJECT
and others that are used internally

Change-Id: I283d47152f75de81ec68a3df1f0f2273f11c5149
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-09-25 00:08:16 +02:00
Lars Knoll
99194d1db6 Moc: Make # and ## valid tokens in cpp parsing mode
This is required so preprocessing macros with arguments
can work correctly.

Change-Id: Ia30ede6a3579be13800bf1255d313748e2d696f9
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-09-25 00:08:16 +02:00
Lars Knoll
38f1b4eeae Correctly parse function macros
Parse function macros and add it's list of arguments
to the Macro definition.

Change-Id: Id22f5cf4a1c098f7b4f5b72f002900cd40d03e0f
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-09-25 00:08:16 +02:00
Lars Knoll
34a3b63dc7 Correctly expand macros without arguments in moc
This helps e.g. cases where a namespace is defined
through a macro and moc doesn't see it at all.

Expanding macros with arguments is significantly more
work, and should happen in a separate commit.

Change-Id: Ic8d0443d06fab2ed343115d8c43022f2c67ec3cd
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-09-25 00:08:16 +02:00
J-P Nurmi
0077b1e3a0 qdbusmetatype_p.h: add missing QT_NO_DBUS guards
Change-Id: Idb459fe6300f710b959247cd9c1997a4d5774b2d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-09-24 21:28:40 +02:00
Mark Brand
7b95df2da0 QSqlTableMode::selectRow(): lack of WHERE clause is an error
Since we only want one row, never ever run a SELECT without a WHERE
clause.

Change-Id: I40a78935f5573111faa3922eae97e6d5961be5f2
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2012-09-24 21:27:51 +02:00
Mark Brand
3c2733e45f QSqlTableModel::selectRow(): reduce scope of QSqlQuery
It's good to clean up the query before emitting signals about the
updated row. It's possible that connected slots will call selectRow()
again for other rows.

Change-Id: I482fe2dd58218f53567ce8725ee591ce2eeda348
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2012-09-24 21:27:51 +02:00
Mark Brand
7389c09637 QSqlTableModel::selectRow(): fix failure on uncached rows
This method was originally intended for refreshing rows after
submitting changes. It should also work for refreshing rows
that are unchanged (i.e., not cached), but did not because
constructing the primary values depended on the cache. As a
consequence, the WHERE clause for the query was not created.

Fixed by deriving primary values for uncached rows from the
query record. Note that the cache is still authoritative for rows
it holds. This is important because the prmary values there may
differ from the original query record due to changes to columns
of the primary key.

Includes new test.

Change-Id: I41cca2cbf26019d4b495ffa6d876e2b55ec57803
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2012-09-24 21:27:51 +02:00
Konstantin Tokarev
cb2d87e8b8 Fixed crash in moc on big endian platforms.
Change-Id: Icaa38eb4b404e5f52248fdeaf9180a5d70d0f5f2
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-09-24 21:27:51 +02:00
Konstantin Tokarev
855018ac55 Fixed QJsonDocument::fromBinaryData on big endian platforms.
Change-Id: I1786b6222867c8780f6768e5220e7ddff952b28e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-09-24 21:27:51 +02:00
Konstantin Tokarev
609d2eebe8 Fixed ifdef condition in QJson resulting in big endian breakage.
Change-Id: I3d36d75ff95ad2fe2fcbbe262f9782f0709d7041
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-09-24 21:27:51 +02:00
Andy Shaw
8b7b6b6969 Add a manual test for QMacCocoaViewContainer
Added a test for QMacCocoaViewContainer which will enable the testing
of the fixes coming

Change-Id: I73e9540bc58411634f0da7d398eca4b7ffafba8e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2012-09-24 21:27:51 +02:00
Caroline Chao
99f2bdd28f Test: Enabled tst_QFile::invalidFile
The test is not hanging on Windows anymore.

On Windows, add an expected failure for the failing case.

Task-number: QTBUG-22801
Task-number: QTBUG-27306

Change-Id: Iede95766504f3e8a278a4554a5967ca333aae3bf
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-09-24 21:27:51 +02:00
Samuel Rødal
1dadede8ed Fixed instances of "to to" in qtbase.
Really it should just be "to".

Change-Id: I7d0fff334bac3f0ac78adb8131e3bf3df1f1b242
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2012-09-24 21:27:51 +02:00
Thiago Macieira
3827fd2a37 Add some tests for compatible and incompatible custom deleters
Change-Id: I2bb7f597aab0f00a250881602e6a6bb7bfe42e18
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-09-24 21:27:51 +02:00
Thiago Macieira
5d9a57432e Move the fetch and store pixel functions to qdrawhelper.cpp
These functions have begun showing in the tst_symbols unit test as
"symbol does not start with q". Since they're never called directly,
they're never inlined. Since they were inline, the compiler was probably
deciding to not export them.

Something changed and it could be anything (new compiler version, new
options, etc.). So mark them static.

Change-Id: I838dfc94edd7f09c202743bff0daf9d20c10c3a6
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-09-24 21:27:51 +02:00
Thiago Macieira
1f808a1d1d Introduce an option to disable stripping during installation
The default is the current behaviour: strip on installing release, no
strip on installing debug. This option does not change the
installation of debug builds because qmake does not support that.

Change-Id: Ic208d5ffe860d5f1ee1cafdc944e12001673d33f
Reviewed-by: Davide Pesavento <davidepesa@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2012-09-24 21:27:51 +02:00
Thiago Macieira
cb7d64170d Centralise handling & ignoring of SIGPIPE in qcore_unix_p.h
We had two instances of this function in the Qt source code, one clearly
a copy of the other, so both had the same thread-safety issue. Instead,
let's have one copy and have both write_nosignal() and sendto() call
them.

Q_NO_POSIX_SIGNALS is also gone. It was only used with Symbian.

Change-Id: I0f1354a8e9df8e6b10a02f86a940e3c6d1222087
Reviewed-by: Peter Hartmann <phartmann@rim.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-09-24 21:27:51 +02:00
Mark Brand
eb42be700a fix build failure for MinGW using "system" freetype
The configure script correctly detects freetype and sets
"system-freetype" in QT_CONFIG. However, the project file did not
consider this possibility.

Change-Id: I9ce90e7cd032a12ed7d06d3858b16c5a8d90c073
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2012-09-24 21:27:51 +02:00
Andreas Holzammer
03f4930eca Try to auto-detect the font rendering for WinCE
Native font rendering is broken for QML applications, use free type
rendering for those scenarios. Use native rendering for all other
applications.

Use a workaround to find out if we are running a QML application on the
target.

Related to QTBUG-24205.

Change-Id: I653ea579098db1e58af8176cb2c3f943be0b9602
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2012-09-24 18:02:13 +02:00
Marc Mutz
d16efdfc0e QModelIndex: add constexpr
The functions dealing with the void* internalPointer() can't be
constexpr on GCC 4.6 and Clang 3.2-trunk, even though GCC 4.8-trunk
accepts it, because of the casts required.

Change-Id: Id04105312da3d0c7632f7df06a34bc5a71120b32
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-09-24 18:01:45 +02:00
Marc Mutz
3291e0a77c QModelIndex: store quintptr instead of void*
Rationale:
1. Comparing pointers that don't point the same array is undefined behaviour, IIRC,
   and op== and op< did that.
2. The functions that cast to/from the storage type can't be constexpr. It makes
   more sense to have the quintptr functions be constexpr (they have a fighting
   chance to actually get passed something constant) than it is to have the void*
   functions constexpr. Thus, the storage type should be quintptr.

Also prepare op< to be constexpr-compatible.

Change-Id: I4b2d4a0ec8ca80d619d272bf07c57887cbd11c2f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-09-24 18:01:37 +02:00
Jan Arve Saether
44a0e972a0 When trying to run cmake, don't show stderr output.
It looks like the qmake process failed if cmake is not installed.

Change-Id: I721796a602d8c572144e9d21be5d62b737698b73
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-09-24 18:01:14 +02:00
Miikka Heikkinen
fd6a870136 Fix hover handling in QTreeView
Cached hoverBranch could get invalid if branches were collapsed or
expanded programmatically, leading to a crash in some situations.

Fixed the logic for updating hovered over branch indicators and
also now update hoverBranch when drawing so that it is guaranteed to be
up to date there - this fixes issues like hover indicator not updating
when the view is programmatically scrolled.

Task-number: QTBUG-27158
Change-Id: I5bd1ad76aee512ad78df33959a84ead16886a47c
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-09-24 18:01:10 +02:00
Stephen Kelly
05aa8c6c12 Implement viewOptions() logic in QListViewPrivate.
The private method is called in several places in QListViewPrivate,
but before this patch, the implementation in QAbstractItemView was
 called. This meant that the options were not set properly,
resulting, for example, in icons in icon mode being laid out in
list mode (on the left and small).

This is a regression resulting from
8eab9cbce2 and
3578e05b29. Other views are not
affected in a similar way.

Change-Id: I753cb99410e367266753eaf2fa43361b9212ab96
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-09-24 18:01:07 +02:00
Stephen Kelly
3e9f279290 Specify the --build-config when invoking ctest.
Otherwise we get strange build errors by attempting to build an
project in debug mode against a release-mode Qt:

http://testresults.qt-project.org/ci/QtBase_master_Integration/build_03955/win32-msvc2010_Windows_7/log.txt.gz

(grep for MSVCRTD)

The CMAKE_BUILD_TYPE variable is always specified by the ctest_testcase
driver as either Debug or Release.

Change-Id: Ia5af7f0c31550b92679a3190e07b4e5c4ea638c6
Reviewed-by: Brad King <brad.king@kitware.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-09-24 18:01:05 +02:00
Stephen Kelly
f03ef8d8f4 Pass the unmodified directory/project name to build-project.
The result of replacements for special characters should not be
used here. CTest needs the replacements for the test names, but
requires the argument to the project() command to match the
argument to ctest --build-project.

Task-number: QTBUG-27087
Change-Id: I4ff7a7e00ddb65ab0c0f2305901e1d03f46e07d1
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-09-24 18:01:02 +02:00
Stephen Kelly
f5bdefca0b Don't append _build to the directory name of tests expected to fail.
The name passed to the project() command must be the same as the argument
to ctest --build-project.

Initially I had appended _build to disambiguate the generated project
from the project under test, but that is not needed anyway as the
project under test is self-contained, so it's ok.

Task-number: QTBUG-27087
Change-Id: I648d57271529d4e8d308ff60b81419ade29b2e44
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-09-24 18:00:56 +02:00
Jing Bai
37e3168abc wrap QLibrary related code with QT_NO_LIBRARY
To fix a compile error when QT_NO_LIBRARY is defined.

Change-Id: Ie72b60b8204641fa05f4cdbf66e908cb3526217e
Reviewed-by: Jing Bai <jing.bai@digia.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
2012-09-24 17:06:48 +02:00
Sean Harmer
57b4a504ff OpenGL: Remove API for stubbed Geometry shader support in gui/opengl
There is a pending patch to reinstate this for Qt 5.1 (the patch
introduces new API top QOpenGLContext). I will fold the revert of this
patch into:

https://codereview.qt-project.org/#change,31231

Note that QGLShaderProgram still supports Geometry shaders so source
compatibility with Qt 4.8 is maintained.

Change-Id: I53faedd4e4a2a6c2a9765afdc1bee6df5ae2f711
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2012-09-24 16:59:58 +02:00
Jędrzej Nowacki
c06106f28d Fix potential breakage in QString.
Negation operator ("!") have precedence over bitwise and ("&").

Change-Id: I39e2d99da6eaa4477bbe35a1259f745e05c9841a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-09-24 16:53:13 +02:00
Sergio Ahumada
09c90346aa Update "About Qt" dialog from Nokia to Digia
Task-number: QTBUG-25205
Change-Id: I9294f8e36523f242b3d05d521f6a24274ba1b0a0
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Janne Anttila <janne.anttila@digia.com>
2012-09-24 08:22:20 +02:00
Shawn Rutledge
1a31561178 xcb: dynamic QScreens; primary first; corrected logical DPI
A new QScreen is created when an output is activated (monitor or
projector is added, for example), and destroyed when the output is
turned off.  Ensures that screens and siblings are always in
the right order: primary comes first.
Logical DPI is derived from virtual geom / virtual size,
which will be different than output geom / physical size
if X was started with --dpi override.  This is a good thing:
when X gets wrong EDID info for physical size and you need to
override it to get reasonable font sizes, Qt will heed the
logical DPI for font sizing.

Change-Id: I5e3de34013c1b6b21067243de56f3f1eb72787fa
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
2012-09-24 00:26:07 +02:00
Marc Mutz
06c89ae026 Use QStringList::join(QChar) overload where applicable [tools]
This is an automated change performing the following replacements:
                    join\("(.)"\) -> join('\1')
  join\(QLatin1String\("(.)"\)\)  -> join(QLatin1Char('\1'))
  join\(QStringLiteral\("(.)"\)\) -> join(QLatin1Char('\1'))

Change-Id: Ia087beb886bbaec1a0976cd924440d8904044879
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2012-09-23 23:30:33 +02:00
Marc Mutz
c00bd8d677 Use QStringList::join(QChar) overload where applicable [QtCore]
This is an automated change performing the following replacements:
                    join\("(.)"\) -> join('\1')
  join\(QLatin1String\("(.)"\)\)  -> join(QLatin1Char('\1'))
  join\(QStringLiteral\("(.)"\)\) -> join(QLatin1Char('\1'))

Change-Id: I81c378ef6aeeada5e116f1394cc9fc67f901ffd6
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2012-09-23 23:30:18 +02:00
Marc Mutz
6d65b2cc8c Use QStringList::join(QChar) overload where applicable [examples]
This is an automated change performing the following replacements:
                    join\("(.)"\) -> join('\1')
  join\(QLatin1String\("(.)"\)\)  -> join(QLatin1Char('\1'))
  join\(QStringLiteral\("(.)"\)\) -> join(QLatin1Char('\1'))

Change-Id: I1d0c9782cc1522d937b930531720e32d4c8f7ce8
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2012-09-23 23:30:03 +02:00
Marc Mutz
e44f1dabe4 QTestLib: clean up qCompare specialisation/overload mix
qCompare() was both overloaded and specialised, but always as a template.
This lead to the QIcon specialisation actually invoking
   qCompare(QFlags<void*>, ...)
when specifically asking for qCompare<void*>() (detected by adding
underlying-type detection to QFlags).

Fix by preferring overloading and not specialising anything.

Change-Id: Ie001ebb9dfb0847c6c33a3f45177a61579fd61ee
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-09-23 23:29:42 +02:00
Sergio Ahumada
ef23f5d9bd configure: Update contact information for commercial users
Task-number: QTBUG-23949
Change-Id: Iaca7f45eae39ab7f6368431daead93358b17fe36
Reviewed-by: Janne Anttila <janne.anttila@digia.com>
Reviewed-by: Sinan Tanilkan <sinan.tanilkan@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2012-09-22 23:40:24 +02:00
Sergio Ahumada
1395b81935 test: Remove QSKIP from tst_QFocusEvent::checkReason_ActiveWindow()
This test actually passes using the "xcb" platform and fails otherwise.

Second, the Jira task is misleading since it refers to
tst_QFocusEvent::checkReason_Shortcut()

Change-Id: Icab91ace8c214d958b534c5cebae900242522372
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
2012-09-22 23:40:02 +02:00
Friedemann Kleint
f6155aec30 Redirect keyboard/mouse grab to the widget parent window.
Use the native parent's window if the widget in question does not
have one. This should be in line with Qt 4.8 using effectiveWinId().

Remove redundant code in grabMouse(QCursor).

Change-Id: Id6ab192e739221fe89f865f4d2f7a6d4671a190b
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2012-09-22 20:46:30 +02:00
Marc Mutz
e0b1eac3ff QStringList: adapt documentation to cover new join(QChar) overload
Change-Id: Ia73501e1e8a562cfab750d1796fb597cd89eab74
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-09-22 20:46:13 +02:00
Marc Mutz
2480ebb50b QFileInfoGatherer: remove useless locks
The m_iconProvider and m_resolveSymlinks members are only ever
accessed from getInfo(), which is not called from run(). So the
mutex-lockers aren't needed in the setters.

Change-Id: I3257c95366528c5c66352d20a09e8a43b811f3ba
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2012-09-22 20:45:39 +02:00
Marc Mutz
15953e9503 QModelIndex: clean up integer size confusion in the API
QAIM::createIndex() took either int or quint32, but QMI::internalId()
returned qint64.

In the new interface, createIndex() takes, and internalId() provides,
integers of type quintptr.

This matches the storage size of the void* in the model index and
avoids truncation.

Remove the
  createIndex(int, int, quint32) and
  \obsolete createIndex(int,int,int)
overloads.

This makes a literal 0 in the third parameter ambiguous now.
The solutions have been noted in changes-5.0.0.

Change-Id: I0a0ecd8430eaf695129a4d09d14d4e30745485c4
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-09-22 20:45:12 +02:00
Iikka Eklund
be15856f61 Change copyrights from Nokia to Digia
Change copyrights and license headers from Nokia to Digia

Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
2012-09-22 19:20:11 +02:00