Avoid complaining from strlen

`
This commit is contained in:
Vítor Santos Costa
2015-09-21 17:05:36 -05:00
parent 880a9989c3
commit 4336b2ba88
469 changed files with 207364 additions and 9193 deletions

37
console/Qt/qtyap.cpp Normal file
View File

@@ -0,0 +1,37 @@
// main.cpp
#include <QtCore>
class Task : public QObject
{
Q_OBJECT
public:
Task(QObject *parent = 0) : QObject(parent) {}
public slots:
void run()
{
// Do processing here
emit finished();
}
signals:
void finished();
};
#include "main.moc"
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
// Task parented to the application so that it
// will be deleted by the application.
Task *task = new Task(&a);
// This will cause the application to exit when
// the task signals finished.
QObject::connect(task, SIGNAL(finished()), &a, SLOT(quit()));
// This will run the task from the application event loop.
QTimer::singleShot(0, task, SLOT(run()));