QT Quick Start (i)
To create a project step:
FILE-new file or project-application-QT GUI application-fill in the name and click Next-Next-to remove the tick in front of the creation community by pressing the next step-complete
Example one: Create Hello label
#include <QApplication>
#include <QLabel>
int main (int argc, char *argv[])
{
Qapplication A (argc, argv);
Qlabel *label = new Qlabel ("Hello");//support HTML Rich Text
label->show ();
return a.exec ();
}
Click on the lower left corner of the Run button, the build is completed will see:
Example two: Create a quit button
#include <QApplication>
#include <QPushButton>
int main (int argc, char *argv[])
{
Qapplication A (argc, argv);
Qpushbutton *button = new Qpushbutton ("Quit");
Qobject::connect (Button,signal (clicked ()),//Establish connection event
&a,slot (Quit ()));
Button->show ();
return a.exec ();
}
will see the following program interface, click Quit program will exit