summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qstring.h
Commit message (Collapse)AuthorAgeFilesLines
* Long live QString::asprintf()!Marc Mutz2015-02-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | asprintf() is a GNU extension that prints into a string it allocates internally. Arguably, that's a better name for QString::sprintf() since it also allocates memory internally. The main problem with QString::sprintf() isn't that it's dangerous to use (it is), but that it's not static. It also returns a reference instead of by-value, breaking RVO. There is a comment about removing this function completely in Qt 6.0, but it remains the only printf-style function in Qt that can allocate the target string, so it's vital for logging, e.g., and the recommended replacement code (http://linux.die.net/man/3/vsnprintf) is a nightmare. So this patch adds static (v)asprintf() methods to replace it. Further patches will fix up all in-tree callers and finally deprecate the old (v)sprintf(). Test coverage is provided through the existing tests of sprintf(), which is implemented in terms of asprintf(). Arguably, the in-tree callers show that QByteArray would benefit from having an asprintf(), too, as most of the in-tree code works around its lack with calls to to{Latin1,Local8Bit}() after using the QString version. [ChangeLog][QtCore][QString] Added asprintf(), vasprintf(). Change-Id: I8510f8d67c22230653ec0f1c252c01bc95f3c386 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Add conversion functions for C++11 u16string and u32stringAllan Sandfeld Jensen2015-01-241-0/+26
| | | | | | | | | | | The patch adds convenience functions for working on C++11's new char width specific unicode strings u16string and u32string. [ChangeLog][QtCore][QString] Added methods for convenient conversion to and from std::u16string and std::u32string. Change-Id: I67c082e4755c592d61daaaaa70c8867ef0b23dcb Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QtCore: add some more Q_DECL_NOTHROWMarc Mutz2015-01-211-3/+3
| | | | | | | | | | | QtCore now builds with no -Wnoexcept warnings (that doesn't mean there aren't tons of functions that should be marked noexcept, just that all conditionally noexcept functions aren't noexcept(false) just because of a forgotten noexcept elsewhere). Change-Id: I10dacb6b9c9d41d3595fe2f306356d62d3d91c76 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QtCore: mark some operations nothrowMarc Mutz2015-01-101-5/+5
| | | | | | | | | | | | This shotgun-surgery approach is motivated by trying to get a clean(er) build for -Wnoexcept on GCC, so it is expected that for any class touched here, there will be more operations that can be marked nothrow. But they don't show up in conditional noexcept clauses, yet, so they are deferred to some later commit. Change-Id: I0eb10d75a26c361fb22cf785399e83b434bdf233 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use the new warning enabling/disabling macros in qtbaseThiago Macieira2014-12-031-8/+3
| | | | | | Change-Id: I91ff06644e8047c2ca483f9768b46c1372eb6171 Reviewed-by: Martin Smith <martin.smith@digia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* Add rvalue-ref qualified {QString,QByteArray}::{simplified,trimmed}Thiago Macieira2014-11-021-2/+13
| | | | | | | | | | | | | | | | | | | | Of the const overloads that return a QString or a QByteArray, this is one that gains the most benefit. It happens often in constructs like: QByteArray s = x.readLine().trimmed(); After this change, 41 out of 103 calls to trimmed become rvalue in Qt and 272 out of 441 in Qt Creator. For simplified, the numbers are 27 out of 69 in Qt and 10 out of 19 in Qt Creator. Other candidates are left, right, and mid, but there are exactly zero uses of left, right and mid on an xvalue QString or QByteArray in Qt. I'm being lazy and using qstring_compat.cpp to store the QByteArray compat methods. Change-Id: I4e410fc1adc4c761bb07cc3d43b348a65befa9f6 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-10-091-2/+2
|\ | | | | | | Change-Id: I05fcd8dc66d9ad0dc76bb7f5bae05c9876bfba14
| * Merge remote-tracking branch 'origin/5.3' into 5.4Oswald Buddenhagen2014-10-061-2/+2
| |\ | | | | | | | | | Change-Id: I132bb6cce68e9f8413200f7ee75586bd1cada38c
| | * Avoid naming clashes with QStringLiteral local variableKai Koehne2014-10-011-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MSVC 2013 complains about the use of 's' if a variable 's' is already defined in the context: error C2373: 's' : redefinition; different type modifiers error C3493: 's' cannot be implicitly captured because no default capture mode has been specified This looks like a compiler bug. Anyhow, it's easy to avoid the clash in most cases by using a more distinctive name ... Task-number: QTBUG-41706 Change-Id: Iaff1b6d37897fa8cf9e4913effa0498f9fd7bb07 Reviewed-by: hjk <hjk121@nokiamail.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Add a macro to disable only some 8 bit/16 bit string conversionshjk2014-10-021-9/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an opt-in trade-off between type safety and user code convenience. QT_NO_CAST_FROM_ASCII is highly beneficial to avoid unintended conversions from 8 bit data with potentially "unsuitable" encodings to QString. However, it has the undesirable side-effect to require user code to wrap character and string literals in QLatin1Char(...) and QLatin1String(...) or use similar construction, cluttering the code significantly. This patch introduces a QT_RESTRICTED_CAST_FROM_ASCII macro that works almost as QT_NO_CAST_FROM_ASCII, except that it enables the QChar(char) constructor and adds an additional QString(const char (&ch)[N]) constructor that matches C++ string literals, but no arbitrary character pointers. This avoids a significant share of the need to clutter the user code by only a slight relaxation of the type-safety. [ChangeLog][QtCore][QString] Added QT_RESTRICTED_CAST_FROM_ASCII macro as less intrusive alternative to QT_NO_CAST_FROM_ASCII. Change-Id: Iac72f1f90f81fbcae9bfb1fe68b0fec6ffb36c50 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Kai Koehne <kai.koehne@digia.com> Reviewed-by: Eike Ziller <eike.ziller@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | | Merge remote-tracking branch 'origin/5.4' into devOswald Buddenhagen2014-09-291-19/+11
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qbytearray.cpp src/gui/image/qimage.cpp src/gui/image/qppmhandler.cpp src/gui/kernel/qguiapplication.cpp src/gui/painting/qpaintengine_raster.cpp Change-Id: I7c1a8e7ebdfd7f7ae767fdb932823498a7660765
| * | Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* | | QString:add (last)indexOf overload with QRegularExpressionMatch outputSamuel Gaist2014-08-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds indexOf and lastIndexOf with QRegularExpressionMatch output overloads to QString. This allows to get the match corresponding to the index returned. [ChangeLog][QtCore][QString] Added support for retrieving the QRegularExpressionMatch to indexOf and lastIndexOf. Change-Id: Ia0ae2d3ff78864c7053ffa397874aca1d2b1c35c Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | Add rvalue-ref qualified QString::to{Upper,Lower,CaseFolded}Thiago Macieira2014-08-191-0/+31
|/ / | | | | | | | | | | | | | | | | | | | | | | This is even more common than the QByteArray equivalents. Qt Qt Creator const & && const & && toLower 71 50 45 26 toUpper 35 8 46 35 Change-Id: I8b797d2321b22ce414c23656c5f1709ac649c423 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Add some missing STL typedefs and functions to QStringRef and QByteArrayThiago Macieira2014-08-081-0/+10
| | | | | | | | | | | | | | | | | | These will be needed in some template code that is to come. Change-Id: I5b93f4320313f7b15a6404de2c98f85485735fda Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* | Implement QStringRef::splitJędrzej Nowacki2014-08-061-0/+5
| | | | | | | | | | | | | | [ChangeLog][QtCore] Added the QStringRef::split() function Change-Id: I28709c9761785dea7be4e7d621ecf4e1ae007a72 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Add QString::splitRef functions.Jędrzej Nowacki2014-07-311-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | The functions can be used to optimize code that do not need to use the split results as QString directly. [ChangeLog][QtCore] QString can now split a string to a list of QStringRef. Change-Id: Ic2dc929e1fba82f9a060e37c51068a301cb5b866 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | Remove non-existing function.Thiago Macieira2014-07-251-1/+0
| | | | | | | | | | Change-Id: I1c201453d069dbc3d981e1ff3789570af09b662c Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | Introduce std::string conversion to QByteArrayAllan Sandfeld Jensen2014-06-251-1/+1
|/ | | | | | | | | | | | | Add conversion methods similar to those in QString to QByteArray. This is often more useful than the QString version since std::string like QByteArray are byte arrays. [ChangeLog][QtCore][QByteArray] Added convenience methods to convert directly to and from std::string. Change-Id: I92c29d4bb1d9e06a667dd9cdd936970e2d272006 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Fix minor coding style issues in new code in QtCoreThiago Macieira2014-05-191-1/+2
| | | | | | | Change-Id: I444daf8e81257f55746f9d32fbcb60a2e1b69444 Reviewed-by: Liang Qi <liang.qi@digia.com> Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix warning with -Wswitch-enumKonstantin Ritt2014-04-231-0/+3
| | | | | | | | > warning: enumeration values 'Joining_None', 'Joining_Left', and 'Joining_Transparent' > not explicitly handled in switch [-Wswitch-enum] Change-Id: I314b486462451e7d62980b6185b46cd115be1547 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Remove useless Q_NO_DECLARED_NOT_DEFINED flagJędrzej Nowacki2014-03-251-1/+1
| | | | | | | | | | The flag is used only in qstring.h and gives no real value. Task-number: QTBUG-37437 Change-Id: I7513b56af208a5edee8452b8bbcb9b128e25133d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Remove level 4 compiler warnings from MSVC.David Schulz2014-03-151-0/+11
| | | | | | | | | | Task-number: QTBUG-7233 Change-Id: I52067e3a22e98a62fd87415906e54a54ff2d6b49 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com> Reviewed-by: Oliver Wolff <oliver.wolff@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> Reviewed-by: Dave McClelland
* Centralize the handling of all the toXxx (integral) functionsThiago Macieira2014-02-141-0/+21
| | | | | | | By way of templates. This makes the code a lot cleaner. Change-Id: Ie369561c7631b0d34d76a6852883716cc0aa89d4 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Frederik Gladhorn2014-02-111-4/+4
|\ | | | | | | refs/staging/dev
| * Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-02-071-4/+4
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qguiapplication.cpp src/plugins/platforms/android/androidjnimain.cpp src/plugins/platforms/android/qandroidplatformintegration.cpp src/plugins/platforms/android/qandroidplatformintegration.h src/plugins/platforms/android/qandroidplatformopenglcontext.cpp src/plugins/platforms/cocoa/qcocoawindow.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/sql/doc/src/sql-driver.qdoc src/widgets/widgets/qtoolbararealayout.cpp Change-Id: Ifd7e58760c3cb6bd8a7d1dd32ef83b7ec190d41e
| | * Fix a bug in some QString comparison operatorsLars Knoll2014-01-211-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Some comparison operators comparing to const char * where not implemented correctly. Task-number: QTBUG-34024 Change-Id: Idbdc64c8ed93e88d9f2b2f55213bc785b33cb543 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* | | Add QString::fromUtf16 with char16_t and fromUcs4 with char32_tThiago Macieira2014-02-071-0/+7
|/ / | | | | | | | | | | | | | | Because they make sense. I'm even thinking that the char16_t version should get a QString implicit constructor. Maybe both encodings. Change-Id: Ifffc61dd890795fbbbd5f7cb5efb3e6287d1270e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Introduce QChar::JoiningType enum and QChar::joiningType() methodKonstantin Ritt2014-01-291-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This aimed to disctinct joining types "L", "T", and "U" from just "U". Unicode 6.3.0 has introduced a character with joining type "L" and Unicode 7.0 will add a few more characters of joining type "L", so we'll have to deal with it anyways. [ChangeLog][QtCore][QChar] Added JoiningType enum and joiningType() method that deprecates the old QChar::Joining enum and joining() method. Change-Id: I4be3a3f745d944e689feb9b62d4ca86d1cf371b0 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-12-241-18/+2
|\| | | | | | | Change-Id: I2defae1904154283446b069d151c3ef57302ec7b
| * Introduce Q_ATTRIBUTE_FORMAT_PRINTFHarald Fernengel2013-12-171-18/+2
| | | | | | | | | | | | | | | | Removes a lot of copy-paste code for flagging printf style functions. Change-Id: Iecc1e312d1f28b5cbb6b297039f1cdbbc888f843 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Add the UTF16-to-Latin1 in-place converterThiago Macieira2013-12-131-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is only possible for two important reasons: 1) QString and QByteArray d pointers are both done with QArrayData and that class does not care that the alignof(T) changes from 2 to 1, so we can give the pointer from QString to QByteArray (after adapting the allocated size, which is now double) 2) conversion from UTF16 to Latin1 always has fewer bytes (exactly half) Change-Id: I17b2690c910f3de8db55156c6d6b5f55be06d827 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | Implement support for ref-qualified QString::toLatin1 & friendsThiago Macieira2013-12-131-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the first step in implementing an in-place conversion of QString to QByteArray. This requires ref-qualifiers in member functions so we know that we have an rvalue QString. Converting from UTF-16 to Latin1 always requires half the memory. For conversion from UTF-16 to UTF-8, the typical string will also need the same memory or less: characters from U+0000 to U+007F consume one fewer byte; characters from U+0080 to U+07FF and from U+10000 to U+1FFFFF occupy the same space in UTF-8 and UTF-16; it's only the ones from U+0800 to U+FFFF that consume more space in the UTF-8 string. For the locale's 8-bit codec, we can't be sure and the code (currently) needs to go through QTextCodec anyway. This requires a #define set before #include'ing "qstring.h". However, since qstring.h is included by the QtCore PCH, we need an extra qmake compiler without the PCH flags to compile this .cpp. After this change, the distribution of calls in QtCore, Network, Gui, and Widgets is as follows: const & && toUtf8 31 (74%) 11 (26%) toLatin1 79 (77%) 24 (23%) toLocal8Bit 26 (16%) 138 (84%) Change-Id: Idd96f9ddb51b989bc59f6da50054dd10c953dd4f Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-11-261-1/+5
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the conflicts in msvc_nmake.cpp the ifdefs are extended since we need to support windows phone in the target branch while it is not there in the current stable branch (as of Qt 5.2). Conflicts: configure qmake/generators/win32/msvc_nmake.cpp src/3rdparty/angle/src/libEGL/Surface.cpp src/angle/src/common/common.pri src/corelib/global/qglobal.h src/corelib/io/qstandardpaths.cpp src/plugins/platforms/qnx/qqnxintegration.cpp src/plugins/platforms/qnx/qqnxscreeneventhandler.h src/plugins/platforms/xcb/qglxintegration.h src/widgets/kernel/win.pri tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp tools/configure/configureapp.cpp Change-Id: I00b579eefebaf61d26ab9b00046d2b5bd5958812
| * Declare Cocoa conversion funcs in objc-mode only.Morten Johan Sørvig2013-11-051-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In practice, there are several ways to forward-declare objective-c classes. Qt uses "struct objc_object", other projects may use a plain "class". Mismatched forward declarations will lead to compile errors, and this is a form of header pollution. dd5e40d9 added a workaround where Q_FORWARD_DECLARE_OBJC_CLASS can be predefined in order to sync up the declarations. Make forward declaration clashes less likely by forward-declaring in objc-mode only. Change-Id: I9f7a399d64dc88bfe05d5385b3d46b5302112aef Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* | QString: add missing contains(QLatin1String) overloadMarc Mutz2013-11-261-0/+3
|/ | | | | | | | | | | Since contains() just wraps indexOf(), which has a QLatin1String overload, add one for contains(), too, for consistency. [ChangeLog][QtCore][QString] Added QLatin1String overload of contains() Change-Id: I2acc628a51e00789fb2b90400cf0c523a5b5e65a Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QString::reserve fix to avoid truncationMarko Pellikka2013-09-261-2/+2
| | | | | | | | | | In case of implicit memory sharing, QString::reserve caused data truncation if given size was smaller than size of data. Task-number: QTBUG-29664 Change-Id: If2da5ad051385635ebb829c18b5ebaa349f08e8a Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Add Mac type conversion functions to QtCoreMorten Johan Sørvig2013-09-211-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New API: static QString QString::fromCFString(CFStringRef string); CFStringRef QString::toCFString() const; static QString QString::fromNSString(const NSString *string); NSString *QString::toNSString() const; static QUrl QUrl::fromCFURL(CFURLRef url); CFURLRef QUrl::toCFURL() const; static QUrl QUrl::fromNSURL(const NSURL *url); NSURL * QUrl::toNSURL() const; Add Q_OS_MAC-protected function declarations to header files, add implementation to _mm files. CF and NS types are forward-declared in the header files to avoid including the CoreFoundation and Foundation headers. This prevents accidental use of native types in application code. Add helper macros for forward- declaration to qglobal.h Add cf_returns_retained/ns_returns_autoreleased attributes to toCFString() and toNSURL(). These attributes assists the clang static analyzer. Add Q_DECL_ helper macros to qcompilerdetection.h. Add test functions (in _mac.mm files) to the QString and QUrl tests. Split out the test class declarations into a separate headers files. Change-Id: I60fd5e93f042316196284c3db0595835fe8c4ad4 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* New QStringRef methods.Jędrzej Nowacki2013-09-111-0/+4
| | | | | | | New functions left, right, mid were missing in the api. Change-Id: I3590a84431555d009d5012b204c111385bdceed3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add a few more typedefs to QString, for STL compatibilityThiago Macieira2013-07-301-0/+4
| | | | | | | Task-number: QTBUG-22890 Change-Id: I457be6367e577dee30532383d10c519b2f2617b3 Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Specify gnu_printf for message formatting with MinGWJonathan Liu2013-05-081-0/+8
| | | | | | | | | The custom printf formatter Qt ships supports e.g. %lld, which is part of gnu_printf, but not ms_printf. This fixes a lot of MinGW warnings. Change-Id: Iff600f20ac23ecb88c4b569d2e668f5d4af6ef27 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Introducing the Qt Android portPaul Olav Tvete2013-03-051-1/+1
| | | | | | | | | | | | | | | | | | | | | Based on the Necessitas project by Bogdan Vatra. Contributors to the Qt5 project: BogDan Vatra <bogdan@kde.org> Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> hjk <hjk121@nokiamail.com> Oswald Buddenhagen <oswald.buddenhagen@digia.com> Paul Olav Tvete <paul.tvete@digia.com> Robin Burchell <robin+qt@viroteck.net> Samuel Rødal <samuel.rodal@digia.com> Yoann Lopes <yoann.lopes@digia.com> The full history of the Qt5 port can be found in refs/old-heads/android, SHA-1 249ca9ca2c7d876b91b31df9434dde47f9065d0d Change-Id: Iff1a7b2dbb707c986f2639e65e39ed8f22430120 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QStringRef: Added toInt(), toUInt(), etc... functions to QStringRef.Keith Gardner2013-02-221-0/+10
| | | | | | | | | | | Added the following functions to QStringRef: toShort, toUShort, toInt, toUInt, toLong, toULong, toLongLong, toULongLong, toFloat, and toDouble. These functions use the corresponding functions found in QLocale. Updated tst_qstringref.cpp to exercise the new functionality. Change-Id: I38668a0cc7da0c101a62613fd16cb5a98286617f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Leave some Qt 6 remarks for QStringRefThiago Macieira2013-02-121-0/+4
| | | | | | | | | | | | | | QStringRef could have been trivial. The destructor is empty, the copy constructor copies exactly the members and has an empty body and all the members are POD. Both functions should be removed or defaulted in Qt 6. When the destructor is defaulted, we can make the constructor constexpr. We can't do that now because QStringRef is exported and some nasty compilers (MSVC) like to export all functions, even inline ones, and then call them without emitting a local copy. Change-Id: Ie7509fd1a3f737a6c9156ea078d13bb347fc6be0 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QStringRef: Added a trimmed() function.Keith Gardner2013-01-291-0/+2
| | | | | | | Change-Id: I67c5d10f29f420e0aea95cf32b5d3c17c141899c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Remove QT_{BEGIN,END}_HEADER macro usageSergio Ahumada2013-01-291-4/+0
| | | | | | | | | | | The macro was made empty in ba3dc5f3b56d1fab6fe37fe7ae08096d7dc68bcb and is no longer necessary or used. Discussed-on: http://lists.qt-project.org/pipermail/development/2013-January/009284.html Change-Id: Id2bb2e2cabde059305d4af5f12593344ba30f001 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-01-221-1/+1
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qsavefile_p.h src/corelib/tools/qregularexpression.cpp src/gui/util/qvalidator.cpp src/gui/util/qvalidator.h Change-Id: I58fdf0358bd86e2fad5d9ad0556f3d3f1f535825
| * Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | | | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Add a note for merging QString::contains(QRE, QREM) overloads in Qt 6Giuseppe D'Angelo2013-01-201-1/+1
| | | | | | | | | | Change-Id: I19609b192618287dbac0de2e893e3e9b40d6a969 Reviewed-by: Lars Knoll <lars.knoll@digia.com>