mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
Fixed samples:
* use QGuiApplication in main so GUI metadata are available * parent for thread sample, otherwise ASSERT Remark: some issue are Qt 5.4 update related
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QGuiApplication>
|
||||
#include "sampleschangeobject.h"
|
||||
#include "samplesmetadata.h"
|
||||
#include "samplescontainer.h"
|
||||
@@ -21,12 +21,12 @@
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMiscTest;
|
||||
|
||||
/*!
|
||||
* Sample tests
|
||||
*/
|
||||
//! Sample tests
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QCoreApplication a(argc, argv);;
|
||||
// I use QGuiApplication and not core application
|
||||
// otherwise no QPixmap metadata (metadata sample)
|
||||
QGuiApplication a(argc, argv);
|
||||
Q_UNUSED(a);
|
||||
|
||||
QTextStream qtout(stdout);
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "samplesconcurrent.h"
|
||||
#include "blackmisc/algorithm.h"
|
||||
#include <QDebug>
|
||||
#include <QCoreApplication>
|
||||
#include <QGuiApplication>
|
||||
#include <QtConcurrent/QtConcurrent>
|
||||
#include <QString>
|
||||
|
||||
@@ -25,11 +25,11 @@ namespace BlackMiscTest
|
||||
Q_UNUSED(type);
|
||||
|
||||
out << "Main thread id: " << QThread::currentThreadId() << endl;
|
||||
CThreadOutput b1("b1");
|
||||
CThreadOutput b1("b1", QGuiApplication::instance());
|
||||
b1.start();
|
||||
CThreadOutput b2("b2");
|
||||
CThreadOutput b2("b2", QGuiApplication::instance());
|
||||
b2.start();
|
||||
CThreadOutput b3("b3");
|
||||
CThreadOutput b3("b3", QGuiApplication::instance());
|
||||
b3.start();
|
||||
QThread::msleep(10 * 1000);
|
||||
b1.stop();
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#include "blackmisc/blackmiscfreefunctions.h"
|
||||
#include "blackmisc/aviation/atcstationlist.h"
|
||||
#include <QDebug>
|
||||
#include <QGuiApplication>
|
||||
#include <QMetaType>
|
||||
|
||||
using namespace BlackMisc::Aviation;
|
||||
@@ -21,17 +20,10 @@ using namespace BlackMisc::Network;
|
||||
|
||||
namespace BlackMiscTest
|
||||
{
|
||||
|
||||
/*
|
||||
* Samples
|
||||
*/
|
||||
int CSamplesMetadata::samples()
|
||||
{
|
||||
int argv = 0;
|
||||
QTextStream cin(stdin);
|
||||
QTextStream cout(stdout);
|
||||
QGuiApplication dummy(argv, nullptr); // otherwise no QPixmap metadata
|
||||
Q_UNUSED(dummy);
|
||||
BlackMisc::registerMetadata();
|
||||
BlackMisc::displayAllUserMetatypesTypes(cout);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user