[Development] QProperty and library coding guide

Thiago Macieira thiago.macieira at intel.com
Thu Jul 16 18:45:23 CEST 2020


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 differently named but identical struct for each property.
>
> The struct has no data itself, so ideally would be of size zero.

That didn't answer how they can share an address. Suppose I have two 
properties of type QString called "text" and "title".

  action->text = "foo";
  action->title = "bar";

Since std::is_same_v<decltype(action->text), decltype(action->title)> and 
&action->text == &action->title, how does the code above even work?

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel System Software Products





More information about the Development mailing list