From 48700fe873a32a8b900b67756a0a63c920e099d1 Mon Sep 17 00:00:00 2001 From: goldenhawking Date: Sat, 6 Feb 2021 15:27:34 +0800 Subject: [PATCH] =?UTF-8?q?Qt6=20=E5=85=BC=E5=AE=B9=E6=80=A7=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=201.=20Qt6.0=20=E5=B0=9A=E6=9C=AA=E6=94=AF=E6=8C=81Ac?= =?UTF-8?q?tiveX=202.=20deprecated=20=E9=80=89=E9=A1=B9=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- qplanetosm.pro | 2 +- qtviewer_planetosm/osm_frame_widget.cpp | 2 ++ qtviewer_planetosm/osm_frame_widget.ui | 25 +++------------- qtviewer_planetosm/osmtiles/layer_browser.cpp | 1 + qtviewer_planetosm/osmtiles/layer_tiles.cpp | 5 ++-- qtviewer_planetosm/osmtiles/tilesviewer.cpp | 8 ++--- qtviewer_planetosm/osmtiles/urlDownloader.h | 2 +- .../geographicsellipseitem.cpp | 4 +-- qtvplugin_geomarker/geographicslineitem.cpp | 4 +-- .../geographicsmultilineitem.cpp | 4 +-- qtvplugin_geomarker/geographicspixmapitem.cpp | 4 +-- .../geographicspolygonitem.cpp | 4 +-- qtvplugin_geomarker/geographicsrectitem.cpp | 4 +-- qtvplugin_geomarker/geographicsscene.h | 2 +- qtvplugin_geomarker/qtvplugin_geomarker.cpp | 2 +- qtvplugin_geomarker/qtvplugin_geomarker.h | 30 +++++++++++++++++++ .../qtvplugin_geomarker_func.cpp | 10 +++---- .../qtvplugin_geomarker_uimethods.cpp | 12 ++++---- .../qtvplugin_geomarker_xml.cpp | 26 ++++++++-------- qtvplugin_grid/qtvplugin_grid.cpp | 8 ++--- test_container/test_container.pro | 4 +-- test_container/testcontainer_linux.cpp | 2 +- 22 files changed, 91 insertions(+), 74 deletions(-) diff --git a/qplanetosm.pro b/qplanetosm.pro index 9491613..d3a1674 100644 --- a/qplanetosm.pro +++ b/qplanetosm.pro @@ -1,6 +1,6 @@ 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 \ diff --git a/qtviewer_planetosm/osm_frame_widget.cpp b/qtviewer_planetosm/osm_frame_widget.cpp index 7db1f84..3afd5be 100644 --- a/qtviewer_planetosm/osm_frame_widget.cpp +++ b/qtviewer_planetosm/osm_frame_widget.cpp @@ -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(&QLCDNumber::display)); m_pLayerDispMod = new QStandardItemModel(this); m_pLayerDispMod->setColumnCount(3); m_pLayerDispMod->setHeaderData(0,Qt::Horizontal,QString(tr("name"))); diff --git a/qtviewer_planetosm/osm_frame_widget.ui b/qtviewer_planetosm/osm_frame_widget.ui index f41f045..ad08ff6 100644 --- a/qtviewer_planetosm/osm_frame_widget.ui +++ b/qtviewer_planetosm/osm_frame_widget.ui @@ -96,7 +96,7 @@ 0 - + 0 @@ -268,7 +268,7 @@ - + 0 @@ -475,7 +475,7 @@ - tilesviewer + QTVOSM::tilesviewer QWidget
osmtiles/tilesviewer.h
1 @@ -485,22 +485,5 @@ - - - dial_QTV_zoom - valueChanged(int) - lcdNumber_QTV_level - display(int) - - - 498 - 72 - - - 596 - 110 - - - - + diff --git a/qtviewer_planetosm/osmtiles/layer_browser.cpp b/qtviewer_planetosm/osmtiles/layer_browser.cpp index 6de4809..9e0df84 100644 --- a/qtviewer_planetosm/osmtiles/layer_browser.cpp +++ b/qtviewer_planetosm/osmtiles/layer_browser.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include "layer_browser.h" #include "tilesviewer.h" namespace QTVOSM diff --git a/qtviewer_planetosm/osmtiles/layer_tiles.cpp b/qtviewer_planetosm/osmtiles/layer_tiles.cpp index c5cbe33..5145563 100644 --- a/qtviewer_planetosm/osmtiles/layer_tiles.cpp +++ b/qtviewer_planetosm/osmtiles/layer_tiles.cpp @@ -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) diff --git a/qtviewer_planetosm/osmtiles/tilesviewer.cpp b/qtviewer_planetosm/osmtiles/tilesviewer.cpp index 1a94317..ee162aa 100644 --- a/qtviewer_planetosm/osmtiles/tilesviewer.cpp +++ b/qtviewer_planetosm/osmtiles/tilesviewer.cpp @@ -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; diff --git a/qtviewer_planetosm/osmtiles/urlDownloader.h b/qtviewer_planetosm/osmtiles/urlDownloader.h index 527b3f0..80c173b 100644 --- a/qtviewer_planetosm/osmtiles/urlDownloader.h +++ b/qtviewer_planetosm/osmtiles/urlDownloader.h @@ -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; } diff --git a/qtvplugin_geomarker/geographicsellipseitem.cpp b/qtvplugin_geomarker/geographicsellipseitem.cpp index 290ca7e..b8ddfe7 100644 --- a/qtvplugin_geomarker/geographicsellipseitem.cpp +++ b/qtvplugin_geomarker/geographicsellipseitem.cpp @@ -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"; diff --git a/qtvplugin_geomarker/geographicslineitem.cpp b/qtvplugin_geomarker/geographicslineitem.cpp index 64fe699..7285e5e 100644 --- a/qtvplugin_geomarker/geographicslineitem.cpp +++ b/qtvplugin_geomarker/geographicslineitem.cpp @@ -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"; diff --git a/qtvplugin_geomarker/geographicsmultilineitem.cpp b/qtvplugin_geomarker/geographicsmultilineitem.cpp index c27b80d..37a6fd1 100644 --- a/qtvplugin_geomarker/geographicsmultilineitem.cpp +++ b/qtvplugin_geomarker/geographicsmultilineitem.cpp @@ -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"; diff --git a/qtvplugin_geomarker/geographicspixmapitem.cpp b/qtvplugin_geomarker/geographicspixmapitem.cpp index c7a6890..f0910bd 100644 --- a/qtvplugin_geomarker/geographicspixmapitem.cpp +++ b/qtvplugin_geomarker/geographicspixmapitem.cpp @@ -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"; diff --git a/qtvplugin_geomarker/geographicspolygonitem.cpp b/qtvplugin_geomarker/geographicspolygonitem.cpp index 34245c8..13ac321 100644 --- a/qtvplugin_geomarker/geographicspolygonitem.cpp +++ b/qtvplugin_geomarker/geographicspolygonitem.cpp @@ -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"; diff --git a/qtvplugin_geomarker/geographicsrectitem.cpp b/qtvplugin_geomarker/geographicsrectitem.cpp index 62a661f..b8105e8 100644 --- a/qtvplugin_geomarker/geographicsrectitem.cpp +++ b/qtvplugin_geomarker/geographicsrectitem.cpp @@ -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"; diff --git a/qtvplugin_geomarker/geographicsscene.h b/qtvplugin_geomarker/geographicsscene.h index a4f68d7..ea5d3ce 100644 --- a/qtvplugin_geomarker/geographicsscene.h +++ b/qtvplugin_geomarker/geographicsscene.h @@ -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);} diff --git a/qtvplugin_geomarker/qtvplugin_geomarker.cpp b/qtvplugin_geomarker/qtvplugin_geomarker.cpp index c37543f..40326ac 100644 --- a/qtvplugin_geomarker/qtvplugin_geomarker.cpp +++ b/qtvplugin_geomarker/qtvplugin_geomarker.cpp @@ -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();} diff --git a/qtvplugin_geomarker/qtvplugin_geomarker.h b/qtvplugin_geomarker/qtvplugin_geomarker.h index ed149d7..8855e58 100644 --- a/qtvplugin_geomarker/qtvplugin_geomarker.h +++ b/qtvplugin_geomarker/qtvplugin_geomarker.h @@ -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. diff --git a/qtvplugin_geomarker/qtvplugin_geomarker_func.cpp b/qtvplugin_geomarker/qtvplugin_geomarker_func.cpp index f401c05..7d7c4be 100644 --- a/qtvplugin_geomarker/qtvplugin_geomarker_func.cpp +++ b/qtvplugin_geomarker/qtvplugin_geomarker_func.cpp @@ -1,4 +1,4 @@ -#include "qtvplugin_geomarker.h" +#include "qtvplugin_geomarker.h" #include "ui_qtvplugin_geomarker.h" #include "geographicsellipseitem.h" #include "geographicslineitem.h" @@ -271,7 +271,7 @@ QMap qtvplugin_geomarker::func_update_point (const QMapsetLabelFont(f); //! color_label has 4 text color band values splitted by comma, r,g,b,a @@ -398,7 +398,7 @@ QMap qtvplugin_geomarker:: func_update_icon (const QMapsetLabelFont(f); //! color_label has 4 text color band values splitted by comma, r,g,b,a @@ -533,7 +533,7 @@ QMap qtvplugin_geomarker::func_update_line (const QMapsetLabelFont(f); //! color_label has 4 text color band values splitted by comma, r,g,b,a @@ -738,7 +738,7 @@ QMap qtvplugin_geomarker::func_update_polygon (const QMapsetLabelFont(f); //! color_label has 4 text color band values splitted by comma, r,g,b,a diff --git a/qtvplugin_geomarker/qtvplugin_geomarker_uimethods.cpp b/qtvplugin_geomarker/qtvplugin_geomarker_uimethods.cpp index 5948a4a..77413fd 100644 --- a/qtvplugin_geomarker/qtvplugin_geomarker_uimethods.cpp +++ b/qtvplugin_geomarker/qtvplugin_geomarker_uimethods.cpp @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include #include #include @@ -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(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(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); diff --git a/qtvplugin_geomarker/qtvplugin_geomarker_xml.cpp b/qtvplugin_geomarker/qtvplugin_geomarker_xml.cpp index ff3d0c4..a0dd6e3 100644 --- a/qtvplugin_geomarker/qtvplugin_geomarker_xml.cpp +++ b/qtvplugin_geomarker/qtvplugin_geomarker_xml.cpp @@ -1,4 +1,4 @@ -#include "qtvplugin_geomarker.h" +#include "qtvplugin_geomarker.h" #include "ui_qtvplugin_geomarker.h" #include #include @@ -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 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 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; diff --git a/qtvplugin_grid/qtvplugin_grid.cpp b/qtvplugin_grid/qtvplugin_grid.cpp index 1246a11..def64f7 100644 --- a/qtvplugin_grid/qtvplugin_grid.cpp +++ b/qtvplugin_grid/qtvplugin_grid.cpp @@ -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 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) { diff --git a/test_container/test_container.pro b/test_container/test_container.pro index db3feab..a5cfcfd 100644 --- a/test_container/test_container.pro +++ b/test_container/test_container.pro @@ -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++{ diff --git a/test_container/testcontainer_linux.cpp b/test_container/testcontainer_linux.cpp index 11a4d8b..ab84499 100644 --- a/test_container/testcontainer_linux.cpp +++ b/test_container/testcontainer_linux.cpp @@ -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() -- GitLab