aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Introduce Qt.Bridge.DotNet dotnet CLI item & project templatesHEADdevKarsten Heimrich11 days10-0/+398
| | | | | Change-Id: Id950260d748edf2066e099f598da49c47dda3810 Reviewed-by: Miguel Costa <miguel.costa@qt.io>
* Make use ot the QtTemplateFile task to update README.md fileKarsten Heimrich11 days3-6/+31
| | | | | | | Replaces the hard-coded package name and version number in the README. Change-Id: I507fd4fb4fe42edd66c801fdf3c24ca750eff8ed Reviewed-by: Miguel Costa <miguel.costa@qt.io>
* Introduce QtTemplateFile task to replace placeholder tokens in filesKarsten Heimrich11 days2-0/+62
| | | | | Change-Id: I5f4bb86c5d11e19f639542e281ecc7ee82d55689 Reviewed-by: Miguel Costa <miguel.costa@qt.io>
* Add missing HOW-TO to solution filesKarsten Heimrich11 days1-0/+1
| | | | | Change-Id: Ib410544e63363c240cea73796aa215694a9e0617 Reviewed-by: Miguel Costa <miguel.costa@qt.io>
* Supress windeployqt translations warningMiguel Costa13 days2-0/+10
| | | | | Change-Id: I37cc98b8fea066de651547f455ea61bc9529108b Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Add test for incremental buildMiguel Costa13 days2-0/+115
| | | | | Change-Id: Ib8666b7f6a02a122c40730b990debc7e0bc89704 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Fix incremental buildMiguel Costa13 days1-24/+3
| | | | | Change-Id: I905f5eeaf6d0e3e4c8fd0a22f94f898800957ce9 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Tests: Expose complex user-defined types to QMLKarsten Heimrich13 days5-0/+216
| | | | | Change-Id: I8882068d8711f596817bce2d5a71cd6ccf4a49c3 Reviewed-by: Miguel Costa <miguel.costa@qt.io>
* Tests: Share Qt native test setup and inject CMake sourcesKarsten Heimrich13 days10-137/+560
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This refactors the Qt/.NET native test harnesses to use shared setup code on both the C++ and managed sides, and hooks additional sources into the generated CMake project. - Introduce QtTestSetupBase (C++) to encapsulate common host bootstrap: locating the managed test assembly, running the app (sync/async), waiting for readiness, initializing the Qt/.NET adapter and finalizing/unloading the host. - Add BridgeExitCode enum (C++) and mirror it as ExitCode (C#) with ExitCodeHelper so managed tests can report bridge infrastructure failures with descriptive messages. QTest keeps using exit code 1 for test failures; bridge errors use 101+. - Add QtQuickTestSetup (C++), a reusable QtQuickTest setup class with overridable hooks (before/after applicationAvailable, qmlEngineAvailable and cleanupTestCase) and centralized Ready/Finalize handling. - Introduce ManagedTestBase (C#) to DRY TempProject creation, native build, and configuration for QtTest/QtQuickTest, including CMake injection and shared header/source replacement. - Update Test_QtTest and Test_QtQuickTest to inherit from ManagedTestBase, removing duplicated TempProject and build/run boilerplate. - Add CMake.InjectQtSourcesTargets helper (C#) to inject native headers/sources into the generated CMakeLists.txt via an MSBuild CodeTaskFactory task that patches the qt_add_executable() source list. - Extend the test .csproj to copy the shared C++ setup files to the output so they can be picked up by ReplaceGeneratedFiles. - Dump the build output to the test output pane if the C++ build fails. Change-Id: Ic1c96c89c9378caf06b7ca23ebadf32c23d2bc6f Reviewed-by: Miguel Costa <miguel.costa@qt.io>
* Fix readme files after recent project reorgKarsten Heimrich13 days2-17/+6
| | | | | Change-Id: Idb9d5da1d3d6a0320535d04fc6e2f7172ff47996 Reviewed-by: Miguel Costa <miguel.costa@qt.io>
* Update README.mdMiguel Costa2025-11-285-598/+52
| | | | | Change-Id: I3a7cb848a1b5ab0436f4ca50b097ac5cdeca36b6 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Add build- and run-time test frameworkMiguel Costa2025-11-2817-0/+1041
| | | | | Change-Id: I23b2ca722baeaeb634259037663e75ff9242e461 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Allow custom code generation in CMakeLists.txtMiguel Costa2025-11-281-0/+2
| | | | | | | Required to specify additional Qt modules (e.g. Qt Test). Change-Id: Iba5a2b4597be02dcff80537db4852b9240fe2987 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Use more generic QML engine typeMiguel Costa2025-11-287-32/+32
| | | | | | | | Now using QQmlEngine instead of the derived type QQmlApplicationEngine. No behavior change. This is only relevant when using Qt Quick Test. Change-Id: I93759541b975400de6946c72a150f94cc226ebd8 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Add macro to embed assembly name in native hostMiguel Costa2025-11-282-8/+11
| | | | | Change-Id: I532c6feb15eaba7aa41432dc25a8a625f89f4cc8 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Fix vswhere output showing up in build logsMiguel Costa2025-11-261-0/+2
| | | | | Change-Id: I6b4b047768e12b6b0b3ccc30cb9fec2c356daba5 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Choose between Ninja and MSBuildMiguel Costa2025-11-263-21/+32
| | | | | | | | | | | | | | | Allow choice of CMake generator, given the value of $(QtBuildSystem): * "ninja" => Ninja generator * "msbuild" => MSVS generator If $(QtBuildSystem) is not set, the Ninja build system is used by default. If VC targets are not available, e.g. when building user projects on the command line with `dotnet build`, and regardless of the value of $(QtBuildSystem), the Ninja build system is always used. Change-Id: I41632302f8cca76582256a149152679b9d4e30ec Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Refactor example projectsMiguel Costa2025-11-2628-139/+191
| | | | | | | | | | | | * Create new .sln in the `examples` dir * Use package when building examples outside of the topmost .sln * Disable build of examples by default in the topmost .sln - Projects can still be manually built and debugged * Renamed `GeneratorTestApp` as `Primes` * Renamed `PackageTestApp` as `CityTemperatures` Change-Id: I333ba1941f3ccb021cb2681da09bcad8024ae186 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Exit Qt app when .NET thread returns earlyMiguel Costa2025-11-261-4/+12
| | | | | | | Fix app frozen after .NET thread exits before `exec()` of the Qt app. Change-Id: Iaca005ac7919241ed2435b7f12783405197cb8b2 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Make changes to package projectMiguel Costa2025-11-262-39/+55
| | | | | | | | | | | | | | | | * Hide package files in solution explorer (except README.md) * Incremental build: trigger build if package version changes * Target `UpdatePackageFiles`: build-time re-evaluation of list of package files. - Fixes: Qt/.NET type headers (e.g. `QDotNetObject`) missing from package due to not being generated at evaluation time. * Package Qt files in `tools` folder - Fixes: Entire Qt installation copied to user project output * Remove previous versions of the .nupkg from output path - Fixes: `nuget init` copying old package versions Change-Id: I2c4d328cbdea1bed6079ecc5d3a843aecff2ff49 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Add version managementMiguel Costa2025-11-267-1/+201
| | | | | | | | | Implements a centralized source of version information that can be used to ensure all binaries and packages generated by a build are in-sync with respect to their versions. Change-Id: Idbfff120a656b7daa3c3a410ce8aa4b9b305c7be Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Update nuget package README.md after attribute changesKarsten Heimrich2025-11-171-2/+2
| | | | | Change-Id: I044df9611ab3de149c7a430149afffed509907b3 Reviewed-by: Miguel Costa <miguel.costa@qt.io>
* Complement 'Refactor object type mapping and conversion' with auto-testsKarsten Heimrich2025-11-171-0/+220
| | | | | Change-Id: Ibf8938465bc05961d9ee728c9e8750aa3733adda Reviewed-by: Miguel Costa <miguel.costa@qt.io>
* Add PackageTestApp projectMiguel Costa2025-11-175-0/+247
| | | | | Change-Id: Ibe3b17de18e9ffd5a39ac978bfbe18a508ee8fe3 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Add nuget package support for Qt Windows x64Karsten Heimrich2025-11-174-4/+220
| | | | | | Change-Id: Ic058fea0614deaba50aa43507fc0b6161ba97450 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io> Reviewed-by: Miguel Costa <miguel.costa@qt.io>
* Add nuget package support for Qt.Bridge.DotNetKarsten Heimrich2025-11-178-0/+263
| | | | | | | | | | * Add Qt.Bridge.DotNet.targets and Qt.Bridge.DotNet.props files to satisfy nuget pack (files must match the package name). Task-number: QTBUG-134984 Change-Id: I7cec8d2b7517f381204e0cd4e269c213effdfdf1 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io> Reviewed-by: Miguel Costa <miguel.costa@qt.io>
* Implement VS workload detection as MsBuild targetKarsten Heimrich2025-11-172-4/+56
| | | | | | | | | This patch adds a new MSBuild target to check for required Visual Studio workloads. If a workload is missing, the build fails with an error message. Change-Id: I520a3da0ebd935c90315b587ed7e28d14a03e192 Reviewed-by: Miguel Costa <miguel.costa@qt.io>
* Complement "Refactor source filtering attributes" with more auto-testsKarsten Heimrich2025-11-171-0/+940
| | | | | Change-Id: Ief59de29dac764e31408b6712a4909a190aaf383 Reviewed-by: Miguel Costa <miguel.costa@qt.io>
* Refactor source filtering attributesMiguel Costa2025-11-178-33/+215
| | | | | | | | | | | * Renamed `[Qt.Exclude]` as `[Qt.IgnoreType]`. * `[Qt.Include]` will now apply only to type definitions. - A new, derived attrib, `[Qt.Enable]` can be applied to members. - This is internal and only available in the Adapter assembly. * Added doc: "Filtering code generation sources using C# attributes". Change-Id: I0d45cd6d34a63cd51aa065e0fe3fafb5231a199a Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Remove graphviz dependencyMiguel Costa2025-11-147-178/+3
| | | | | Change-Id: I6790f92526c2042e8a921903034667f0420ba8c5 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Complement "Add DependsOn condition to generation rules" with auto-testsKarsten Heimrich2025-11-132-0/+207
| | | | | | | | | * Adjust test code generator to accept additional rules * Add tests showcasing the DependsOn conditon Change-Id: I7e403f2bffbdcb6765ae4d8dfe8ea7f12b8f4d18 Reviewed-by: Miguel Costa <miguel.costa@qt.io> Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Complement "Allow type casting in QML" with auto-testsKarsten Heimrich2025-11-131-0/+143
| | | | | Change-Id: Ie5d39ada2e923bc1fe20ff01dde3cb1773f1d2a1 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Check gen rule circularities and dead-endsMiguel Costa2025-11-133-3/+129
| | | | | Change-Id: I5758a0127be73964056b91da560a3f38de37eb8b Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Generate unique names for cast functionsMiguel Costa2025-11-133-6/+6
| | | | | Change-Id: I175385d20f7f37d3077faa021e29ea6db8d8bbf7 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Avoid generating reserved keywordsMiguel Costa2025-11-1113-16/+175
| | | | | Change-Id: Ib0d50fe1d81c12aabfac2b7b5b8f977d2fb4a0cb Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Update Tutorial example appMiguel Costa2025-11-111-4/+9
| | | | | | | Now using `ColumnLayout` instead of `Column`. Change-Id: Ib98d8564b222b032bd484b5d809fe393a63a6076 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Add ColorPalette demoMiguel Costa2025-11-1118-53/+976
| | | | | Change-Id: I85006e535a28898166ad225105519422eb3582d9 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Add colorpaletteclient QML and resource filesMiguel Costa2025-11-1123-0/+1189
| | | | | | | Copied from https://code.qt.io/cgit/qt/qtdoc.git/tree/examples/demos/colorpaletteclient Change-Id: I62b7c807eae9afa794ac56c4ae1ed6c76f249cb9 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Allow type casting in QMLMiguel Costa2025-11-113-2/+75
| | | | | | | | Using the TypeCast object allows casting objects as other reference types. TypeCast defines one cast function per generated reference type. Change-Id: Id99fe82e9f94ab63c237bbc68caef72867a15e2f Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Add DependsOn condition to generation rulesMiguel Costa2025-11-111-4/+24
| | | | | | | | | | A rule that defines a `DependsOn` list of sources will not start execution until all sources on the list have been successfully processed. If the processing of a source is unsuccessful (i.e. one of the rules applied to that source fails), all rules that depend on that source will fail. Change-Id: Iee559ce5fe382067f03a93d6131c974684b269bc Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Refactor object type mapping and conversionMiguel Costa2025-11-1121-165/+449
| | | | | | | | | | | | | | | | | | | | | | | | * Mapping `object` to `QVariant` * Add missing conversions to `ValueConverter.cs` - `Uri`, `ModelIndex`, `char` * New meta-function traits - `Arg`: generate type name as function argument or return type - `Star`: generate `*` when required by the source type * Moved method `asDotNetObject()` to `GenerateClass` - Previously, only types that were generate as QML elements would define this method. * `asDotNetObject()` now returns `QDotNetObject *` * Renamed/moved `asQObject()` to `Convert::moveToHeap()` * Renamed/moved `QtDotNet::as<T>()` to `Convert::as<T>()` * `Convert::as<T>` and `Convert::moveToHeap` now have a `context` arg - This is an optional `QObject *` that is used to check if object ownership must be set to `JavaScriptOwnership`. * `Convert::toVariant` also has an optional `context` arg - Forwarded to `Convert::as<T>` in case input is an object. * No longer caching field values Change-Id: I645012425c73ffd96aa83b534456986c997abe51 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Extend dispatch to all object typesMiguel Costa2025-11-103-20/+18
| | | | | | | | Mapping of object refs to an appropriate wrapper type will now use the same mechanism that was already used for event type dispatch. Change-Id: Ie82b6f32c2069f56048ced2788b1e1e9e5d87b96 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Allow use of `Wrap` meta-char in `MFn` outputMiguel Costa2025-11-103-3/+5
| | | | | | | | | Also, `Wrap` will now consume all subsequent white-space chars. Previously, a line feed was required to immediately follow a `Wrap` meta-char. Change-Id: I51589bc1c9f351fe08b47102c1bc924634f8a36f Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Allow all standard event delegatesMiguel Costa2025-11-101-1/+0
| | | | | | | | | | Delegates for events participating in code generation will now only be required to have 2 args, with the 2nd arg derived from `EventArgs`. This will extend support to event delegates that do not return `void` or have a `sender` arg different from `object`. Change-Id: I334c9802f941ae6288df2ce053b8a105a6b63fed Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Ensure correct process terminationMiguel Costa2025-11-101-1/+7
| | | | | | | | | | * Shutdown QML engine on `aboutToQuit` signal from Qt app * Sync with .NET thread termination * On Windows, call `ExitProcess` to force process termination - Fixes process hanging on exit when running mixed mode debugging Change-Id: Ie05cd856cabbf32cacb289c04888d5bb38099b20 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Validate QmlElement.Name and emit correct macros or errorKarsten Heimrich2025-11-104-8/+150
| | | | | | | | | | | | | | | | | | | | - GenerateClass: Precompute QML macros. If Name is explicitly provided but invalid, return a error (descriptive) instead of silently emitting QML_ELEMENT. Otherwise: * QML_ELEMENT when Name is omitted * QML_NAMED_ELEMENT(<Name>) when valid - TypeExtensionsForGenerationRules: Validate using ^[A-Z][A-Za-z0-9_]*$(First char uppercase, followed by letters/digits/underscores; rejects whitespace/special chars). - TestCodeGenerator: Include rule error messages in the thrown exception to aid debugging. - Tests: Verify named vs unnamed element macro emission, invalid-name failures, and singleton macro presence. Change-Id: I054728c625a7fff6b1dfcbf512811672ce18f38e Reviewed-by: Miguel Costa <miguel.costa@qt.io>
* Fix error with missing attributes propertiesKarsten Heimrich2025-11-102-2/+114
| | | | | | | | | | | | | | | | | Setting an attrib without the `Name` property would cause code generation to fail (e.g., setting `[QmlElement(Singleton = true)]` on a type). Note: We cannot test the generic versions of {Try}Property<T> due to AssemblyLoadContext/type-identity mismatches (TypeOf<T>). - TypeExtensionsForGenerationRules.QmlElementName: Use TryProperty<string> to read optional properties. - Tests: Add coverage for misspelled/missing/valid QmlElement properties. Change-Id: I942c75a22de0a822a9544e44a393609fb6e903cd Reviewed-by: Miguel Costa <miguel.costa@qt.io>
* Align test-file names, no code changesKarsten Heimrich2025-11-062-0/+0
| | | | | Change-Id: Ie9f8b76055cc15ed2f60346d0c04c32c5787dfe5 Reviewed-by: Miguel Costa <miguel.costa@qt.io>
* Refactor TextCaseMiguel Costa2025-10-2811-111/+94
| | | | | | | | * Moved to namespace `Qt.DotNet.Text` * Slim down API to SplitCase(...), ToCase(...) and ConvertCase(...) Change-Id: Ie10c3ae966cf5cdff30b8c10d7a1a40d64692660 Reviewed-by: Miguel Costa <miguel.costa@qt.io>
* Fix deployment step of Release configMiguel Costa2025-10-241-0/+1
| | | | | Change-Id: I5e1de38b844239f611997df88d3b8822678d412d Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>