showing items after 10 or so items in the model data
This commit is contained in:
@@ -4,12 +4,14 @@
|
||||
#include <QtQuick/qquickitem.h>
|
||||
#include <QtQuick/qquickview.h>
|
||||
#include <NetworkScanner.h>
|
||||
#include <QQmlContext>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QGuiApplication app(argc, argv);
|
||||
|
||||
NetworksModel model;
|
||||
model.scan();
|
||||
qDebug() << "now has " << model.rowCount() << Qt::endl;
|
||||
|
||||
QQmlApplicationEngine engine;
|
||||
@@ -20,9 +22,9 @@ int main(int argc, char *argv[])
|
||||
&app,
|
||||
[]() { QCoreApplication::exit(-1); },
|
||||
Qt::QueuedConnection);
|
||||
engine.rootContext()->setContextProperty("networksModel", &model);
|
||||
engine.load(url);
|
||||
|
||||
|
||||
QObject *rootObject = engine.rootObjects().first();
|
||||
if (!rootObject)
|
||||
{
|
||||
@@ -30,11 +32,7 @@ int main(int argc, char *argv[])
|
||||
return -1;
|
||||
}
|
||||
|
||||
engine.setInitialProperties({{"model", QVariant::fromValue(&model)}});
|
||||
rootObject->setProperty("model", QVariant::fromValue(&model));
|
||||
|
||||
QObject::connect(rootObject, SIGNAL(scanNetworks()), &model, SLOT(scan()));
|
||||
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user