完善状态
This commit is contained in:
@@ -38,7 +38,14 @@ namespace mapcontrol {
|
||||
OPMapWidget::OPMapWidget(QWidget *parent, Configuration *config) : QGraphicsView(parent), configuration(config), UAV(0), GPS(0), Home(0)
|
||||
, followmouse(true), compass(0), showuav(false), showhome(false), diagTimer(0), diagGraphItem(0), showDiag(false), overlayOpacity(1),isWPCreate(false)
|
||||
{
|
||||
QTextCodec::setCodecForLocale(QTextCodec::codecForName( "utf8" ));
|
||||
//QTextCodec::setCodecForLocale(QTextCodec::codecForName("GB2312"));
|
||||
QTextCodec::setCodecForLocale(QTextCodec::codecForName("utf8"));
|
||||
|
||||
/*
|
||||
QTranslator * translator = NULL;
|
||||
translator->load(QCoreApplication::applicationDirPath() + "\\MAP_zh_CN.qm");
|
||||
QCoreApplication::installTranslator(translator);
|
||||
*/
|
||||
|
||||
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
|
||||
core = new internals::Core;
|
||||
@@ -54,7 +61,6 @@ OPMapWidget::OPMapWidget(QWidget *parent, Configuration *config) : QGraphicsView
|
||||
|
||||
mscene.addItem(map);//添加图层
|
||||
|
||||
|
||||
this->setScene(&mscene);
|
||||
Home = new HomeItem(map, this);
|
||||
Home->setParentItem(map);
|
||||
@@ -151,8 +157,23 @@ void OPMapWidget::addUAV(int sysid,int compid)
|
||||
|
||||
uavItem->setOpacity(overlayOpacity);
|
||||
|
||||
uavItem->setSelect(false);
|
||||
//检测,如果只有一个飞机,那么就选中
|
||||
uint32_t uavCount = 0;
|
||||
foreach(QGraphicsItem * i, map->childItems()) {
|
||||
UAVItem *u = qgraphicsitem_cast<UAVItem *>(i);
|
||||
if (u) {
|
||||
uavCount ++;
|
||||
}
|
||||
}
|
||||
|
||||
if(uavCount <= 1)
|
||||
{
|
||||
uavItem->setSelect(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
uavItem->setSelect(false);
|
||||
}
|
||||
}
|
||||
|
||||
void OPMapWidget::NOPTimeout()
|
||||
|
||||
Reference in New Issue
Block a user