提交 48700fe8 编写于 作者: 丁劲犇's avatar 丁劲犇 😸

Qt6 兼容性修改

1. Qt6.0 尚未支持ActiveX
2. deprecated 选项设置
上级 78cd9bc2
TEMPLATE = subdirs
#if you want to build activec ctrls, please uncomment this line
DEFINES += BUILD_ACTIVEX_OSM
#DEFINES += BUILD_ACTIVEX_OSM
SUBDIRS += \
qtwidget_planetosm \
qtwidget_planetosm_designer \
......
......@@ -30,6 +30,8 @@ osm_frame_widget::osm_frame_widget(QWidget *parent) :
m_mutex_proteced.lock();
QTVOSM_DEBUG("The osm_frame_widget class constructing...");
ui->setupUi(this);
QObject::connect(ui->dial_QTV_zoom, &QDial::valueChanged, ui->lcdNumber_QTV_level,
static_cast<void (QLCDNumber::*)(int)>(&QLCDNumber::display));
m_pLayerDispMod = new QStandardItemModel(this);
m_pLayerDispMod->setColumnCount(3);
m_pLayerDispMod->setHeaderData(0,Qt::Horizontal,QString(tr("name")));
......
......@@ -96,7 +96,7 @@
<number>0</number>
</property>
<item>
<widget class="tilesviewer" name="widget_QTV_mainMap" native="true">
<widget class="QTVOSM::tilesviewer" name="widget_QTV_mainMap" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
......@@ -268,7 +268,7 @@
</layout>
</item>
<item>
<widget class="tilesviewer" name="browserView" native="true">
<widget class="QTVOSM::tilesviewer" name="browserView" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
......@@ -475,7 +475,7 @@
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
<customwidget>
<class>tilesviewer</class>
<class>QTVOSM::tilesviewer</class>
<extends>QWidget</extends>
<header>osmtiles/tilesviewer.h</header>
<container>1</container>
......@@ -485,22 +485,5 @@
<include location="resource/resource.qrc"/>
<include location="resource/resource.qrc"/>
</resources>
<connections>
<connection>
<sender>dial_QTV_zoom</sender>
<signal>valueChanged(int)</signal>
<receiver>lcdNumber_QTV_level</receiver>
<slot>display(int)</slot>
<hints>
<hint type="sourcelabel">
<x>498</x>
<y>72</y>
</hint>
<hint type="destinationlabel">
<x>596</x>
<y>110</y>
</hint>
</hints>
</connection>
</connections>
<connections/>
</ui>
......@@ -2,6 +2,7 @@
#include <QCoreApplication>
#include <QPainter>
#include <QSettings>
#include <QFile>
#include "layer_browser.h"
#include "tilesviewer.h"
namespace QTVOSM
......
......@@ -189,13 +189,14 @@ namespace QTVOSM{
{
if (!m_pViewer || m_bVisible==false || m_bActive==false) return false;
int nLevel = m_pViewer->level();
if (event->delta()<0)
const int ad = event->angleDelta().x() + event->angleDelta().y();
if (ad<0)
{
nLevel++;
if (nLevel>20)
nLevel=20;
}
else if (event->delta()>0)
else if (ad>0)
{
nLevel--;
if (nLevel<0)
......
......@@ -303,7 +303,7 @@ namespace QTVOSM{
map_evt["name"] = "MOUSE_LBUTTON_DOWN";
else if (event->buttons() & Qt::RightButton)
map_evt["name"] = "MOUSE_RBUTTON_DOWN";
else if (event->buttons() & Qt::MidButton)
else if (event->buttons() & Qt::MiddleButton)
map_evt["name"] = "MOUSE_MBUTTON_DOWN";
else
map_evt["name"] = "MOUSE_BUTTON_DOWN";
......@@ -404,7 +404,7 @@ namespace QTVOSM{
map_evt["name"] = "MOUSE_LBUTTON_UP";
else if (event->buttons() & Qt::RightButton)
map_evt["name"] = "MOUSE_RBUTTON_UP";
else if (event->buttons() & Qt::MidButton)
else if (event->buttons() & Qt::MiddleButton)
map_evt["name"] = "MOUSE_MBUTTON_UP";
else
map_evt["name"] = "MOUSE_BUTTON_UP";
......@@ -442,7 +442,7 @@ namespace QTVOSM{
map_evt["name"] = "MOUSE_LBUTTON_DBLCLK";
else if (event->buttons() & Qt::RightButton)
map_evt["name"] = "MOUSE_RBUTTON_DBLCLK";
else if (event->buttons() & Qt::MidButton)
else if (event->buttons() & Qt::MiddleButton)
map_evt["name"] = "MOUSE_MBUTTON_DBLCLK";
else
map_evt["name"] = "MOUSE_BUTTON_DBLCLK";
......@@ -505,7 +505,7 @@ namespace QTVOSM{
map_evt["destin"] = "OUTER";
map_evt["name"] = "MOUSE_WHELL";
double tlat, tlon;
CV_DP2LLA(event->pos().x(),event->pos().y(),&tlat,&tlon);
CV_DP2LLA(event->position().x(),event->position().y(),&tlat,&tlon);
map_evt["lat"] = tlat;
map_evt["lon"] = tlon;
map_evt["nLevel"] = m_nLevel;
......
......@@ -14,7 +14,7 @@ namespace QTVOSM{
QString str_url;
QString str_destinDir;
QString str_destinFile;
bool operator == (const tag_download_tasks & t1)
bool operator == (const tag_download_tasks & t1) const
{
return t1.str_url==str_url && t1.str_destinDir == str_destinDir && t1.str_destinFile == str_destinFile;
}
......
......@@ -116,7 +116,7 @@ namespace QTVP_GEOMARKER{
map_evt["name"] = "ITEM_LBUTTON_CLICKED";
else if (event->buttons() & Qt::RightButton)
map_evt["name"] = "ITEM_RBUTTON_CLICKED";
else if (event->buttons() & Qt::MidButton)
else if (event->buttons() & Qt::MiddleButton)
map_evt["name"] = "ITEM_MBUTTON_CLICKED";
else
map_evt["name"] = "ITEM_BUTTON_CLICKED";
......@@ -201,7 +201,7 @@ namespace QTVP_GEOMARKER{
map_evt["name"] = "ITEM_LBUTTON_DBLCLICKED";
else if (event->buttons() & Qt::RightButton)
map_evt["name"] = "ITEM_RBUTTON_DBLCLICKED";
else if (event->buttons() & Qt::MidButton)
else if (event->buttons() & Qt::MiddleButton)
map_evt["name"] = "ITEM_MBUTTON_DBLCLICKED";
else
map_evt["name"] = "ITEM_BUTTON_DBLCLICKED";
......
......@@ -114,7 +114,7 @@ namespace QTVP_GEOMARKER{
map_evt["name"] = "ITEM_LBUTTON_CLICKED";
else if (event->buttons() & Qt::RightButton)
map_evt["name"] = "ITEM_RBUTTON_CLICKED";
else if (event->buttons() & Qt::MidButton)
else if (event->buttons() & Qt::MiddleButton)
map_evt["name"] = "ITEM_MBUTTON_CLICKED";
else
map_evt["name"] = "ITEM_BUTTON_CLICKED";
......@@ -196,7 +196,7 @@ namespace QTVP_GEOMARKER{
map_evt["name"] = "ITEM_LBUTTON_DBLCLICKED";
else if (event->buttons() & Qt::RightButton)
map_evt["name"] = "ITEM_RBUTTON_DBLCLICKED";
else if (event->buttons() & Qt::MidButton)
else if (event->buttons() & Qt::MiddleButton)
map_evt["name"] = "ITEM_MBUTTON_DBLCLICKED";
else
map_evt["name"] = "ITEM_BUTTON_DBLCLICKED";
......
......@@ -123,7 +123,7 @@ namespace QTVP_GEOMARKER{
map_evt["name"] = "ITEM_LBUTTON_CLICKED";
else if (event->buttons() & Qt::RightButton)
map_evt["name"] = "ITEM_RBUTTON_CLICKED";
else if (event->buttons() & Qt::MidButton)
else if (event->buttons() & Qt::MiddleButton)
map_evt["name"] = "ITEM_MBUTTON_CLICKED";
else
map_evt["name"] = "ITEM_BUTTON_CLICKED";
......@@ -206,7 +206,7 @@ namespace QTVP_GEOMARKER{
map_evt["name"] = "ITEM_LBUTTON_DBLCLICKED";
else if (event->buttons() & Qt::RightButton)
map_evt["name"] = "ITEM_RBUTTON_DBLCLICKED";
else if (event->buttons() & Qt::MidButton)
else if (event->buttons() & Qt::MiddleButton)
map_evt["name"] = "ITEM_MBUTTON_DBLCLICKED";
else
map_evt["name"] = "ITEM_BUTTON_DBLCLICKED";
......
......@@ -139,7 +139,7 @@ namespace QTVP_GEOMARKER{
map_evt["name"] = "ITEM_LBUTTON_CLICKED";
else if (event->buttons() & Qt::RightButton)
map_evt["name"] = "ITEM_RBUTTON_CLICKED";
else if (event->buttons() & Qt::MidButton)
else if (event->buttons() & Qt::MiddleButton)
map_evt["name"] = "ITEM_MBUTTON_CLICKED";
else
map_evt["name"] = "ITEM_BUTTON_CLICKED";
......@@ -171,7 +171,7 @@ namespace QTVP_GEOMARKER{
map_evt["name"] = "ITEM_LBUTTON_DBLCLICKED";
else if (event->buttons() & Qt::RightButton)
map_evt["name"] = "ITEM_RBUTTON_DBLCLICKED";
else if (event->buttons() & Qt::MidButton)
else if (event->buttons() & Qt::MiddleButton)
map_evt["name"] = "ITEM_MBUTTON_DBLCLICKED";
else
map_evt["name"] = "ITEM_BUTTON_DBLCLICKED";
......
......@@ -123,7 +123,7 @@ namespace QTVP_GEOMARKER{
map_evt["name"] = "ITEM_LBUTTON_CLICKED";
else if (event->buttons() & Qt::RightButton)
map_evt["name"] = "ITEM_RBUTTON_CLICKED";
else if (event->buttons() & Qt::MidButton)
else if (event->buttons() & Qt::MiddleButton)
map_evt["name"] = "ITEM_MBUTTON_CLICKED";
else
map_evt["name"] = "ITEM_BUTTON_CLICKED";
......@@ -207,7 +207,7 @@ namespace QTVP_GEOMARKER{
map_evt["name"] = "ITEM_LBUTTON_DBLCLICKED";
else if (event->buttons() & Qt::RightButton)
map_evt["name"] = "ITEM_RBUTTON_DBLCLICKED";
else if (event->buttons() & Qt::MidButton)
else if (event->buttons() & Qt::MiddleButton)
map_evt["name"] = "ITEM_MBUTTON_DBLCLICKED";
else
map_evt["name"] = "ITEM_BUTTON_DBLCLICKED";
......
......@@ -118,7 +118,7 @@ namespace QTVP_GEOMARKER{
map_evt["name"] = "ITEM_LBUTTON_CLICKED";
else if (event->buttons() & Qt::RightButton)
map_evt["name"] = "ITEM_RBUTTON_CLICKED";
else if (event->buttons() & Qt::MidButton)
else if (event->buttons() & Qt::MiddleButton)
map_evt["name"] = "ITEM_MBUTTON_CLICKED";
else
map_evt["name"] = "ITEM_BUTTON_CLICKED";
......@@ -201,7 +201,7 @@ namespace QTVP_GEOMARKER{
map_evt["name"] = "ITEM_LBUTTON_DBLCLICKED";
else if (event->buttons() & Qt::RightButton)
map_evt["name"] = "ITEM_RBUTTON_DBLCLICKED";
else if (event->buttons() & Qt::MidButton)
else if (event->buttons() & Qt::MiddleButton)
map_evt["name"] = "ITEM_MBUTTON_DBLCLICKED";
else
map_evt["name"] = "ITEM_BUTTON_DBLCLICKED";
......
......@@ -56,7 +56,7 @@ namespace QTVP_GEOMARKER{
{return QGraphicsScene::addSimpleText(text,font);}
QGraphicsTextItem * addText(const QString & text, const QFont & font = QFont())
{return QGraphicsScene::addText(text,font);}
QGraphicsProxyWidget * addWidget(QWidget * widget, Qt::WindowFlags wFlags = 0)
QGraphicsProxyWidget * addWidget(QWidget * widget, Qt::WindowFlags wFlags = Qt::Widget)
{return QGraphicsScene::addWidget(widget,wFlags);}
void addItem(QGraphicsItem *item){return QGraphicsScene::addItem(item);}
void removeItem(QGraphicsItem * item){return QGraphicsScene::removeItem(item);}
......
......@@ -748,7 +748,7 @@ bool qtvplugin_geomarker::cb_mouseReleaseEvent ( QMouseEvent * e )
*/
QColor qtvplugin_geomarker::string2color(const QString & s)
{
QStringList lst = s.split(",",QString::SkipEmptyParts);
QStringList lst = s.split(",",Qt::SkipEmptyParts);
int r = 255,g = 255, b = 255, a= 128;
if (lst.empty()==false) {r = lst.first().toInt(); lst.pop_front();}
if (lst.empty()==false) {g = lst.first().toInt(); lst.pop_front();}
......
......@@ -17,6 +17,36 @@ namespace Ui {
}
using namespace QTVOSM;
#if QT_VERSION>=0x060000
inline QFont::Weight fweight2enum(int weight)
{
QFont::Weight w[] = {
QFont::Thin /*= 100*/,
QFont::ExtraLight /*= 200*/,
QFont:: Light /*= 300*/,
QFont::Normal /*= 400*/,
QFont::Medium /*= 500*/,
QFont::DemiBold /*= 600*/,
QFont::Bold /*= 700*/,
QFont::ExtraBold /*= 800*/,
QFont:: Black /*= 900*/
};
if (weight<0)
weight = 0;
if (weight>=100)
weight = 100;
return w[(weight/10) % (sizeof(w)/sizeof(w[0]))];
}
#else
inline int fweight2enum(int weight)
{
return weight;
}
#endif
/*!
\brief qtvplugin_geomarker introduces QGraphicesView system, established a common approach for geo marking.
GEO marker is a vector symbol that will be displayed on the background OSM raster map. there are 3 different mark types supported by this plugin.
......
#include "qtvplugin_geomarker.h"
#include "qtvplugin_geomarker.h"
#include "ui_qtvplugin_geomarker.h"
#include "geographicsellipseitem.h"
#include "geographicslineitem.h"
......@@ -271,7 +271,7 @@ QMap<QString, QVariant> qtvplugin_geomarker::func_update_point (const QMap<QStr
if ( paras.contains("weight_label"))
{
int fontWeight = paras["weight_label"].toInt();
f.setWeight(fontWeight);
f.setWeight(fweight2enum(fontWeight));
}
newitem->setLabelFont(f);
//! color_label has 4 text color band values splitted by comma, r,g,b,a
......@@ -398,7 +398,7 @@ QMap<QString, QVariant> qtvplugin_geomarker:: func_update_icon (const QMap<QSt
if ( paras.contains("weight_label"))
{
int fontWeight = paras["weight_label"].toInt();
f.setWeight(fontWeight);
f.setWeight(fweight2enum(fontWeight));
}
newitem->setLabelFont(f);
//! color_label has 4 text color band values splitted by comma, r,g,b,a
......@@ -533,7 +533,7 @@ QMap<QString, QVariant> qtvplugin_geomarker::func_update_line (const QMap<QStr
if ( paras.contains("weight_label"))
{
int fontWeight = paras["weight_label"].toInt();
f.setWeight(fontWeight);
f.setWeight(fweight2enum(fontWeight));
}
newitem->setLabelFont(f);
//! color_label has 4 text color band values splitted by comma, r,g,b,a
......@@ -738,7 +738,7 @@ QMap<QString, QVariant> qtvplugin_geomarker::func_update_polygon (const QMap<QS
if ( paras.contains("weight_label"))
{
int fontWeight = paras["weight_label"].toInt();
f.setWeight(fontWeight);
f.setWeight(fweight2enum(fontWeight));
}
newitem->setLabelFont(f);
//! color_label has 4 text color band values splitted by comma, r,g,b,a
......
......@@ -4,7 +4,7 @@
#include <QColorDialog>
#include <QSet>
#include <QMap>
#include <QRegExp>
#include <QRegularExpression>
#include <QDebug>
#include <QFileDialog>
#include <QMessageBox>
......@@ -303,7 +303,7 @@ void qtvplugin_geomarker::style_save()
m_default_style.brush.setColor(string2color(ui->lineEdit_QTV_FillColor->text()));
m_default_style.brush.setStyle(static_cast<Qt::BrushStyle>(ui->comboBox_QTV_fillPad->currentIndex()));
m_default_style.text_color = string2color(ui->lineEdit_QTV_TextColor->text());
m_default_style.font.setWeight(ui->spinBox_QTV_textWeight->value());
m_default_style.font.setWeight(fweight2enum(ui->spinBox_QTV_textWeight->value()));
m_default_style.font.setPointSize(ui->spinBox_QTV_fontSize->value());
m_default_style.scale = ui->lineEdit_QTV_icon_scale->text().toFloat();
m_default_style.rotate = ui->lineEdit_QTV_icon_rotate->text().toFloat();
......@@ -386,7 +386,7 @@ void qtvplugin_geomarker::style_load()
m_default_style.brush.setColor(string2color(ui->lineEdit_QTV_FillColor->text()));
m_default_style.brush.setStyle(static_cast<Qt::BrushStyle>(ui->comboBox_QTV_fillPad->currentIndex()));
m_default_style.text_color = string2color(ui->lineEdit_QTV_TextColor->text());
m_default_style.font.setWeight(ui->spinBox_QTV_textWeight->value());
m_default_style.font.setWeight(fweight2enum(ui->spinBox_QTV_textWeight->value()));
m_default_style.font.setPointSize(ui->spinBox_QTV_fontSize->value());
m_default_style.scale = ui->lineEdit_QTV_icon_scale->text().toFloat();
m_default_style.rotate = ui->lineEdit_QTV_icon_rotate->text().toFloat();
......@@ -480,7 +480,7 @@ void qtvplugin_geomarker::on_pushButton_QTV_update_clicked()
strPlainTexts.remove('\r');
strPlainTexts.remove('\015');
strPlainTexts.remove('\012');
QStringList lst = strPlainTexts.split(QRegExp("[,;]"),QString::SkipEmptyParts);
QStringList lst = strPlainTexts.split(QRegularExpression("[,;]"),Qt::SkipEmptyParts);
int c = 0;
QPointF ll;
foreach (QString s,lst)
......@@ -515,7 +515,7 @@ void qtvplugin_geomarker::on_pushButton_QTV_update_clicked()
QColor textColor = string2color( ui->lineEdit_QTV_TextColor->text());
QFont f = newitem->labelFont();
f.setPointSize(fontSz);
f.setWeight(fontWeight);
f.setWeight(fweight2enum(fontWeight));
newitem->setLabelFont(f);
newitem->setLabelColor(textColor);
newitem->setWantMouseHoverEvent(ui->checkBox_QTV_acceptHoverEvent->isChecked());
......@@ -558,7 +558,7 @@ void qtvplugin_geomarker::on_pushButton_QTV_prop_update_clicked()
QColor textColor = string2color( ui->lineEdit_QTV_TextColor->text());
QFont f = item->labelFont();
f.setPointSize(fontSz);
f.setWeight(fontWeight);
f.setWeight(fweight2enum(fontWeight));
item->setLabelFont(f);
item->setLabelColor(textColor);
......
#include "qtvplugin_geomarker.h"
#include "qtvplugin_geomarker.h"
#include "ui_qtvplugin_geomarker.h"
#include <QXmlStreamReader>
#include <QXmlStreamWriter>
......@@ -57,7 +57,7 @@ bool qtvplugin_geomarker::xml_save(QString xml)
stream.writeTextElement("style_pen",QString("%1").arg(int(pU->pen().style())));
stream.writeTextElement("width_pen",QString("%1").arg(int(pU->pen().width())));
stream.writeTextElement("color_brush",color2string(pU->brush().color()));
stream.writeTextElement("style_brush",QString("%1").arg(int(pU->brush().style())));
stream.writeTextElement("style_brush",QString("%1").arg(int(pU->brush().style())));
}
}
break;
......@@ -224,7 +224,7 @@ bool qtvplugin_geomarker::xml_load(QString xmlfile)
QXmlStreamReader xml(&fp);
if (xml.readNextStartElement())
{
if (xml.name()=="geomarker")
if (xml.name()==QString("geomarker"))
{
QMap<QString,QString> att_geoMarker = xml_attribs_map(xml.attributes());
if (att_geoMarker["version"].toDouble()>=1)
......@@ -234,7 +234,7 @@ bool qtvplugin_geomarker::xml_load(QString xmlfile)
xml.readNext();
if (xml.tokenType()==QXmlStreamReader::StartElement)
{
if (xml.name()=="mark")
if (xml.name()==QString("mark"))
{
tag_xml_mark mark;
res = xml_readMark(xml,mark,errMessage);
......@@ -291,17 +291,17 @@ bool qtvplugin_geomarker::xml_readMark(QXmlStreamReader & xml,tag_xml_mark & ma
while (xml.readNextStartElement())
{
if (xml.name()=="geo")
if (xml.name()==QString("geo"))
{
if (false==xml_readGeo(xml,mark,errMessage))
return false;
}
else if (xml.name()=="style")
else if (xml.name()==QString("style"))
{
if (false==xml_readStyle(xml,mark,errMessage))
return false;
}
else if (xml.name()=="properties")
else if (xml.name()==QString("properties"))
{
if (false==xml_readProps(xml,mark,errMessage))
return false;
......@@ -481,7 +481,7 @@ bool qtvplugin_geomarker::xml_update_mark(tag_xml_mark & mark)
QFont f = newitem->labelFont();
f.setPointSize(fontSz);
f.setWeight(fontWeight);
f.setWeight(fweight2enum(fontWeight));
newitem->setLabelFont(f);
newitem->setLabelColor(textColor);
......@@ -549,7 +549,7 @@ bool qtvplugin_geomarker::xml_icon_load (QString xmlfile)
QXmlStreamReader xml(&fp);
if (xml.readNextStartElement())
{
if (xml.name()=="geomarker_icons")
if (xml.name()==QString("geomarker_icons"))
{
QMap<QString,QString> att_geoMarker = xml_attribs_map(xml.attributes());
if (att_geoMarker["version"].toDouble()>=1)
......@@ -559,7 +559,7 @@ bool qtvplugin_geomarker::xml_icon_load (QString xmlfile)
xml.readNext();
if (xml.tokenType()==QXmlStreamReader::StartElement)
{
if (xml.name()=="icon")
if (xml.name()==QString("icon"))
{
QTVP_GEOMARKER::tag_icon icon;
//icon
......@@ -574,15 +574,15 @@ bool qtvplugin_geomarker::xml_icon_load (QString xmlfile)
{
while (xml.readNextStartElement()&& res)
{
if (xml.name()=="centerx")
if (xml.name()==QString("centerx"))
{
icon.centerx = xml.readElementText().toInt();
}
else if (xml.name()=="centery")
else if (xml.name()==QString("centery"))
{
icon.centery = xml.readElementText().toInt();
}
else if (xml.name()=="filename")
else if (xml.name()==QString("filename"))
{
QString fm = xml.readElementText();
QString fmOpen = smlinfo.absoluteFilePath() + "_"+ fm;
......
......@@ -751,7 +751,7 @@ void qtvplugin_grid::on_pushButton_QTV_add_mark_clicked()
save_ini();
int tp = ui->combox_type->currentIndex();
QString strAll = ui->plainTextEdit_QTV_markcmd->toPlainText();
QStringList strLines = strAll.split("\n",QString::SkipEmptyParts);
QStringList strLines = strAll.split("\n",Qt::SkipEmptyParts);
int c = 0;
bool bLatFirst = ui->radioButton_QTV_latfirst->isChecked();
QMap<QString, QVariant> map_multi;
......@@ -761,13 +761,13 @@ void qtvplugin_grid::on_pushButton_QTV_add_mark_clicked()
QString strRegsout = QString("([%1])+").arg(ui->lineEdit_QTV_south_spliter->text());
int latNG = 1, lonNG = 1;
if (str.indexOf(QRegExp(strRegWest))>=0)
if (str.indexOf(QRegularExpression(strRegWest))>=0)
lonNG=-1;
if (str.indexOf(QRegExp(strRegsout))>=0)
if (str.indexOf(QRegularExpression(strRegsout))>=0)
latNG=-1;
QStringList lst = str.split(QRegExp("([^0123456789.-])+"),QString::SkipEmptyParts);
QStringList lst = str.split(QRegularExpression("([^0123456789.-])+"),Qt::SkipEmptyParts);
double lat = 0, lon = 0;
if (lst.size()==6)
{
......
......@@ -5,7 +5,6 @@
#-------------------------------------------------
QT += core gui
win32: QT+= axcontainer
linux: QMAKE_CXXFLAGS += -std=c++11
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
......@@ -20,10 +19,11 @@ INCLUDEPATH += $$PWD/../qtviewer_planetosm
SOURCES += main.cpp
HEADERS += testcontainer.h
#if you want to build activec ctrls, please uncomment this line
DEFINES += BUILD_ACTIVEX_OSM
#DEFINES += BUILD_ACTIVEX_OSM
win32:contains(DEFINES,BUILD_ACTIVEX_OSM){
message ("Invoke ActiveX!");
win32: QT+= axcontainer
FORMS += testcontainer.ui
SOURCES += testcontainer.cpp
win32-g++{
......
......@@ -434,7 +434,7 @@ void testcontainer::on_pushButton_QTV_test_cache_clicked()
//Get expire Days
int exp = ui->osmmap->osm_get_cache_expire_days("OSM");
QMessageBox::information(this,"geomarker::osm_get_cache_expire_days",QString("%1").arg(exp));
res = ui->osmmap->osm_set_cache_expire_days("OSM",exp+1);
int nres = ui->osmmap->osm_set_cache_expire_days("OSM", exp+1);
QMessageBox::information(this,"geomarker::osm_get_cache_expire_days",QString("%1").arg(exp+1));
}
void testcontainer::on_pushButton_QTV_test_xml_clicked()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册