Difference between qt qml and qt quick

QML is the name of the language (just like C++, which is another language…) QtQuick is a toolkit for QML, allowing to develop graphical interface in QML language (there are other toolkits for QML, some are graphical like Sailfish Silica or BlackBerry Cascade, and some are non-graphical like QBS which is a replacement for QMake/CMake/make…) … Read more

QtCreator and Command Line Arguments

Go in the “Project” part on the left of QtCreator and then in the “Run Settings” tab. There is a Arguments line edit where you can put all you need to pass to your app when launching it. For Qt Creator from Qt 5.6 Go in the “Projects part on the left and then in … Read more

Passing an argument to a slot

With Qt 5 and a C++11 compiler, the idiomatic way to do such things is to give a functor to connect: connect(action1, &QAction::triggered, this, [this]{ onStepIncreased(1); }); connect(action5, &QAction::triggered, this, [this]{ onStepIncreased(5); }); connect(action10, &QAction::triggered, this, [this]{ onStepIncreased(10); }); connect(action25, &QAction::triggered, this, [this]{ onStepIncreased(25); }); connect(action50, &QAction::triggered, this, [this]{ onStepIncreased(50); }); The third argument to … Read more

Qt. get part of QString

If you do not need to modify the substring, then you can use QStringRef. The QStringRef class is a read only wrapper around an existing QString that references a substring within the existing string. This gives much better performance than creating a new QString object to contain the sub-string. E.g. QString myString(“This is a string”); … Read more

Qt: *.pro vs *.pri

There is one main difference between their targetted reuse: .pro This is usually called Project File. .pri This is usually called Project Include File. As you can see in their names, the main difference is that .pri files are meant to be include files. That is similar to including modules in programming language to share … Read more