Just contact QT and Qt Quick, meet some small ideas, small traps to share and learn with you. CSDN has qt great god An Xiaohui, I also dare not swim, just with everybody progress together, share.
what is QT quick
Qt Quick is a collection of technologies designed to help developers design an intuitive, modern, and fluid user interface that has been used in mobile phones, media players, set-top boxes and other portable devices in recent years. QT Quick contains a number of user interface elements, as well as a declarative (declarative) language describing these user interfaces, and a language runtime. In a typical QT application, there is a series of C + + APIs that integrate with these high-level features. Integrated development environment for QT Creator2.1 (IDE) contains the tools necessary to develop a QT quick application.
qdebug Output Formatting
You can output debug information:
#include <QDebug>#include <QString>int main(){ "Hello"; int1234; "foo=""x=" << x; "foo="" x=" << x;}
c++11 Support
C++11 can be supported and added in the. Pro file:
CONFIG += c++11
The same approach can support c++14, but it is important to note whether your compiler supports C++14.
Turning Compile Warnings into Errors
Google code style tells us to treat warnings as error handling, QT can convert compile warnings to errors, but also need to include some definitions in the. Pro file, note that for different compilers, the definitions added to the. Pro are different:
g++:
QMAKE_CXXFLAGS += -Werror
Msvc
QMAKE_CXXFLAGS += /WX
Making run-time Warnings Fatal
If you do not want to ignore the warning during run time, you can qt_fatal_warningsan environment variable.
Once defined, if the program encounters a warning, it will abort.
Spying on signals
Signal Spy, which is very useful for us to test:
The Qsignalspy class allows you to connect to any signal from any Qt object and record when it is emitted.
Finally, about the. Pro file:
Some Tips and Tricks about Qt