提交 071051f7 编写于 作者: D dev@dev.com

Qt6 Need extra pre-compile commands to fit differences .

上级 5b22f549
......@@ -20,9 +20,16 @@ int main(int argc, char *argv[])
QTranslator qtTranslator;
#if QT_VERSION>=0x060000
if (qtTranslator.load("qt_" + QLocale::system().name(),
QLibraryInfo::path(QLibraryInfo::TranslationsPath)))
app.installTranslator(&qtTranslator);
#else
if (qtTranslator.load("qt_" + QLocale::system().name(),
QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
app.installTranslator(&qtTranslator);
#endif
QTranslator appTranslator;
QString strTransLocalFile =
......
......@@ -467,7 +467,11 @@ namespace QTVOSM{
if (needUpdate)
this->update();
double lat,lon;
#if QT_VERSION>=0x060000
CV_DP2LLA(event->position().x(),event->position().y(),&lat,&lon);
#else
CV_DP2LLA(event->x(),event->y(),&lat,&lon);
#endif
//! 1. source=MAIN_MAP, destin = ALL, msg = MOUSE_MOVE
if (this->isEnabled())
......
......@@ -32,7 +32,11 @@ namespace QTVOSM{
{
const tag_download_tasks & tk = m_map_pendingTasks[rply];
QVariant vaurl = rply->attribute(QNetworkRequest::RedirectionTargetAttribute);
#if QT_VERSION>=0x060000
if (vaurl.typeId()==QMetaType::QUrl)
#else
if (vaurl.type()==QVariant::Url)
#endif
{
QUrl urlRd = vaurl.toUrl();
if (urlRd.isRelative())
......
......@@ -542,7 +542,11 @@ bool qtvplugin_geomarker::cb_mouseDoubleClickEvent(QMouseEvent * e)
while (wx > winsz-1) wx -= winsz;
QPointF mouse_scene_pt(wx,wy);
#if QT_VERSION>=0x060000
QPoint mouse_screen_pt = e->globalPosition().toPoint();
#else
QPoint mouse_screen_pt = e->globalPos();
#endif
Qt::MouseButton mouse_button = e->button();
QWidget * pwig = dynamic_cast<QWidget *> (m_pVi);
if (m_bVisible && pwig && too_many_items()==false)
......@@ -590,7 +594,11 @@ bool qtvplugin_geomarker::cb_mousePressEvent(QMouseEvent * e)
while (wx > winsz-1) wx -= winsz;
QPointF mouse_scene_pt(wx,wy);
#if QT_VERSION>=0x060000
QPoint mouse_screen_pt = e->globalPosition().toPoint();
#else
QPoint mouse_screen_pt = e->globalPos();
#endif
Qt::MouseButton mouse_button = e->button();
QWidget * pwig = dynamic_cast<QWidget *> (m_pVi);
if (m_bVisible && pwig && too_many_items()==false)
......@@ -646,7 +654,11 @@ bool qtvplugin_geomarker::cb_mouseMoveEvent ( QMouseEvent * e )
while (wx < 0) wx += winsz;
while (wx > winsz-1) wx -= winsz;
QPointF mouse_scene_pt(wx,wy);
#if QT_VERSION>=0x060000
QPoint mouse_screen_pt = e->globalPosition().toPoint();
#else
QPoint mouse_screen_pt = e->globalPos();
#endif
Qt::MouseButton mouse_button = e->button();
QWidget * pwig = dynamic_cast<QWidget *> (m_pVi);
if (m_bVisible && pwig && too_many_items()==false)
......@@ -750,7 +762,7 @@ bool qtvplugin_geomarker::cb_mouseReleaseEvent ( QMouseEvent * e )
*/
QColor qtvplugin_geomarker::string2color(const QString & s)
{
#if QT_VERSION >= 0x051500
#if QT_VERSION >= 0x050F00
QStringList lst = s.split(",",Qt::SkipEmptyParts);
#else
QStringList lst = s.split(",",QString::SkipEmptyParts);
......
......@@ -480,7 +480,7 @@ void qtvplugin_geomarker::on_pushButton_QTV_update_clicked()
strPlainTexts.remove('\r');
strPlainTexts.remove('\015');
strPlainTexts.remove('\012');
#if QT_VERSION >= 0x051500
#if QT_VERSION >= 0x050F00
QStringList lst = strPlainTexts.split(QRegularExpression("[,;]"),Qt::SkipEmptyParts);
#else
QStringList lst = strPlainTexts.split(QRegularExpression("[,;]"),QString::SkipEmptyParts);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册