Commit Graph

8749 Commits

Author SHA1 Message Date
Mitch Curtis
7fc34bff78 Call clear() instead of empty() in addressbook/part6 tutorial.
empty() doesn't remove elements, it just returns whether it is empty.

Task-number: QTBUG-8849
Change-Id: I9bb8e855d96cecd2a0df336cb46e308ddedf0d07
Reviewed-by: Michalina Ziemba <michalina.ziemba@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-08-09 03:26:19 +02:00
Marc Mutz
c856e37c5f Logging: mark qt_assert()/qt_assert_x()/qFatal() as nothrow
These functions are not supposed to return, not even by exception.
qt_message() _can_ throw, but we're fine with the compiler calling
std::terminate() then, since the backtrace will still include the
assertion location.

This behaviour is ensured by a new macro, QT_TERMINATE_ON_EXCEPTION,
which expands to something like
   try { expr; } catch(...) { std::terminate(); }
if the compiler doesn't support Q_DECL_NOEXCEPT (but maybe
Q_DECL_NOTHROW), and to something like just
   expr;
otherwise (including in the QT_NO_EXCEPTION case).

The real macro preserves scopes in all cases, and aims
to work even if <exception> isn't included in the TU it's used in,
so is a little bit more complex than that.

Change-Id: Ie6a2b7776e6aa77e57bd9aea6e184e5fa1cec81c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-08-09 03:26:17 +02:00
Thiago Macieira
7ef395224e Remove unnecessary extra indentation in the EXPORT macros
Change-Id: I54585fa7e38ea1984018c5cbff9bc4626016bace
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-08-09 03:26:14 +02:00
Thiago Macieira
413c8841aa Remove the Q_xxx_EXPORT macros of other modules from qglobal.h
The macros have been moved to their respective modules.

Change-Id: I653668b608cd3b79824a25b0e7b1c238330c0007
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-08-09 03:26:13 +02:00
Thiago Macieira
703e287283 Rename QMapData::free to destroy
The convention for QMap is that "free" methods simply free memory and
that "destroy" ones also run destructors of types affected. Since this
function calls destroySubTree, it should be more properly called
"destroy".

This also gets rid of another function called simply "free" in our
headers.

Change-Id: I3fa621c78848ede33dd5b78428c704d0423ba4e7
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-08-09 03:26:10 +02:00
Thiago Macieira
9e96717746 Rename QLinkedList::free to freeData for consistency
QLinkedList does use allocations in the .h, by way of operator new and
operator delete. But for consistency with other classes, don't call our
function free().

Change-Id: I9295f5945619ad4ea82fd1f7f55b34700c54e06a
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-08-09 03:26:08 +02:00
Thiago Macieira
9f71ff69f2 Rename QContiguousCache allocate and free functions to say "Data"
The important change is to use functions not called malloc and
free. On some old systems or under some weird circumstances, they
might be #defined to something different. More importantly, this
allows us to quickly verify whether we're using the stdlib.h functions
in our public headers.

Change-Id: I66b963ac2bc75d64028c04542e62a929e4b36b19
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-08-09 03:26:06 +02:00
Thiago Macieira
649cd98743 Remove use of ::free from qlist.h
The memory is allocated in qlist.cpp, so it should be freed in
qlist.cpp. Freeing it in qlist.cpp ties our hands about future
improvements to the allocator.

In addition, silence the warning by the too-smart-for-its-own-good GCC
that we're trying to free a non-heap object:

  qlist.h:763:14: warning: attempt to free a non-heap object "QListData::shared_null" [-Wfree-nonheap-object]

The warning is wrong. It should say "possibly" somewhere because GCC
failed to account for all conditions in the path to free().

Change-Id: I34a6c16bba9a2197fc83eb3c7a63ae06fb25bf15
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-08-09 03:26:05 +02:00
Donald Carr
1ecef1ea35 Update Raspberry Pi mkspec
Hard float enabled Raspbian image is now primary platform provided by the
Raspberry Pi foundation.

Change-Id: I2d59ad26fac459907b4f51764975a3e6e29c6033
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Thomas Senyk <thomas.senyk@pelagicore.com>
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
2012-08-09 03:25:55 +02:00
Andreas Holzammer
661cf8ff4e Make it possible to force generation of debug info in release builds
Change-Id: Ie79e5a6a87475d5140163a2a547b4385a53fc05f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-08-09 03:25:53 +02:00
Leonard Lee
63eb5b5a79 Explained rectangle bounding in documentation.
Task-number: QTBUG-26756
Change-Id: Ifa56cbe249164e239f21c00fc31cd6ddd81705ad
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2012-08-08 14:13:53 +02:00
Leonard Lee
7cd8782cb6 Explained degree unit in QPainter::rotate() function.
Task-number: QTBUG-26757
Change-Id: I9a03480513819aefb78d914a7170fb4997181643
Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2012-08-08 14:13:53 +02:00
Kent Hansen
8efcfda41f statemachine: Really fix signal transition handling in multi-threaded setup
Commit f9a17d7f0f fixed it for the case
where the sender object is in a different thread at transition setup
time. However, it still didn't work if either the sender object or the
state machine was moved to a different thread at some later time,
before the machine was started.

Therefore: Bite the sour grape and traverse all the machine's
transitions when the machine is being started, registering those
signal transitions whose sender objects are in other threads.

This will increase the machine's startup time (proportional to the
number of transitions), but at least it works in all known scenarios,
meaning we don't have to document weird restrictions regarding the
order in which the user's operations have to be done.

Task-number: QTBUG-19789
Change-Id: I5f1dd1321994e49635f52be65cf56d2678ed1253
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-08-08 14:13:53 +02:00
Joerg Bornemann
f7272b4587 remove unused Q_FS_FAT from Windows qplatformdefs.h
Change-Id: I12a70c8a06fa5d82db1cb3d6e6a7ed870e7a8ec5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-08-08 14:13:53 +02:00
Joerg Bornemann
ef5dd56eb9 remove embed_manifest_* from common Windows CE mkspec
They had no effect anyways due to the check in the embed_manifest*.prf
files.

Change-Id: I3cd145030876d91948794d376a18a47e297f3b3a
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
2012-08-08 12:04:49 +02:00
Davide Pesavento
40cfcd0b0c Define QT_NO_FOO also when -no-foo is passed to configure.
This fixes a build failure that happens when Qt is configured with
-no-libudev, as reported at https://bugs.gentoo.org/show_bug.cgi?id=430292

Change-Id: I924f023505ab57cca5994f2fd5ff2f8308e61617
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-08-08 12:04:49 +02:00
Gunnar Sletta
dec934cd96 Avoid potential crash.
The setGeometry call triggers a resizeEvent() so make sure the backing
store is created before that.

Change-Id: I26aa3ef6c0515311e3ca21f938a92ca1a20d0030
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-08-08 12:04:49 +02:00
Oswald Buddenhagen
3cc151d0c2 adjust qtAddLibrary() to new qtAddModule() parameters
Change-Id: Ib5918fa83e78d16fd318590c33b280d9054b2cd6
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-08-08 12:04:49 +02:00
Oswald Buddenhagen
0885f3ee52 rename qt_module_config.prf => qt_module.prf
this is more logical, following the qt_plugin and qt_tool scheme.

Change-Id: Ib3b2abec6728cdab260e15128b1cd78e8e6f5d6a
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-08-08 12:04:49 +02:00
Oswald Buddenhagen
f1856cc8de remove dead unsupported/win32-borland spec
Change-Id: I010160f030dc44c84d2c84a36e8920ce3275f278
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-08-08 12:04:49 +02:00
Oswald Buddenhagen
fbfb4d4b9a preserve the directory structure of QML_FILES
Change-Id: I39ccdbf59887f14be7dad492598160eebb94ce78
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-08-08 12:04:49 +02:00
Oswald Buddenhagen
f8ff2ae69e support installs with target dir
this adds a .base "member" to the install "structure". if specified, only
this much is stripped from the front of each element of .files, rather
than the entire path, to obtain the target filename.

Change-Id: Ic39fcf71c4ad874ffabbbad113be9cdc6e3f7260
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-08-08 12:04:49 +02:00
Oswald Buddenhagen
ff192b3c62 reshuffle assembly of install commands as well
don't make a single string, but a string list which is join()ed in the end.
this is a tad slower, but the code is way easier to work with.

Change-Id: I1ff7168c2770998761a6081be8080c743ddc94a1
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-08-08 12:04:49 +02:00
Oswald Buddenhagen
350d5ff3dd reshuffle assembly of uninstall commands
make a proper stringlist of commands, and join it in reverse order
only at the end. the reversal ensures that we can cleanly fold up
directory hierarchies we may build.

Change-Id: I9a241361588a6965283aec5258e1d622b35514e0
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-08-08 12:04:49 +02:00
Oswald Buddenhagen
14d0dc1dca remove pointless appending of trailing dir separator under unix
Change-Id: Ia9b181db57ac2ee93cd412d58fe6ecbc5637a2f0
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-08-08 12:04:49 +02:00
Mitch Curtis
ebbd8e6671 Clarify how days are counted in QDateTime::daysTo documentation.
Mention that the days are counted as the amount of times midnight is
reached between the start and end date.

Task-number: QTBUG-26780
Change-Id: I22ff6c56b748ac968d6991e0be3e10905c0634bd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-08-08 09:43:45 +02:00
Thiago Macieira
6820f1716e Remove more -Werror from any test other than headersclean.
As was done in dc56fb18a7, but which
didn't catch all cases.

Change-Id: I9417a8d13339dd8fc95030dd5bad70f2c6f69756
Reviewed-by: hjk <qthjk@ovi.com>
2012-08-07 23:27:17 +02:00
Oswald Buddenhagen
bf2ae556ac let qmake auto-generate d-bus adaptors and interfaces
Change-Id: If721dc2d75e382bde6bf9bcda921170186406c7f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-08-07 23:27:17 +02:00
Oswald Buddenhagen
842b1bd29e factor qml_module out of qml_plugin
this makes it comfortable to create qml-only modules

Change-Id: I17a5a3ee24210b93db05e50502c6ca91a4e7a9d8
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-08-07 23:27:17 +02:00
Oswald Buddenhagen
8e134b63bc use global imports install location as the "build" dir for qml plugin files
when doing a non-prefix build (which is the only case where the code is
executed), the build location is always the same anyway, so there is no
use in complicating things.

Change-Id: Id98755d818e05a11bed505abcb8b9d52a7d5b7c4
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-08-07 23:27:17 +02:00
Oswald Buddenhagen
af3362f065 copy qml files to build dir only when doing a non-prefix build
non-installed -prefix builds can't do anything useful with qml plugin
files anyway, so don't waste time on copying them.

Change-Id: I23f4b8f67402a85d3c6e741a04f88567655c1655
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-08-07 23:27:17 +02:00
Oswald Buddenhagen
70aeeda608 move IMPORT_VERSION fallback into the conditional of the consumer
Change-Id: I01336903aaaff8bca5407aa3c50d330e8fd7910a
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-08-07 23:27:17 +02:00
Oswald Buddenhagen
3d8fbaa866 move qmltypes "compiler" below TARGET manipulation
load(resolve_target) must not be called before we have a final target
name.

Change-Id: Ia7418672b0c7b7fbd388a63819af9ea9a54c5241
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-08-07 23:27:17 +02:00
Andreas Holzammer
495017e5d4 Rename msvc11 to msvc2012
Microsoft has named their new Visual Studio again
after the old naming schema.

Change-Id: Ib1b971807fa89d90b10892a2d78570058e564f3a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com>
2012-08-07 23:27:17 +02:00
Marc Mutz
f829ab5573 Q_DECL_NOTHROW: stronger and more widely available version of Q_DECL_NOEXCEPT
Commit 1adca807 defined Q_DECL_NOEXCEPT to be the same as throw() for the
Microsoft compiler. However, the two are not equivalent:

- C++11 noexcept is defined to call std::terminate() if a noexcept
  function nevertheless encounters an exception.
- MSVC throw() has essentially undefined behaviour in this situation:
  http://msdn.microsoft.com/en-us/library/wfa0edys%28v=vs.100%29
   "Due to code optimizations that might be performed by the C++
    compiler [...] if a function does throw an exception, the program
    may not execute correctly."

So define two macros:

1. Q_DECL_NOEXCEPT/Q_DECL_NOEXCEPT_EXPR always have C++11 behaviour.
   This is expected to be the more efficient implementation if the
   function can actually throw.
2. Q_DECL_NOTHROW means that the function gives the nothrow
   guarantee. It is stronger than noexcept, but not all functions
   that can be marked Q_DECL_NOEXCEPT can be marked Q_DECL_NOTHROW.
   In general Q_DECL_NOTHROW functions need to use a try/catch block
   in order to prevent exceptions from leaving the functions, unless
   you can proove that none of the operations can throw.

For the caller, both macros are equivalent: it can be relied on that
no exception leaves the function.

Change-Id: I32f822a82e06a31cb71d38db438387aee5ec3334
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-08-07 21:11:55 +02:00
Sean Harmer
46212d657e Improve the QOpenGLExtensionMatcher class
Using a QSet<QByteArray> internally means that checking for the
presence of an extension no longer uses an O(N) search.

This patch also allows users of this class to easily get a list
of the supported extensions.

Change-Id: I02194e5345573c47be0876f3ea6eb6b69a2ead81
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2012-08-07 18:55:43 +02:00
Joerg Bornemann
e81d7fd1e5 qmake vcxproj generator: map TARGET_EXT to $(TargetExt)
Task-number: QTBUG-26782

Change-Id: Ib143fa6b8674c4d09d798a9301bb209b886e791d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-08-07 18:55:43 +02:00
Joerg Bornemann
b4ae57c881 qmake: un-copy-and-pastify vcxproj generator a bit
Reusing already built strings improves readability and performance.

Change-Id: I8555fb860561ff214ae123efeda78fc770b6459f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-08-07 18:55:43 +02:00
Andy Shaw
372cc6b506 Add the filters for extra compilers for vcxproj files
The files were grouped into the relevant filters but the filters
themselves were not added.  This now ensures the filters are added to the
vcxproj files so they appear grouped correctly.

Task-number: QTBUG-26755

Change-Id: I7d2c6fa96dcbb0496fd9d1bb1d01e7dd660052f4
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-08-07 18:55:43 +02:00
Oswald Buddenhagen
5bea177ab1 fix class and file names in the d-bus examples
some omissions from the com.trolltech => org.example replacement.

Change-Id: I078c272fc3729fc7b9e9cd3e6ede7c21f0386b62
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-08-07 18:55:43 +02:00
Andreas Holzammer
0ef4bf1c1e Add possibility to add OpenSSL, DBUS, MySQL path under Windows
Under Windows it's quite possible that OpenSSL, DBUS or MySQL is
not installed into a central place. If -I and -L is
passed at configure time, it is added to all targets,
and if that path contained a conflicting header things would go
wrong.

Change-Id: Ic3338c49aa6eaa91b3abf5341e709ef604bf7aab
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-08-07 18:55:43 +02:00
Marc Mutz
bd7331cb33 QtGui: collapse two qgetenv() on the same variable
Store the result in a temporary QByteArray and continue
working with that one.

Change-Id: I24bc243f0f3dfb37d840faf7592b3383bd37c7e2
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-08-07 18:55:43 +02:00
Marc Mutz
bfabd0de51 QUrl::idnWhiteList(): add QList::reserve() call
Avoids reallocation.

Change-Id: I3238574590463596a797d237b066ef60214392a7
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-08-07 16:43:11 +02:00
Marc Mutz
045a5e3b42 QtNoDebug: remove special member functions
These are better generated by the compiler.

Change-Id: I5afa9fd17997c220622ed0e5990c33e52700840f
Reviewed-by: Laszlo Papp <lpapp@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-08-07 16:40:07 +02:00
Stephen Kelly
c5d7ea5bad Only emit the clicked() signal from views if the left button is used.
This is consistent with QAbstractButton, QCalendarWidget,
QDialogButtonBox and QGroupBox (ie, all other widgets with
a clicked signal)

Task-number: QTBUG-26105

Change-Id: Ieafe988b5c03216796b69a7cd70ac1a03fc12b0a
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-08-07 16:40:07 +02:00
Stephen Kelly
2ade633c0a Ensure that we return an invalid QTableWidgetItem when none is available.
Task-number: QTBUG-26195

Change-Id: Iede4f51770bd8c8eab3558137aaf7b1721f25a87
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-08-07 16:40:07 +02:00
Oswald Buddenhagen
a97d09a84b add support for PKGCONFIG_PRIVATE
this does the same as PKGCONFIG, only that the libraries end up in
LIBS_PRIVATE, not LIBS, which means they don't end up in prl files.
in the vast majority of cases, the user should use this new variable.

Change-Id: Icb57a1166f1896f51284c64e4047cfc79410e73a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-08-07 16:40:07 +02:00
Oswald Buddenhagen
3dfb362782 add support for QT_PRIVATE
this is handled the same way as the QT variable, only that the actual
libraries end up in LIBS_PRIVATE, not LIBS, which means they don't end up
in prl files.

the handling of the two variables is entirely independent, including
independent dependency resolution, so some libraries will typically end
up twice on the linker command line. this is not a problem.

Change-Id: I257ad0d414bf273c08a7bd6a874fe9ddb7356009
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-08-07 16:40:07 +02:00
Oswald Buddenhagen
c292f1dc8a respect copy_dir_files with manually flagged directories as well
otherwise the second installation on unix would be bogus.

Change-Id: I162533ee262c6820e7e2d4710b5342cafecd9d59
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-08-07 16:40:07 +02:00
Oswald Buddenhagen
37cc4a6499 centralize+fix addition of copy_dir_files flag
this is in fact a shell-related flag, which determines how QMAKE_DIR_COPY
is assumed to behave.

Change-Id: If774f8a83b40c9ae7107c8e7ef7263af8a2e6c6e
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-08-07 16:40:07 +02:00