Re: [Development] QProperty and library coding guide

2020-07-16 Thread Thiago Macieira
On Thursday, 16 July 2020 13:16:41 PDT Giuseppe D'Angelo via Development wrote: > Il 16/07/20 12:43, Volker Hilsheimer ha scritto: > > For pre-C++20 (where it’s possible to have zero-size structs), and for > > compilers that don’t respect the [[no_unqiue_address]] attribute, all > > these

Re: [Development] QProperty and library coding guide

2020-07-16 Thread Thiago Macieira
On Thursday, 16 July 2020 12:02:39 PDT Volker Hilsheimer wrote: > > In other words, action->text and action->title aren't the same type. > > Correct, I see that my earlier statement that “each property is represented > by an instance of a struct” was misleading. Yup. Thanks for the

Re: [Development] QProperty and library coding guide

2020-07-16 Thread Giuseppe D'Angelo via Development
Il 16/07/20 12:43, Volker Hilsheimer ha scritto: For pre-C++20 (where it’s possible to have zero-size structs), and for compilers that don’t respect the [[no_unqiue_address]] attribute, all these struct-instances are put into a union. In that case, a class using QProperty will be larger (by

Re: [Development] QProperty and library coding guide

2020-07-16 Thread Volker Hilsheimer
> On 16 Jul 2020, at 19:54, Thiago Macieira wrote: > > On Thursday, 16 July 2020 10:36:27 PDT Volker Hilsheimer wrote: >>> Since std::is_same_vtext), decltype(action->title)> and >>> >text == >title, how does the code above even work? >> >> action->text.structMemberFunction(); >> >> calls

Re: [Development] QProperty and library coding guide

2020-07-16 Thread Thiago Macieira
On Thursday, 16 July 2020 10:36:27 PDT Volker Hilsheimer wrote: > > Since std::is_same_vtext), decltype(action->title)> and > > >text == >title, how does the code above even work? > > action->text.structMemberFunction(); > > calls QAction::_qt_property_api_text::structMemberFunction, which is >

Re: [Development] QProperty and library coding guide

2020-07-16 Thread Volker Hilsheimer
> On 16 Jul 2020, at 18:45, Thiago Macieira wrote: > > On Thursday, 16 July 2020 08:40:35 PDT Volker Hilsheimer wrote: >> action->text = document->title; // still no binding >> action->text = Qt::makePropertyBinding(document->title); // yay binding! >> >> >> These struct-methods are either

Re: [Development] QProperty and library coding guide

2020-07-16 Thread Thiago Macieira
On Thursday, 16 July 2020 08:40:35 PDT Volker Hilsheimer wrote: > action->text = document->title; // still no binding > action->text = Qt::makePropertyBinding(document->title); // yay binding! > > > These struct-methods are either inline forwards, or implemented by moc, and > we need a

Re: [Development] QProperty and library coding guide

2020-07-16 Thread André Pönitz
On Thu, Jul 16, 2020 at 11:08:40AM +, Edward Welbourne wrote: > Giuseppe D'Angelo (16 July 2020 12:58) requested: > > Could anyone please illustrate with some code snippets how to achieve > > this, in practice, in a number of use cases? E.g. client code (non > > pimpled QObject subclass), (Qt)

Re: [Development] QProperty and library coding guide

2020-07-16 Thread Volker Hilsheimer
> On 16 Jul 2020, at 14:03, Stottlemyer, Brett (B.S.) wrote: > > Hi Ulf, > > > QProperty is the way to enable QML-style bindings in C++. It gives you a > > powerful way of expressing relations between properties in a succinct > > way. You can assign a binding functor directly to a QProperty.

Re: [Development] QProperty and library coding guide

2020-07-16 Thread Volker Hilsheimer
> On 16 Jul 2020, at 17:19, Thiago Macieira wrote: > > On Thursday, 16 July 2020 03:43:58 PDT Volker Hilsheimer wrote: >> The various macros involved provide this. Each property is represented by an >> instance of a struct with no data members, but just methods that forward >> calls to the

Re: [Development] QProperty and library coding guide

2020-07-16 Thread Thiago Macieira
On Thursday, 16 July 2020 03:43:58 PDT Volker Hilsheimer wrote: > The various macros involved provide this. Each property is represented by an > instance of a struct with no data members, but just methods that forward > calls to the accessor, which in Qt is typically the d-pointer (where the >

Re: [Development] QProperty and library coding guide

2020-07-16 Thread Thiago Macieira
On Thursday, 16 July 2020 04:04:58 PDT Volker Hilsheimer wrote: > But we don’t have to be "all or nothing” on any class; old and new > properties can be mixed. Some of the more complicated properties won’t fit > into the QProperty design, and they can stay as they are, just not > supporting

Re: [Development] QProperty and library coding guide

2020-07-16 Thread Thiago Macieira
On Thursday, 16 July 2020 03:32:08 PDT Edward Welbourne wrote: > And, as you already know, documentation of the new system is urgently > needed ! I know your hands are full with *writing the code*, but even > adding sketchy outline / overview docs for everything you write, as you > do so, is

Re: [Development] QProperty and library coding guide

2020-07-16 Thread Thiago Macieira
On Wednesday, 15 July 2020 23:53:01 PDT Friedemann Kleint wrote: > Hi, > > > 3) how QProperty is source-compatible with Qt 5 user code. > > Specifically, it needs to be transparently visible in QMetaObject like > old-style properties and setting/retrieving properties via name and > QVariant

Re: [Development] QProperty and library coding guide

2020-07-16 Thread Filippo Cucchetto
Il giorno gio 16 lug 2020 alle ore 11:21 Ulf Hermann ha scritto: > > You may have noticed the "eventually" above. If you connect a signal to > a slot, the evaluation mechanism is "eager": When the signal arrives, > the slot is executed. You may delay the signal a bit by queuing it, or > you may

Re: [Development] QProperty and library coding guide

2020-07-16 Thread Stottlemyer, Brett (B.S.)
Hi Ulf, > QProperty is the way to enable QML-style bindings in C++. It gives you a > powerful way of expressing relations between properties in a succinct > way. You can assign a binding functor directly to a QProperty. Any > QProperties the functor accesses are automatically recorded. Whenever >

Re: [Development] QProperty and library coding guide

2020-07-16 Thread Edward Welbourne
On Thu, 16 Jul 2020 10:32:08 + Edward Welbourne wrote: >>> [...] let me first give an introduction here, and answer some of your >>> question. >> >> I have turned a large chunk of that into >> https://wiki.qt.io/QProcess Christian Kandeler (16 July 2020 13:20) spotted my typo: > Are you

Re: [Development] QProperty and library coding guide

2020-07-16 Thread Christian Kandeler
On Thu, 16 Jul 2020 10:32:08 + Edward Welbourne wrote: > > [...] let me first give an introduction here, and answer some of your > > question. > > I have turned a large chunk of that into > https://wiki.qt.io/QProcess Are you sure about the URL? Christian

Re: [Development] QProperty and library coding guide

2020-07-16 Thread Edward Welbourne
Il 16/07/20 12:43, Volker Hilsheimer ha scritto: >> For pre-C++20 (where it’s possible to have zero-size structs), and >> for compilers that don’t respect the [[no_unqiue_address]] attribute, >> all these struct-instances are put into a union. In that case, a >> class using QProperty will be

Re: [Development] QProperty and library coding guide

2020-07-16 Thread Volker Hilsheimer
> On 16 Jul 2020, at 12:41, Friedemann Kleint wrote: > > Hi, > >> QProperty can be exposed to the meta object system, and behaves just > like a getter/setter/signal property there. > >> Rather, the focus is currently on classes in QtCore, QtNetwork, and > QtGui > > QtGui's QAction is

Re: [Development] QProperty and library coding guide

2020-07-16 Thread Giuseppe D'Angelo via Development
Il 16/07/20 12:43, Volker Hilsheimer ha scritto: For pre-C++20 (where it’s possible to have zero-size structs), and for compilers that don’t respect the [[no_unqiue_address]] attribute, all these struct-instances are put into a union. In that case, a class using QProperty will be larger (by

Re: [Development] QProperty and library coding guide

2020-07-16 Thread Volker Hilsheimer
> On 16 Jul 2020, at 11:19, Ulf Hermann wrote: > >> There's a flurry of changes going in right now about using QProperty in >> QObject-derived classes. But before those begin being approved, I'd like to >> see QProperty added to our library coding guide. > > Do you mean

Re: [Development] QProperty and library coding guide

2020-07-16 Thread Friedemann Kleint
Hi, > QProperty can be exposed to the meta object system, and behaves just like a getter/setter/signal property there. > Rather, the focus is currently on classes in QtCore, QtNetwork, and QtGui QtGui's QAction is relevant for Qt Designer. This would be a test case for the compatibility.

Re: [Development] QProperty and library coding guide

2020-07-16 Thread Edward Welbourne
Thiago asked about QProperty, particularly requesting an update to a wiki page about library coding conventions. Ulf Hermann (16 July 2020 11:19) replied > Do you mean https://wiki.qt.io/Coding_Conventions ? Quite a few wiki pages could do with an update: most obviously:

Re: [Development] QProperty and library coding guide

2020-07-16 Thread Ulf Hermann
There's a flurry of changes going in right now about using QProperty in QObject-derived classes. But before those begin being approved, I'd like to see QProperty added to our library coding guide. Do you mean https://wiki.qt.io/Coding_Conventions ? I can certainly add some paragraphs there.

Re: [Development] QtWayland Compositor and marketplace

2020-07-16 Thread Shawn Rutledge
> On 2020 Jul 6, at 18:57, Pier Luigi Fiorini > wrote: > > Hi, > > I noticed that some modules are going into the marketplace, for example Qt > Multimedia. > Would you consider doing so for QtWayland Compositor? > > The compositor API would surely benefit from a faster release cycle. > >

Re: [Development] QProperty and library coding guide

2020-07-16 Thread Friedemann Kleint
Hi, > 3) how QProperty is source-compatible with Qt 5 user code. Specifically, it needs to be transparently visible in QMetaObject like old-style properties and setting/retrieving properties via name and QVariant needs to work for Qt Designer's property editor. Code generation via uic also