On Friday, 7 March 2025 03:51:23 Pacific Standard Time Volker Hilsheimer via
Development wrote:
> class Object : public QObject
> {
> Q_OBJECT
> Q_PROPERTY(value)
It would be easier to keep the current syntax with READ, WRITE, NOTIFY and
then add an extra boolean field that tells moc to
On 3/7/25 12:48, Schimkowitsch Robert wrote:
There is "Q_PROPERTY(qreal x MEMBER m_x NOTIFY xChanged)" for the
really simple cases.
With that you don't need to write any accessors at all. Not even the bindable
accessor.
That neither does the change comparison, nor will it automatically notify
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
>
> Removing boilerplate from a C++ class that declares properties could be done
> with the help of moc, without creating bindables. I.e. a simplified
> Q_PROPERTY declaration that assumes some convention for
> getter/setter/notify-signal could be enough:
>
> class Object : public QObject
> {
>
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
> On 7 Mar 2025, at 12:27, Ulf Hermann via Development
> wrote:
>
> 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 hav
> There is "Q_PROPERTY(qreal x MEMBER m_x NOTIFY xChanged)" for the
> really simple cases.
>
> With that you don't need to write any accessors at all. Not even the bindable
> accessor.
>
That neither does the change comparison, nor will it automatically notify about
changes.
You'd have to code bo
Hi,
I can only summarize your message in four letters: ARGH!
We widely use BINDABLE in Q_PROPERTY (>500 places) because it removes a lot of
boilerplate from our C++ classes.
Compare code with BINDABLE:
// ***
Q_PROPERTY(qreal x BINDABLE getX READ default)
QBindable getX() const
{
return m_X
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