[Interest] Is there any plan to make property binding working in C++?

Thiago Macieira thiago.macieira at intel.com
Mon May 9 07:41:54 CEST 2016


On domingo, 8 de maio de 2016 22:06:52 PDT Xavier Bigand wrote:
> With QML I learn the property binding paradigm, which is a really big thing
> that can help to solve a lot of complex problems, but I think that it is
> not enough known.
> 
> I really think that it can be used in many places where we didn't suspect,
> with a coworker we have implemented the property binding in the C++ side of
> our application to solve many bugs we have without our previous system
> based on updates and listeners.

> That why I think that it could be interesting for Qt to expose an API of
> property with binding.

We already have one, it's called QObject::connect.

Examples:
	connect(model, &QItemSelectionModel::currentChanged,
		otherModel, &QItemSelectionModel::setCurrentIndex);
	connect(screen, &QScreen::geometryChanged, widget, &QWidget::resize);
	connect(window, &QWindow::visibleChanged,
		otherwindow, [=](bool arg) { otherWindow->setVisible(!arg); });

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Interest mailing list