Re: [Development] Regarding qmlcachegen and qml bytecode compression

2025-04-11 Thread Ulf Hermann via Development
My question is that, does `qmlcachegen` compress the bytecode before it is embedded in the generated C++ source file? If not, is there a plan to do that or a reason not to do that? The byte code is not compressed. If it was, we couldn't mmap() it in straight from the file (which can be paged b

Re: [Development] The future of QProperty and QBindable

2025-03-24 Thread Ulf Hermann via Development
What's the benefit of not generating it on the C++ level? I mean, I understand you _can_ do that, but I don't quite see why you would prefer to introduce an inconsistency like that? QML will need a notification signal if we remove support for bindables and Robert wants to search-replace his pr

Re: [Development] The future of QProperty and QBindable

2025-03-24 Thread Ulf Hermann via Development
Whatever you change, please consider the upgrade path for people using BINDABLE in many, many places. E.g. if a new solution can be applied by regexp search & replace, or if Qt Creator offered an "upgrade fix" via light bulb, that would be great. We need to establish some "NOTIFY default" as p

Re: [Development] The future of QProperty and QBindable

2025-03-24 Thread Ulf Hermann via Development
Q_PROPERTY_FULL(int, READ int value() noexcept, WRITE void setValue(int), NOTIFY void valueChanged()) Why all the ceremony? What people probably want is: Q_DEFAULT_PROPERTY(int, value) That would expand to: Q_PROPERTY(int value READ value WRI

Re: [Development] The future of QProperty and QBindable

2025-03-07 Thread Ulf Hermann via Development
That neither does the change comparison, nor will it automatically notify about changes. You'd have to code both manually. I don't see a major improvement. Also, I guess this forces me to make the members public. Not really an alternative. You don't need to make the members public. The moc-gen

Re: [Development] The future of QProperty and QBindable

2025-03-07 Thread Ulf Hermann via Development
On 3/7/25 10:48, Schimkowitsch Robert wrote: We widely use BINDABLE in Q_PROPERTY (>500 places) because it removes a lot of boilerplate from our C++ classes. > [...] I have never had any issues using BINDABLE. I have avoided using them in complex situations, true, but for the simple use case

[Development] The future of QProperty and QBindable

2025-03-07 Thread Ulf Hermann via Development
Hi, We've had a discussion [1] about QProperty and QBindable during the last contributors' summit, but unfortunately didn't reach any conclusion. I'll summarize the most important part of the discussion here: "There is functionality to retrofit Q_PROPERTY with synthetic bindables." This may

Re: [Development] Regarding QML cache strict version compatibility

2025-03-05 Thread Ulf Hermann via Development
Hi, According to `Unit::verifyHeader()` @ `qv4compileddata.cpp`, the version needs to strictly match: This is a thorny issue. The Qt version check was put in along with a number of other checks back when they invented the QML disk cache. There was no detailed reasoning for the individual che

Re: [Development] Nominating Oliver Eftevaag as maintainer of Qt Quick Dialogs

2024-12-02 Thread Ulf Hermann via Development
+1 On 12/1/24 23:42, Jan-Arve Sæther via Development wrote: +1 I second this. He has been passionately improving the state of Qt Quick Dialogs and has been the de-facto maintainer for it since it was rewritten to Qt Quick Controls 2. Mandatory disclosure: I'm his manager at the Qt Company

Re: [Development] (Bikeshed, pedantic) East constexpr vs West constexpr

2024-09-18 Thread Ulf Hermann via Development
How about: "You should order function signature prefixes alphabetically, but you should not change existing code for only that reason". This will make things converge eventually and also covers future revelations of this kind. best, Ulf -- Development mailing list Development@qt-project.org ht

Re: [Development] Nominating Olivier de Cannière for approver rights

2024-08-09 Thread Ulf Hermann via Development
I would like to nominate Olivier de Cannière for approver rights for the Qt project. +1, he's done great work! Disclaimer: We're in the same team. best regards, Ulf -- Development mailing list Development@qt-project.org https://lists.qt-project.org/listinfo/development

Re: [Development] How to skip write property in qml's property binding?

2024-08-07 Thread Ulf Hermann via Development
Thank you Mike, My answer is "what it last was before fooObject went null", and I was use it in my project. That's conceptually not a binding. A binding is something that updates whenever any of its depedencies updates. It's value is calculated from its dependencies. In your case, however, as

Re: [Development] How to skip write property in qml's property binding?

2024-08-05 Thread Ulf Hermann via Development
Hi, you should also be able to add a RESET attribute to the property. It is conveniently triggered when assigning undefined to the property and resets it to the default value. This may be the cleanest way to deal with it. best regards, Ulf -- Development mailing list Development@qt-project.o

[Development] Fixing Qt-internal logging categories

2024-06-19 Thread Ulf Hermann via Development
Hi, First things first: Users of Qt are unaffected by most of this. They get a nicer macro to define static logging categories, but everything else stays the same for them. Logging categories have been a source of some frustration in Qt itself because they tend to create symbols that don't s

[Development] Architecture of Android/Java bindings for QML and QtQuick

2024-05-30 Thread Ulf Hermann via Development
Hi, As noted before, we need to have a discussion on the new Android/Java bindings and how they fit in with the QML language and various Qt modules. See for example https://codereview.qt-project.org/c/qt/qtdeclarative/+/563564 and various follow-up changes. I suggest we call the Android/Jav

Re: [Development] Feature freeze exception: QtAbstractItemModel, QtModelIndex and QtAbstactListModel

2024-05-30 Thread Ulf Hermann via Development
Hi, First, I don't think you need a feature freeze exception to write tests, examples and documentation. Those are not new features, after all. Second, while I certainly welcome this initiative to produce Android/Java bindings for QtQuick, we need to have some discussion about the overall ar

Re: [Development] qmlcachegen and QQC2 styles

2024-05-13 Thread Ulf Hermann via Development
Hi, Generally, if I read that correctly, a user would rarely need both of your styles. They either have a Desktop type device or a Mobile type device and running the other style makes little sense. Therefore, in your case, I would propose to compile two variants of all your libraries: one th

Re: [Development] Nominating Lucie Gerard for approver rights

2024-04-24 Thread Ulf Hermann via Development
I'd like to nominate Lucie Gerard as an approver for the Qt project. +1, how was she not an approver, yet?! -- Development mailing list Development@qt-project.org https://lists.qt-project.org/listinfo/development

Re: [Development] On Removing Public Undocumented/\internal APIs

2024-03-04 Thread Ulf Hermann via Development
Hi, there is another category of such API: API for use by generated code only, such as qqmlprivate.h. This is intentionally undocumented, intentionally called by generated user code, and the run time guards around the generated code make sure it's not called if the run time Qt version does no

[Development] Proposing QUIP 22: Define Rules for Q_PROPERTYs in Qt

2024-02-14 Thread Ulf Hermann via Development
Hi, we cannot retroactively make properties FINAL as that can be source incompatible in QML. However, FINAL properties result in a significant performance boost for QML. qmlcachegen, if it can prove that a property you use in your code is actually the property it expects, does not have to wra

Re: [Development] Documentation and Q_GADGET / Q_PROPERTY

2024-01-15 Thread Ulf Hermann via Development
The one thing where you need NOTIFY or BINDABLE is if you want to expose a class as a type to QML AND you want to make its instances usable in bindings; I believe that's where the warning originates from. However, that's not your use-case, so it shouldn't matter. Value types do not need signa

Re: [Development] Multiple QML engines with different import paths, file selectors, etc

2024-01-09 Thread Ulf Hermann via Development
Hi, have you considered how you can keep compatibility, by making this change either opt-in or opt-out? Since it seems the refactoring is already done, it feels like you are making a bet that only has a negative outcome for those porting/trying to keep up. 😊 Good for maintenance, bad for users?

Re: [Development] Multiple QML engines with different import paths, file selectors, etc

2024-01-09 Thread Ulf Hermann via Development
So, to clarify this some more ... If: 1. you use _multiple_ QML engines in the same process at the same time, 2. you have _different_ import paths, plugin paths, URL interceptors or network access managers for those engines, 3. you rely on those engines to produce _different results_ for the _

Re: [Development] Multiple QML engines with different import paths, file selectors, etc

2024-01-08 Thread Ulf Hermann via Development
Hi, have you considered how you can keep compatibility, by making this change either opt-in or opt-out? Since it seems the refactoring is already done, it feels like you are making a bet that only has a negative outcome for those porting/trying to keep up. 😊 Good for maintenance, bad for users?

[Development] Multiple QML engines with different import paths, file selectors, etc

2024-01-08 Thread Ulf Hermann via Development
Hi, I'm currently refactoring our QML compilation units to avoid storing engine-specific data in the global type registry since that is dangerous and bug-prone. See e.g. QTBUG-120189. This effectively means that you will be able to re-use compilation units between different QML engines. On t

Re: [Development] Nominating Semih Yavuz as an approver for the Qt project

2023-12-07 Thread Ulf Hermann via Development
+1 Disclosure: Semih is working in my team and we share the same office. Same for me best regards, Ulf -- Development mailing list Development@qt-project.org https://lists.qt-project.org/listinfo/development

Re: [Development] std::optional for Q_PROPERTY

2023-11-27 Thread Ulf Hermann via Development
How about conversion: QVariant(std::optional>).value(); // return U{} if T cannot be converted; otherwise U(T); QVariant().value>(); // nullopt, not a std::optional holding a T{} QVariant(42).value>(); // std::optional holding 42 QVariant(QSize()).value>(); // probably null

Re: [Development] Nominating QtGRPC & Qt Protobuf maintainers

2023-11-08 Thread Ulf Hermann via Development
I'd like to nominate Tatiana Borisova as maintainer for Qt Protobuf and Alexey Edelev as maintainer for Qt GRPC. In fact, both have been working on this code base even before they officially became part of Qt. I am glad they agreed to continue this work going forward in the context of Qt Developme

Re: [Development] Using qml.exe with a custom QML_ELEMENT plugin

2023-10-26 Thread Ulf Hermann via Development
I can confirm a simple:     for (const QString &importPath : parser.values(importOption)){     QByteArray path = qgetenv("PATH");     QByteArray newPath = importPath.toLocal8Bit() + ";";     newPath += path;     qputenv("PATH", newPath);     qDebug() << "Modified PATH:"

Re: [Development] Using qml.exe with a custom QML_ELEMENT plugin

2023-10-25 Thread Ulf Hermann via Development
Adding a command line option to add dll search paths via _wpuntenv_s(L"PATH", ...) or SetDLLDirectory(L"...") into qml.exe would also work, right? I didn't know this exists. You'd have to add a lot of directories, though, since it doesn't want to see the QML import path but the paths to the i

Re: [Development] Using qml.exe with a custom QML_ELEMENT plugin

2023-10-25 Thread Ulf Hermann via Development
According to dependency scanner it depends on Qt6Qml.dll, Qt6Core.dll and World.dll. All of these should be either be available from Qt or from the additional import path I provided. Even when copying the dlls into the directory, I get the same error. This is not about the import path but abou

Re: [Development] Using qml.exe with a custom QML_ELEMENT plugin

2023-10-25 Thread Ulf Hermann via Development
PS C:\Qt\6.7.0\msvc2019_64\bin> /.\qml.exe -I "C:\Code\Cpp\build-qml-plugin-minimal-Desktop_Qt_6_7_0_MSVC2019_64bit-Release" -f "C:\Code\Cpp\qml-plugin-minimal\Main.qml" QQmlApplicationEngine failed to load component file:///C:/Code/Cpp/qml-plugin-minimal/Main.qml:5:1: Die Bibliothek C:\Code\Cpp

Re: [Development] Proposal: (re)move qt5.git/_clang-format

2023-09-12 Thread Ulf Hermann via Development
There _is_ consensus. It's in the wiki. And in older modules not infected by the _clang-format file. Discussions arise because of .clang-format, not despite it. Afaict, there never was a discussion about how faithful the _clang-format represents the Qt style before it was added. If there was _any_

Re: [Development] QtFluentMQ

2023-08-28 Thread Ulf Hermann via Development
+1, as indicated before -- Development mailing list Development@qt-project.org https://lists.qt-project.org/listinfo/development

Re: [Development] CI failing due to ASan tst_selftest

2023-08-27 Thread Ulf Hermann via Development
==19383==ERROR: LeakSanitizer: detected memory leaks Direct leak of 48 byte(s) in 2 object(s) allocated from: #0 0x7f26aec7ae48 in __interceptor_malloc (/usr/lib64/libasan.so. 5+0x109e48) #1 0x7f26a8bcbc50 (/usr/lib64/libfontconfig.so.1+0xbc50) #2 0x3d4c4c415f434bff

Re: [Development] QtFluentMQ

2023-08-26 Thread Ulf Hermann via Development
Hi, The usual way to request a repository, playground or not, is a mail like this: https://lists.qt-project.org/pipermail/development/2022-August/042900.html If the request is not totally outlandish it's usually granted, possibly after some bike shedding over the name and location. AFAIR w

Re: [Development] Nominating Tatiana Borisova as approver

2023-05-23 Thread Ulf Hermann via Development
+1 She has helped me more than once with obscure INTEGRITY-related problems. Ulf -- Development mailing list Development@qt-project.org https://lists.qt-project.org/listinfo/development

Re: [Development] Nominating Edward Welbourne as QLocale / date/time maintainer

2023-05-04 Thread Ulf Hermann via Development
+1 He's doing a great job. -- Development mailing list Development@qt-project.org https://lists.qt-project.org/listinfo/development

Re: [Development] Is it a known bug in Qt5: https://bugreports.qt.io/browse/QTBUG-111754 ?

2023-03-06 Thread Ulf Hermann via Development
    The bug is not reproduce in Qt 6.4.2, but I can't found a exists issue in bugreports.qt.io. Maybe my Qt 5 is not latest version? It's Qt 5.15.8, Is this bug fixed in the private Qt code? https://bugreports.qt.io/browse/QTBUG-97427 is what you're looking for. I've linked it in QTBUG-111754

Re: [Development] Support for *Notes and UpstreamFiles fields in qt_attributions.json files

2023-02-15 Thread Ulf Hermann via Development
QML supports comments, but not multi-line string literals. You can concatenate them, though. Sure it does. You can use ECMAScript template strings: property string longthing: `a multi line string` (In fact you can also just sprinkle line breaks into your regular st

Re: [Development] Support for *Notes and UpstreamFiles fields in qt_attributions.json files

2023-02-15 Thread Ulf Hermann via Development
Or QML, in fact: // Attribution.qml in QtAttribution module: QtObject { property string name property list files property list upstreamFiles // } // Actual attribution.qml in source tree: import QtAttribution Attribution { // allows comments as much as you like nam

Re: [Development] Support for *Notes and UpstreamFiles fields in qt_attributions.json files

2023-02-14 Thread Ulf Hermann via Development
YAML is really quite terrible. If we're going to switch, let's choose something else. Basically, YAML is extremely complex, ambiguous, and incompatible between different versions. See for example https://ruudvanasseldonk.com/2023/01/11/the-yaml-document-from-hell for an in-depth explanation.

Re: [Development] How to fix TableView's API break?

2022-12-18 Thread Ulf Hermann via Development
So, how to fix the above? One could easily fix the API break, but one is left with broken APIs all over the place. There's no straightforward deprecation mechanism for QML either, and we've dropped versioned includes. We haven't actually dropped versioned imports. An unversioned import just al

Re: [Development] How qAsConst and qExchange lead to qNN

2022-11-16 Thread Ulf Hermann via Development
The above isn't thread-safe, it isn't even re-entrant, in the same way that iteration using iterators isn't. This is a known issue whenever you hand out references, and it's nothing that violates our const-is-thread-safe promise, otherwise ... which is why we prefer to hand out (implicitly share

Re: [Development] How qAsConst and qExchange lead to qNN

2022-11-16 Thread Ulf Hermann via Development
That's a deep copy. A deep copy of a string is obviously more expensive than the overhead of calling the QString ctor and dtor. That remains to be proven. A rule of thumb for atomics is that they're two orders of magnitude slower than a normal int. They also still act as optimizer firewalls. Wit

Re: [Development] How qAsConst and qExchange lead to qNN

2022-11-14 Thread Ulf Hermann via Development
So, if the method immediately converts whatever it gets to QList or QString, then there is no point in passing it a span or view. My point is that there _is_. Citing my blog post: callConsumeQStringHelloWorld(): > [...] That's the worst case scenario of passing an 8bit string literal to a

Re: [Development] How qAsConst and qExchange lead to qNN

2022-11-14 Thread Ulf Hermann via Development
Hi Marc, On 11.11.22 09:35, Ulf Hermann via Development wrote: There is an undeniable benefit of _offering_ QSpan, QStringView, and generator APIs in a few relevant cases: 1. Users want to pass a "foreign" container to a Qt function that doesn't only store it as QList or QS

Re: [Development] How qAsConst and qExchange lead to qNN

2022-11-11 Thread Ulf Hermann via Development
There is an undeniable benefit of _offering_ QSpan, QStringView, and generator APIs in a few relevant cases: 1. Users want to pass a "foreign" container to a Qt function that doesn't only store it as QList or QString. It might merely iterate it or store it as something else. 2. Assume a cont

Re: [Development] How qAsConst and qExchange lead to qNN

2022-11-09 Thread Ulf Hermann via Development
Hi, let me mention that I've been pondering all that hairy stuff just recently when trying to come up with a solution for how to map QList*> and QQmlListProperty to each other without exposing people to dangling references and without copying and allocating all the time. One thing we could do

Re: [Development] How qAsConst and qExchange lead to qNN

2022-11-08 Thread Ulf Hermann via Development
I don't want to take the Qt containers away from Qt users. I want to get rid of their use in our APIs, so that both the Qt implementation as well as our users are free to choose the best container for their needs instead of having to pick from one of the public Qt containers. I would like to kno

Re: [Development] Using '#pragma once' instead of include guards?

2022-11-04 Thread Ulf Hermann via Development
Once we had QString and QByteArray (and the admittedly ill-conceived QStringRef). Now we have QStringView, QAnyStringView, QByteArrayView, ... and when asking what the prefered getter/setter-signature for "Qt-style" interfaces is the answer I get is "We'd guess $X, but the only guy that knows for

Re: [Development] C++20 comparisons @ Qt (was: Re: C++20 @ Qt)

2022-11-04 Thread Ulf Hermann via Development
Hi, One thing I haven't understood about the ordering problem is why we cannot just define our "invalid" values to always be < any valid one and equal to other invalid ones. This way we get at least weak ordering for all our types and we're done. There may be types where existing operator< w

Re: [Development] Nominating Sami Shalayel as approver

2022-11-04 Thread Ulf Hermann via Development
+1 Unsurprisingly, I'm part of the same team as Sami ___ Development mailing list Development@qt-project.org https://lists.qt-project.org/listinfo/development

Re: [Development] Remaining tools in CMAKE_INSTALL_BINDIR

2022-10-10 Thread Ulf Hermann via Development
My question was for the developer's own plugins. Are these tools meant for the developer to test their QML importing their plugins? It might be surprising that it cannot find the plugins they've just installed to QML_PLUGIN_PATH, or worse, finds an older version of them. Indeed if you actually h

Re: [Development] Remaining tools in CMAKE_INSTALL_BINDIR

2022-10-07 Thread Ulf Hermann via Development
I would consider qml, qmlscene, qmlpreview, qmlprofiler, and qmltime to be equivalent to their Qt 5 versions, and indeed user-facing. And would replacing the Qt 5 versions with Qt 6 be an imperceptible change to the user? What happens if their own QML content has plugins? I assume Qt itself ship

Re: [Development] Remaining tools in CMAKE_INSTALL_BINDIR

2022-10-07 Thread Ulf Hermann via Development
I would consider qml, qmlscene, qmlpreview, qmlprofiler, and qmltime to be equivalent to their Qt 5 versions, and indeed user-facing. Well, qml and qmlscene are only equivalent to Qt5 insofar as we consider the QML language and our QML modules in Qt6 to be equivalent to the ones in Qt5. There

Re: [Development] Remaining tools in CMAKE_INSTALL_BINDIR

2022-10-07 Thread Ulf Hermann via Development
Hi, I would consider qml, qmlscene, qmlpreview, qmlprofiler, and qmltime to be equivalent to their Qt 5 versions, and indeed user-facing. qmltc is not user-facing. It's a compiler and should live in the same place as qmlcachegen. qmljs is a general-purpose JavaScript interpreter. So, it's k