summaryrefslogtreecommitdiffstats
path: root/tools/dumpcpp/main.cpp
Commit message (Collapse)AuthorAgeFilesLines
* dumpcpp: Acknowledge metaobject revision changeFabian Kosmale2021-04-011-1/+1
| | | | | | Fixes: QTBUG-92351 Change-Id: Icc647f57840f7c2d86403bc0a5029f3b9fe4ef5a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix crash in dumpcpp-generated codeFriedemann Kleint2021-03-151-18/+12
| | | | | | | | | | | QWidget/QObject were generated as base classes for the generated class, which is no longer correct after the introduction of the QAxBaseWidget/Object classes. Pass the correct base QMetaObject and simplify the code since there is always a base class now. Pick-to: 6.1 Change-Id: I822f2de4ce65785cd45dc3b4adf1923efae556be Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* dumpcpp: Check 64 bit registry keys for 64bit buildsFriedemann Kleint2020-09-151-3/+14
| | | | | | | | | Add a check depending on pointer size. Pick-to: 5.15 Fixes: QTBUG-86666 Change-Id: I6bb39e94e677e9f9c72b15949e7b463e1f4776d2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* dumpcpp: Adapt to QMetaType changesFriedemann Kleint2020-09-071-38/+5
| | | | | | | | | - Fix qRegisterMetaType() signature - Remove the generation of the QMetaTypeFunctionHelper specialization Change-Id: I844b495557e4935ca4ab54f9ac47e24adb158f72 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Bump dependency version and fix compile errorsFriedemann Kleint2020-08-191-1/+1
| | | | | | | | - Adapt to QMetaType/QVariant changes - Adapt to QIODeviceBase Change-Id: I7cb6b9b0bbc68954c839c2026e3984fd7f913ef9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Use QList instead of QVectorJarek Kobus2020-06-231-1/+1
| | | | | | Task-number: QTBUG-84469 Change-Id: I822b48d0f5568ad271b148a3e2058d59097f0154 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Some minor fixes to build against latest Qt dev branchKarsten Heimrich2020-06-101-1/+1
| | | | | Change-Id: Ice7a1064c95fcb6a73904fdc188c9b0363f17150 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove hard-coded QMetaObject dataFriedemann Kleint2020-05-281-1/+1
| | | | | | | | | | | | | Introduce QAxBaseObject and QAxBaseWidget providing the static properties and signals of QAxObject and QAxWidget. Rename the QAxBase methods to be called from the metacall implementations of QAxObject and QAxWidget. Add "classContext" as a real property on this occasion. Change-Id: Ia4f4e45e091e2d575ed9e6b2dd212139a1146300 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* dumpcpp: Use moc to generate metaobject codeFriedemann Kleint2020-04-081-485/+36
| | | | | | | | | | | | | | | | dumpcpp contained an old version of moc code, which is now out of date. Write out the interface as C++ code and run the real moc on it to generate this. Some modifications are required. Remove some asserts that checked on an empty meta object created in the fallback path of QAxBasePrivate::metaObject() which was removed by 0bcdc74f55574e1a45bef8728bd5093cf1acfc33. Task-number: QTBUG-82945 Change-Id: Ide58bae1440331ea4d5da0fcc74b41f49f09599a Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix build of QtActiveQt after moc string data changesSimon Hausmann2020-01-131-12/+4
| | | | | | | | | | Commit e58b44d557b859b7b55869f1e137aa1bc8968307 in qtbase changes the meta-object to store string data as an array of offsets and length into the char array instead of a synthetic QByteArrayData (in the old format). This is a port to the new data structure. Change-Id: Ieacfdab69d799f954d9351f8424284b1e6633698 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-11-191-14/+14
|\ | | | | | | Change-Id: I1e014608bc0a7b07a37a18d43dc3ecc7eb281321
| * Reduce QList usageFriedemann Kleint2019-11-141-14/+14
| | | | | | | | | | | | | | | | Prepare for migration to Qt 6 by using QVector where possible. Otherwise, use auto or typedefs like QVariantList. Change-Id: I6d385efe1a45a0519cf4bb06a1f6d1ea869e890e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | Fix Qt6 buildAlexandru Croitor2019-08-011-218/+218
|/ | | | | Change-Id: Iaaa644cfe6777b0ffbe3fb5850fb58b323715fd2 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* dump: Generate C++ 11Friedemann Kleint2019-06-071-42/+73
| | | | | | | | | | | | | | | - Use nullptr, override - Move the constructor body to the implementation on grounds of * Avoid code bloat by inlined constructors * Avoid the ugly C-style cast from IDispatch to IUnknown since both are just forward-declared in the header [ChangeLog][ActiveQt] dumpcpp now generates the constructor code into the .cpp file. Change-Id: I180f64c2b32793d64080ecb8c4246b44b6c0b615 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* dumpcpp: Fix Clang warningsFriedemann Kleint2019-06-071-34/+31
| | | | | | | | | | | | - Use const ref to avoid copies of variables - Use range-based - Streamline code a bit; loop over maps directly instead of key lists - Avoid repetitive calls to toLatin1() - Signedness issue converting QVariant::Type Change-Id: I04ec73548f0a56edea8e3c0e8ee76c23a65aa07b Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Fix class structure and definitionsFriedemann Kleint2019-06-041-1/+1
| | | | | | | | | | - Add override - Use "= default" for trivial constructors/destructors - Q_DISABLE_COPY_MOVE to delete move constructors and assignment Change-Id: If773ad8c092ab8000b268c4231f7f27e5f484e56 Reviewed-by: André de la Rocha <andre.rocha@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Introduce nullptrFriedemann Kleint2019-06-041-12/+12
| | | | | | | Apply Fixits by Qt Creator with some amendments. Change-Id: Ia47cee2d55432ddc14635aa593c52d80ab39cc82 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Introduce member initializationFriedemann Kleint2019-06-041-4/+4
| | | | | | | | | | | Fix warnings emitted by clang, use default constructors where applicable. Remove some unused members. Change-Id: I287ffa4d884be253ec5272e4266a1645376e7235 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* dumpcpp: Fix MinGW compile error when declaring enumsFriedemann Kleint2019-04-301-1/+14
| | | | | | | | For MinGW, add {} to make it syntactically valid C++. Task-number: QTCREATORBUG-22320 Change-Id: I6113fbe91e531ac2b6c087f6813b0608b56bc73b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove compatibility with older qtbaseKai Koehne2018-08-251-1/+1
| | | | | | | | | Amends 4bbc782fc70f30e8b15. Task-number: QTBUG-69911 Change-Id: I821739583e347f95a0aa114008e01db1e42eef92 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Adapt to QMetaObjectPrivate changes in qtbaseKai Koehne2018-08-141-1/+1
| | | | | | | | | | Commit 1c623bc6d1c0a7c in qtbase bumped QMetaObjectPrivate::OutputRevision, which caused qtactiveqt builds to fail. Task-number: QTBUG-69911 Change-Id: I40be892d8c80fdc4706ae176bbafb302fdd00921 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Replace CoInitialize calls with CoInitializeExFredrik Orderud2018-08-131-2/+2
| | | | | | | | | | | | Done to make single-threaded apartment (STA) usage more explicit. CoInitializeEx(0, COINIT_APARTMENTTHREADED) does exactly the same as CoInitialize(0), so there is no change in behavior. REF: https://docs.microsoft.com/nb-no/windows/desktop/api/combaseapi/nf-combaseapi-coinitializeex Change-Id: I2e2f77745b4360b1da1e6c284551d0f709aba546 Reviewed-by: Andre de la Rocha <andre.rocha@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* dumpcpp: fix generated string literalOswald Buddenhagen2018-04-201-1/+1
| | | | | | | reported by 'olehs' on github. Change-Id: If07cf9b9b753d46513a80aa2d854d0b55b27dcff Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Replace Q_NULLPTR with nullptrKevin Funk2017-09-291-2/+2
| | | | | Change-Id: I0df68cec43511537b61ddfe74bd677be7a598eae Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* dumpcpp: make dump QT_NO_CAST_FROM_ASCII proofEric Lemanissier2017-06-161-3/+3
| | | | | Change-Id: I4873179ec8ff42173009973ac96dea3a2bbdb014 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Remove foreachFriedemann Kleint2017-01-101-2/+3
| | | | | | | Use range based for. Change-Id: If91077be5bb13aa1447866c4243511db72d4f46c Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-011-1/+1
|\ | | | | | | Change-Id: I3439e998c2a86d7bf28becca3b5db174839fb825
| * dumpcpp: Fix regression when creating function signatures.Friedemann Kleint2016-06-271-1/+1
| | | | | | | | | | | | | | | | | | Revert a part of change 1a7b140eb8f3f03354452c4669aabae2f141b9c8, which removed the assignment to a different variable. Task-number: QTBUG-54000 Change-Id: Ic15411259445afa50770487a37f8762fe57975e9 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Fix build with QT_NO_CAST_FROM_ASCII.Friedemann Kleint2016-06-271-3/+4
| | | | | | | | | | | | Task-number: QTBUG-54352 Change-Id: I608a253819241d23241f9f8d37782726a1f93a03 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.7v5.7.0-beta1Liang Qi2016-04-081-8/+8
|\| | | | | | | | | | | | | Conflicts: src/activeqt/container/qaxwidget.h Change-Id: Ic6e7267fc71e3ace14e75b392ad3f7cac0df41a1
| * Fix warnings as shown by Qt Creator's Clang based code model.Friedemann Kleint2016-03-221-8/+8
| | | | | | | | | | | | | | | | Remove C-style casts and fix integer conversion issues. Task-number: QTBUG-50804 Change-Id: Ib5913bc5262a2c141f34d9f70fe6ec4139a63e4f Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7v5.7.0-alpha1Liang Qi2016-02-151-12/+22
|\| | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I06247d29c4b05020e91bb377a7f93e5374184f47
| * dumpcpp: Introduce flags type ObjectCategories for enum ObjectCategory.Friedemann Kleint2016-02-121-10/+20
| | | | | | | | | | | | | | | | The enumeration values are mostly used as flags with some unnecessary casts. Clean this up by introducing flags. Change-Id: Iab03acb9ab83624bd0e3a6812255d7215d502003 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
| * String fixes.Friedemann Kleint2016-02-111-2/+2
| | | | | | | | | | | | | | | | | | | | - Avoid conversion from QString to QByteArray. - Replace a = a.mid() by a.remove(). - Replace a = a.left() by a.truncate(). - Streamline code extracting an error code. Change-Id: I43c1f04e947632f725bbb86af5abf108b2b02261 Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
* | Updated license headersAntti Kokko2016-01-251-17/+12
|/ | | | | | | | | | | From Qt 5.7 -> tools & applications are licensed under GPL v3 with some exceptions, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one (in those files which will be under GPL 3 with exceptions) Change-Id: I28b956229a96fd982b22640226a716c1a4f3aa0d Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-06-291-32/+55
|\ | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I0308544188e73d94b836685f07e44337ca57a723
| * dumpcpp: Do not generate qRegisterMetaType<> for vtable-stubs.Friedemann Kleint2015-06-161-18/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | vtable-stubs inherit QAxObject and can thus not be copied. When using qRegisterMetaType<> on them, cryptic error messages are generated: src/activeqt/container/qaxobject.h(58) : error C2248: 'QObject::QObject' : cannot access private member declared in class 'QObject' src/corelib/kernel/qobject.h(275) : see declaration of 'QObject::QObject' include\qtcore\../../src/corelib/kernel/qobject.h(96) : see declaration of 'QObject' To fix this, extract a list of the stubs at the beginning and suppress the generation of qRegisterMetaType<> for them. When writing out the class declaration, explicitly disable copy for them to make error messages clearer. Task-number: QTBUG-27792 Change-Id: Ia538a68864f3621234c1aab366b097ded881e859 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
| * dumpcpp: Add Qt version and command line to header comment block.Friedemann Kleint2015-06-091-14/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | produces: /**************************************************************************** ** ** Namespace TestLib generated by dumpcpp v5.5.0 using ** dumpcpp -o test Test.tlb ** from the type library Test.tlb ** ****************************************************************************/ Task-number: QTBUG-27792 Change-Id: I22ef45c424f07ae89e2cbae1d8c05686b0646c5c Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-06-031-0/+7
|\| | | | | | | Change-Id: I37609a137247e3203d09942e187ec880c6eba884
| * dumpcpp: Speculative fix for methods taking array type parameters.Friedemann Kleint2015-05-191-0/+7
| | | | | | | | | | | | | | | | | | | | | | QMetaMethod::methodSignature() produces for an invokable slot with array type parameters (void foo(const char p1[10],int p2)): foo(const char[10],int) Split off the array specification and append it to the parameter name. Task-number: QTBUG-46177 Change-Id: I58670570357472f6f5b7fcf0e841d3b7cb4189c8 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | remove dumpcpp's -donothing optionJoerg Bornemann2015-04-131-10/+1
|/ | | | | | | | This option was used as a hack for qmake. We know better hacks these days. Change-Id: I9fb6b40f7d2ddd40cd51ae758c86fd6d3b060035 Reviewed-by: Andy Shaw <andy.shaw@digia.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. Change-Id: I2febb46d711c51eeb08f13418a4fc15ab0502f1a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* dumpcpp: Add Q_DECLARE_OPAQUE_POINTER() for referenced types.Friedemann Kleint2015-02-021-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix errors occurring for forward-declared types in the generated header like: qmetatype.h(1354) : error C2027: use of undefined type 'stdole::Font' vcgantt.h(26) : see declaration of 'stdole::Font' qmetatype.h(1539) : see reference to class template instantiation 'QtPrivate::IsPointerToTypeDerivedFromQObject<T>' being compiled with [ T=stdole::Font * ] qmetatype.h(1546) : see reference to class template instantiation 'QMetaTypeId<T>' being compiled with [ T=stdole::Font * ] \vcgantt.h(33401) : see reference to class template instantiation 'QMetaTypeId2<T>' being compiled with [ T=stdole::Font * ] qmetatype.h(1354) : error C2338: Type argument of Q_DECLARE_METATYPE(T*) must be fully defined Task-number: QTBUG-26587 Change-Id: I9e6c87551b462bc27f94d8e8bd36497075dac8d3 Reviewed-by: Andy Shaw <andy.shaw@digia.com>
* dumpcpp: Introduce QCommandLineParser.Friedemann Kleint2015-02-021-93/+117
| | | | | | Task-number: QTBUG-41130 Change-Id: I0ee3668e302e89cb538fafc6eb4bda9d9e05f4ac Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* dumpcpp: Remove unused code.Friedemann Kleint2015-02-021-100/+0
| | | | | | | | Remove function generateClass() and unused variable castType. Change-Id: Iefbb5405e64491b9a9580128c2fa46161c074188 Task-number: QTBUG-41130 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* dumpcpp: Refactor code handling options strings.Friedemann Kleint2015-02-021-49/+47
| | | | | | | | | | Change the type from QByteArray to QString, removing some conversion code. Move nameSpace option parameter into main and turn into a QString as well. Task-number: QTBUG-41130 Change-Id: Ife42f099f725a83e91cc2b73b49cee3fa8c3898b Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Fix single character string constants in dumpcpp.Friedemann Kleint2015-01-121-54/+54
| | | | | Change-Id: I4a92d228b16fd1cd7008b36fa9fe39838a90ef9f Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Update activeqt to use new QMetaType::registerNormalizedType signatureJędrzej Nowacki2014-11-171-9/+0
| | | | | Change-Id: I492841b4c34396da250254822509e71193645ed7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* Use QString/QByteArray::prepend() where appropriate.Friedemann Kleint2014-10-091-5/+5
| | | | | Change-Id: Ifbdc828a646cab18548683829c2f45c84da0076b Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Fix usage of QString::left()/QString::right().Friedemann Kleint2014-10-091-2/+2
| | | | | | | | QString::truncate(), QString::remove() or QString::chop() should be used when assigning to self. Change-Id: Ic0582ad3bc9389cbd315dee885921628197747f2 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>