summaryrefslogtreecommitdiffstats
path: root/src/tools/uic
Commit message (Collapse)AuthorAgeFilesLines
* uic: Update ui4.cpp/h sourcesFriedemann Kleint2019-11-142-147/+147
| | | | | | | | Apply changes from qttools/4235774262f633da196a192248dbacf4f67f085e. Task-number: QTBUG-79896 Change-Id: I49466980a7c5983f57d4948386b15e8fcec82343 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* uic: Remove some usages of QListFriedemann Kleint2019-11-133-7/+8
| | | | | | Task-number: QTBUG-79896 Change-Id: I298a434040fa903509685b7cde82bbea722f3246 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* uic: Add language::eol in more cases for python codeCristián Maureira-Fredes2019-10-251-18/+18
| | | | | Change-Id: I0ab4b37399d3fba6d27cf90cab22676a3c599e5a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Uic: fix crash when trying to resource icon informationChristian Ehrlicher2019-10-211-1/+1
| | | | | | | | | | Fix a typo introduced in be56db2c49be02fd7083c5a02131462748e29bef to avoid a crash when a pixmap is given for selected on but not for selected off. Fixes: QTBUG-79125 Change-Id: I84072b6b4e8a4d21684be21f5bff1deeaddbba6d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* uic: Avoid use of Q_UNUSED in the generated codehjk2019-07-301-2/+3
| | | | | | | | | | | | | | | | | | | Instead, use (void)x; directly. The current use of Q_UNUSED(x); generates warnings for an empty statement the expansion of Q_UNUSED contains a semicolon already. Emitting Q_UNUSED(x) without the extra semicolon would be an option, too, but as the future of Q_UNUSED's embedded semicolon seems unclear right now, avoid its use altogether. The change affects only generated code that's barely ever read by a human, so the overall utility of "improved readability" of Q_UNUSED in that place is questionable anyway. Change-Id: I332527ed7c202f779bd82290517837e3ecf09a08 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* uic: Implement form window setting to disable QObject::connectSlotsByName()Friedemann Kleint2019-07-024-1/+20
| | | | | | Task-number: QTBUG-76375 Change-Id: I16ad147366aa7d52b7a0e17ae240127d8ac34b3c Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* uic: Fix remaining clang warningsFriedemann Kleint2019-06-285-18/+13
| | | | | | | | Fix remaining nullptr and member initialization issues which Qt Creator did not catch. Change-Id: If5492259aea9849c790f00809a27f4c78b446b9b Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* uic: Add option to disable the call to QObject::connectSlotsByName()Friedemann Kleint2019-06-281-0/+5
| | | | | | | | | The code was actually there, but not connected to the command line parser. Task-number: QTBUG-76375 Change-Id: I801cf2bbd2f207a6ce1dabd1ee1dfbd892089bbc Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* uic: Fix some clang warningsFriedemann Kleint2019-06-064-12/+9
| | | | | | | | | | | | | | | | | | | | - Use range-based for - Use isEmpty() instead .size(), streamline code - Fix warnings about class definitions, use Q_DISABLE_COPY_MOVE and '= default' for trivial constructors Change-Id: I76255fd9d80c3faffebda9a438e86e918c16d289 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* uic: Replace 'typedef' by 'using'Friedemann Kleint2019-06-064-10/+10
| | | | | | | | | | | | | | | | | Apply Fixits by Qt Creator with some amendments. Change-Id: I152cb5935ff7d649de297b010b9253c625c7da84 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* uic: Introduce nullptrFriedemann Kleint2019-06-115-11/+10
| | | | | | | | | | | | | | | | | Apply Fixits by Qt Creator. Change-Id: Ic2d65b2604d1d71d910773e02bcdf2466f49e52c Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Remove QLatin1Literal usagesGiuseppe D'Angelo2019-06-101-1/+1
| | | | | | | | | | | | | That's an undocumented Qt 4/3/2 remnant, start remove usages. Fix incorrect include header in qclass_lib_map.h as a drive-by. Change-Id: I939be2621bc03e5c75f7e3f152546d3af6d37b91 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* uic/Python: Fix tab stop/Z-Order and buddy handlingFriedemann Kleint2019-05-084-42/+52
| | | | | | | | | | | | | | | | | | | | | | | | The code compared the attribute names of the properties against the m_registeredWidgets hash which contained the qualified names (self.widget) and thus reported errors without actually generating anything. Replace the m_registeredWidgets hash by a lookup of the attribute name in the m_widgets hash and add a function widgetVariableName() returning the qualified variable name for an attribute name and use that for the checks. Remove unused m_registeredActions hash and rename some variables to make it clearer. Task-number: PYSIDE-797 Change-Id: Id31d95c1141d21c51eb85bcd8f8fc63486eb36a5 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* uic/Python: Generate empty strings as "" instead of QString()Friedemann Kleint2019-05-081-2/+4
| | | | | | Task-number: PYSIDE-797 Change-Id: I4ce12ba01318e5ed7e88178dfd2450d9fe78c708 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Deprecate conversion functions between QList and QSetLars Knoll2019-05-071-1/+1
| | | | | | | | | | Users should use range constructors instead to do the conversion. Keep conversion methods between QList and QVector as these will turn into a no-op in Qt 6, whereas forcing people to use range constructors would lead to deep copies of the data. Change-Id: Id9fc9e4d007044e019826da523e8418857c91283 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Prefix textstream operators with Qt::Lars Knoll2019-05-021-5/+5
| | | | | | | As the non prefixed variants are deprecated Change-Id: I2ba09d71b9cea5203b54297a3f2332e6d44fedcf Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* uic: Fix missing Python import for QFontComboBoxFriedemann Kleint2019-04-241-1/+3
| | | | | | | | It requires QFontDatabase from QtGui. Add more classes from QtGui. Fixes: PYSIDE-994 Change-Id: Ib84c86e2305fad60560a3f12997eb1e46deb67cb Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* uic: Do not generate Q_UNUSED for PythonFriedemann Kleint2019-04-161-1/+1
| | | | | | Task-number: PYSIDE-797 Change-Id: Id269af024c03c2c586d440659bb6c49c3d6eedc6 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* uic: Port WriteInitialization::writeBrush() be able to generate PythonFriedemann Kleint2019-04-121-19/+27
| | | | | | Task-number: PYSIDE-797 Change-Id: I7c4e204a5ac9be2dee8f06c38323a15a0372fe5c Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* uic: Refactor WriteInitialization::writeIconProperties() and add PythonFriedemann Kleint2019-04-121-43/+64
| | | | | | | | | Unfold the function with returns to reduce nesting and add language handling. Task-number: PYSIDE-797 Change-Id: Ie6c47745b118d75c0bb2c9eea7d52c8f0377f1a6 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* uic: Fix enum values for PythonFriedemann Kleint2019-04-083-77/+109
| | | | | | | | Add a helper for replacing "::" by "." for Python. Task-number: PYSIDE-797 Change-Id: I017d430b0b8b2ffbbd3300d583603924fee4d479 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* uic: Port method calls to pythonFriedemann Kleint2019-04-083-128/+228
| | | | | | | | | Use the language helper for dereferencing pointers and end of line. Task-number: PYSIDE-797 Change-Id: Icbca9015f2a3e8800ad4a56edf8fef9ee43f4528 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* uic: Adapt connection syntax to PythonFriedemann Kleint2019-04-054-18/+59
| | | | | | | | | | Extend WriteInitialization::findDeclaration() to return the class name (on this occasion preparing for generating Qt 5 connection syntax) and add a helper function for formatting the connection. Task-number: PYSIDE-797 Change-Id: I7507f604c8275c93d347b7a6a5d5b5a2a5f3ffd5 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* uic: Add qualification with "self." for PythonFriedemann Kleint2019-04-052-5/+12
| | | | | | | | | Prepend "self." (this) to the name stored in the class Driver's hashes as specifying it is mandatory in Python. Task-number: PYSIDE-797 Change-Id: I1da110b84b2d1131ee6af915f9cc4ba21d7de710 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* uic: Add pythonFriedemann Kleint2019-04-0513-48/+630
| | | | | | | | | | | | - Add command line option - Add import (include) handling - Add language helpers like streamable classes for Function definition, object instantiation - Implement header comment formatting Task-number: PYSIDE-797 Change-Id: I15041ab16504ea159f6665781a829cd548585af1 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* uic: Refactor string constant formattingFriedemann Kleint2019-04-054-117/+226
| | | | | | | | | Refactor the fixString() helper, moving the code into a streamable class using a helper which can be used for different encodings. Task-number: PYSIDE-797 Change-Id: I0f82945b6b334da8524882dda2f104327eba79d4 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-04-031-3/+3
|\ | | | | | | Change-Id: I99a27f9a0402e1ccad45a2d062d784f8d9a08dd3
| * Fix remaining Q_DECL_OVERRIDE instancesAllan Sandfeld Jensen2019-04-021-3/+3
| | | | | | | | | | Change-Id: I512ea5a6c8cf2928b276af7f83f00a1df5879595 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | uic: Refactor reverse name lookupFriedemann Kleint2019-04-023-27/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a helper routine to look up the dom classes by attribute name and change Driver::widgetByName() and Driver::actionByName() to use that as does Driver::actionGroupByName() (all these functions are called with names from the XML files). Remove the name normalization in WriteInitialization::findDeclaration() and refactor WriteInitialization::acceptActionRef() to call findOrInsert() to correctly use the unique name. Task-number: PYSIDE-797 Change-Id: I34058361964719c442182faf798f055f11b40412 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-03-161-1/+1
|\| | | | | | | Change-Id: Ief0a0b754c104d5348fee9ee15e967bd37c526f8
| * Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-03-151-1/+1
| |\ | | | | | | | | | Change-Id: I2bf3b4ceb79364330eae4cbf3cdee9a82d1be46d
| | * uic: write out min/maximumSectionSize property before current sizeChristian Ehrlicher2019-03-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since faff43348bfae5cfc709fabe9d2698fc3063c050 the min/maxSectionSize is respected when setting the current/default section size programatically. This is not honored when writing out the properties and therefore the default section size is not correctly set when it's smaller then the default minimum section size. Therefore make sure to set min/maxSectionSize property before all other properties. Fixes: QTBUG-74352 Change-Id: I8f9ede3e90b7c9c65f8440953b00e1d9d6006d38 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* | | More nullptr usage in headersKevin Funk2019-03-141-2/+2
|/ / | | | | | | | | | | | | | | | | | | | | Diff generated by running clang-tidy's modernize-use-nullptr checker on the CMake-based Qt version. Skipping src/3rdparty, examples/, tests/ Change-Id: Ib182074e2e2fd52f63093f73b3e2e4c0cb7af188 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | uic: Fix broken icon code generationFriedemann Kleint2019-01-231-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | Change b86d0b62156993936bf93169a895a92ad60adf7d rearranged the sequence of function calls when generating code adding QTabWidget and QToolBox pages, not taking into account that the iconCall() has a side effect (writing out icon definition) Revert that part and add a comment. Fixes: QTBUG-72980 Task-number: PYSIDE-797 Change-Id: Ie8fbaa36f21cd4408fb1f491195da5c260708e6c Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* | uic: Refactor CustomWidgetsInfo::extends()Friedemann Kleint2019-01-105-42/+75
| | | | | | | | | | | | | | | | | | | | | | | | Add a extendsOneOf() helper that takes a QStringList to be searched and simplify the code accordingly. In WriteInitialization::acceptWidget(), move the variable CustomWidgetsInfo *cwi up and reuse everywhere to shorten code. Task-number: PYSIDE-797 Change-Id: I331e135b6aa58dbbd413ca151eb67b3eb92f09c6 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-12-151-1/+18
|\| | | | | | | Change-Id: Iad06d8c07dfc288c9d1a9f7ee3520285cea60546
| * uic: Generate version check macros around newly introduced palette color roleFriedemann Kleint2018-12-141-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | Change ebd3a13b807c6af2684b42d3912549caf7ef82aa introduced a new QPaletter::PlaceholderText color role which causes the uic-generated code not to compile when using Qt Designer embedded in Qt Creator with older (5.9 LTS) kits. Generate a version check macro to fix this. Change-Id: I6d9f7edb0c6047c2f64ef3357b29f91655c52aac Fixes: QTBUG-72555 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> Reviewed-by: André Hartmann <aha_1980@gmx.de>
* | uic: Refactor DOM class lookup in class DriverFriedemann Kleint2018-12-133-61/+54
| | | | | | | | | | | | | | | | | | Change the API to take const Dom * classes and use a helper function to do the insertion. Task-number: PYSIDE-797 Change-Id: I079f5c92bae85d6246c14077db06e381b572cda5 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* | uic: No longer generate static_cast for enum values in legacy formsFriedemann Kleint2018-12-133-24/+111
| | | | | | | | | | | | | | | | | | Add a lookup for the affected enum values and use the names instead. Task-number: PYSIDE-797 Change-Id: I6be166409000aff83d9465c9a3b2f37b44c5c085 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* | uic: Small refactoringsFriedemann Kleint2018-12-127-120/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Do not use QString::number() to stream numbers. - Do not use QLatin1String/Char to stream strings or characters. - Add a convenience methods to determine the container page add method for simple containers. - Similarly, extract a method to determine the layout method and simplify the code accordingly. - Fix Clang warnings about else if after return/continue. - Use QString::isEmpty() instead of size() to check emptiness. - Fix QHash-contains()/value() Antipattern Task-number: PYSIDE-797 Change-Id: I9c61d20f46c8d142b947126a27faaf54b41f9e0c Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* | Use Q_DISABLE_COPY_MOVE for private classesFriedemann Kleint2018-12-122-2/+2
| | | | | | | | | | Change-Id: I3cfcfba892ff4a0ab4e31f308620b445162bb17b Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | uic: Generate correctly qualified invocation of QCoreApplication::translate()Friedemann Kleint2018-12-031-1/+1
| | | | | | | | | | | | | | | | | | Change QApplication::translate() to QCoreApplication::translate() in generator and tests. Task-number: PYSIDE-797 Change-Id: I0bbaf1f280b74b3b2a701a39203c059ab82fce1f Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* | uic: Remove unused codeFriedemann Kleint2018-12-0311-168/+1
| | | | | | | | | | | | Task-number: PYSIDE-797 Change-Id: I6958ad76c138dcb4126cda8b26f23311963d6d37 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* | uic: Generate code for container page tooltips using the Qt configure systemFriedemann Kleint2018-11-191-12/+18
| | | | | | | | | | | | | | | | | | | | Previously, the generation of this code was #ifdefed in uic itself. However, the #ifdef should be in the generated code (anticipating the cmake port where host and target builds might differ). Task-number: PYSIDE-797 Change-Id: I46255f852f5f6a3d95d3a20456b6f00f2067a3fe Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* | uic: Use the Qt configure system when generating codeFriedemann Kleint2018-11-135-36/+190
|/ | | | | | | | | | Replace the generation of #ifdef's for the macros by QT_CONFIG checks. Implement it using streamable classes to make it easier to switch the output language later. Task-number: PYSIDE-797 Change-Id: I28b5ed3ec80cd525a3df0cd54d9be4f09149cde4 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Merge remote-tracking branch 'origin/5.11' into 5.12Liang Qi2018-11-091-1/+1
|\ | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf qmake/Makefile.unix src/gui/text/qtextdocument.cpp src/gui/text/qtextdocument.h Change-Id: Iba26da0ecbf2aa4ff4b956391cfb373f977f88c9
| * Modernize the "textcodec" featureLiang Qi2018-11-071-1/+1
| | | | | | | | | | | | | | | | | | Also clean up QTextCodec usage in qmake build and some includes of qtextcodec.h. Change-Id: I0475b82690024054add4e85a8724c8ea3adcf62a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | uic: Remove remains of old Java generatorFriedemann Kleint2018-11-016-113/+13
| | | | | | | | | | | | | | | | Preparing the use of the option for Python. Task-number: PYSIDE-797 Change-Id: Ia1267b227ceac7f9dcbcfde6ed7c1480ef790f2a Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* | uic: Ignore obsolete pixmap functionsFriedemann Kleint2018-10-161-2/+6
| | | | | | | | | | | | | | | | | | | | | | After qtbase/550d2a0a15c9403894448ab83863e71bbac2d349, pixmap functions are used for icons as well which can cause compile errors for old UI files that still use them. Task-number: QTBUG-8563 Change-Id: I61bd4b9c1bf774e071a35c5806657054a77ff4d0 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | uic: Write the float and double properties in 'f' formatJarek Kobus2018-10-051-2/+2
| | | | | | | | | | | | | | | | Make the code consistent with the DomProperty::write() method. Task-number: QTBUG-70613 Change-Id: I622b4a019a4473823584de97304f8324f2cf0c6b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>