-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfunc_map.cpp
More file actions
45 lines (37 loc) · 1.5 KB
/
func_map.cpp
File metadata and controls
45 lines (37 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include "func_map.h"
#include "ui_func_map.h"
#include <QDir>
#include <QtDebug>
#include <QSslSocket>
#include <QQuickItem>
func_map::func_map(QWidget *parent) :
QWidget(parent),
ui(new Ui::func_map)
{
ui->setupUi(this);
// ui->quickWidget_mainMap->setResizeMode(QQuickWidget::SizeRootObjectToView);
// ui->quickWidget_mainMap->setAttribute(Qt::WA_AlwaysStackOnTop);
// ui->quickWidget_mainMap->setClearColor(Qt::transparent);
QQuickItem *mapItem = ui->quickWidget_mainMap->rootObject();
connect(ui->comboBox_mapTypeSelection, QOverload<int>::of(&QComboBox::currentIndexChanged), [mapItem](int indexSelected) {
QObject *mapObject = mapItem->findChild<QQuickItem*>("mapObject");
if (mapObject) {
QVariant returnedValue;
QMetaObject::invokeMethod(mapObject, "getMapType",
Q_RETURN_ARG(QVariant, returnedValue),
Q_ARG(QVariant, indexSelected));
qDebug() << indexSelected;
qDebug() << returnedValue;
qDebug() << mapObject->property("activeMapType");
mapObject->setProperty("activeMapType", returnedValue);
}
});
connect(ui->pushButton_refreshMapData, &QPushButton::clicked, [mapItem]() {
QObject *mapObject = mapItem->findChild<QQuickItem*>("mapObject");
QMetaObject::invokeMethod(mapObject, "refreshMap");
});
}
func_map::~func_map()
{
delete ui;
}