Microsoft is accessing the field of WPF platform independence with Xamarin Forms. However, there has for a long time been an existing framework that runs on Windows, MacOS, Linux and starting with version 5 on iOS, Android, Sailfish OS and other operating systems – without re-implementation: Qt.
int main(int argc, char *argv)
QApplication app(argc, argv);
QQmlContext* context = engine.rootContext();
QString currPath = QDir::currentPath();
QScreen *screen = QApplication::screens().at(0);
int width = screen->availableSize().width();
int height = screen->availableSize().height();
MainController* mainController = new MainController();
LISTING 1: MAIN.CPP
Qt has been around since 1992. For a long time, the company Trolltech distributed the framework commercially. There was a free version for the Linux desktop KDE that later was licensed under GPL. The two versions differed in the availability of certain modules. Starting with version 4.5 in 2009, the LGPL (GNU Lesser General Public License) was added. The current version 5.x is available in commercial and free versions as well. The rights are currently owned by The Qt Company.
Qt development was distinguished by the signal/slot principle. While other frameworks still used events, this already was an implementation of the publish-subscribe pattern. A button provides the clicked() signal, which view components can bind to a slot onClicked().