QDeclarativeGeoMap::connect(QPointer<QGeoMap>&, void (QGeoMap::*)(const QString&), QDeclarativeGeoMa

本文记录了在编译Qt的地图组件时遇到的警告及错误信息,主要涉及到QGeoMapPrivate与QDeclarativeGeoMap之间的连接问题。通过分析错误提示,可以发现编译过程中出现了类型不匹配和参数数量不符的问题。
egeomap.o declarativemaps/qdeclarativegeomap.cpp
In file included from ../../include/QtLocation/5.11.1/QtLocation/private/qgeomap_p.h:1:0,
                 from declarativemaps/qdeclarativegeomap_p.h:63,
                 from declarativemaps/qdeclarativegeomap.cpp:37:
../../include/QtLocation/5.11.1/QtLocation/private/../../../../../src/location/maps/qgeomap_p.h:174:18: 警告:‘QGeoMapPrivate’已经是‘QGeoMap’的友元 [默认启用]
     friend class QGeoMapPrivate;
                  ^
declarativemaps/qdeclarativegeomap.cpp: 在成员函数‘void QDeclarativeGeoMap::mappingManagerInitialized()’中:
declarativemaps/qdeclarativegeomap.cpp:699:91: 错误:对‘QDeclarativeGeoMap::connect(QPointer<QGeoMap>&, void (QGeoMap::*)(const QString&), QDeclarativeGeoMap::mappingManagerInitialized()::__lambda9)’的调用没有匹配的函数
                         [&copyrightString](const QString &copy){ copyrightString = copy; });
                                                                                           ^
declarativemaps/qdeclarativegeomap.cpp:699:91: 附注:备选是:
In file included from /home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/qobject.h:1:0,
                 from /home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/../../src/corelib/animation/qabstractanimation.h:43,
                 from /home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/qabstractanimation.h:1,
                 from /home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/QtCore:5,
                 from ../../include/QtLocation/QtLocationDepends:3:
/home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/../../src/corelib/kernel/qobject.h:208:36: 附注:static QMetaObject::Connection QObject::connect(const QObject*, const char*, const QObject*, const char*, Qt::ConnectionType)
     static QMetaObject::Connection connect(const QObject *sender, const char *signal,
                                    ^
/home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/../../src/corelib/kernel/qobject.h:208:36: 附注: 备选需要 5 实参,但提供了 3 个
/home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/../../src/corelib/kernel/qobject.h:211:36: 附注:static QMetaObject::Connection QObject::connect(const QObject*, const QMetaMethod&, const QObject*, const QMetaMethod&, Qt::ConnectionType)
     static QMetaObject::Connection connect(const QObject *sender, const QMetaMethod &signal,
                                    ^
/home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/../../src/corelib/kernel/qobject.h:211:36: 附注: 备选需要 5 实参,但提供了 3 个
/home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/../../src/corelib/kernel/qobject.h:463:32: 附注:QMetaObject::Connection QObject::connect(const QObject*, const char*, const char*, Qt::ConnectionType) const
 inline QMetaObject::Connection QObject::connect(const QObject *asender, const char *asignal,
                                ^
/home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/../../src/corelib/kernel/qobject.h:463:32: 附注:  no known conversion for argument 2 from ‘void (QGeoMap::*)(const QString&)’ to ‘const char*’
/home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/../../src/corelib/kernel/qobject.h:228:43: 附注:template<class Func1, class Func2> static QMetaObject::Connection QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, const typename QtPrivate::FunctionPointer<Func2>::Object*, Func2, Qt::ConnectionType)
     static inline QMetaObject::Connection connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal,
                                           ^
/home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/../../src/corelib/kernel/qobject.h:228:43: 附注:  template argument deduction/substitution failed:
declarativemaps/qdeclarativegeomap.cpp:699:91: 附注:  mismatched types ‘const typename QtPrivate::FunctionPointer<Func>::Object*’ and ‘QPointer<QGeoMap>’
                         [&copyrightString](const QString &copy){ copyrightString = copy; });
                                                                                           ^
In file included from /home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/qobject.h:1:0,
                 from /home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/../../src/corelib/animation/qabstractanimation.h:43,
                 from /home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/qabstractanimation.h:1,
                 from /home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/QtCore:5,
                 from ../../include/QtLocation/QtLocationDepends:3:
/home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/../../src/corelib/kernel/qobject.h:260:13: 附注:template<class Func1, class Func2> static typename std::enable_if<((int)(QtPrivate::FunctionPointer<Func2>::ArgumentCount) >= 0), QMetaObject::Connection>::type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, Func2)
             connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, Func2 slot)
             ^
/home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/../../src/corelib/kernel/qobject.h:260:13: 附注:  template argument deduction/substitution failed:
declarativemaps/qdeclarativegeomap.cpp:699:91: 附注:  mismatched types ‘const typename QtPrivate::FunctionPointer<Func>::Object*’ and ‘QPointer<QGeoMap>’
                         [&copyrightString](const QString &copy){ copyrightString = copy; });
                                                                                           ^
In file included from /home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/qobject.h:1:0,
                 from /home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/../../src/corelib/animation/qabstractanimation.h:43,
                 from /home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/qabstractanimation.h:1,
                 from /home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/QtCore:5,
                 from ../../include/QtLocation/QtLocationDepends:3:
/home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/../../src/corelib/kernel/qobject.h:269:13: 附注:template<class Func1, class Func2> static typename std::enable_if<(((int)(QtPrivate::FunctionPointer<Func2>::ArgumentCount) >= 0) && (! QtPrivate::FunctionPointer<Func2>::IsPointerToMemberFunction)), QMetaObject::Connection>::type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, const QObject*, Func2, Qt::ConnectionType)
             connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, const QObject *context, Func2 slot,
             ^
/home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/../../src/corelib/kernel/qobject.h:269:13: 附注:  template argument deduction/substitution failed:
declarativemaps/qdeclarativegeomap.cpp:699:91: 附注:  mismatched types ‘const typename QtPrivate::FunctionPointer<Func>::Object*’ and ‘QPointer<QGeoMap>’
                         [&copyrightString](const QString &copy){ copyrightString = copy; });
                                                                                           ^
In file included from /home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/qobject.h:1:0,
                 from /home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/../../src/corelib/animation/qabstractanimation.h:43,
                 from /home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/qabstractanimation.h:1,
                 from /home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/QtCore:5,
                 from ../../include/QtLocation/QtLocationDepends:3:
/home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/../../src/corelib/kernel/qobject.h:300:13: 附注:template<class Func1, class Func2> static typename std::enable_if<(QtPrivate::FunctionPointer<Func2>::ArgumentCount == (-1)), QMetaObject::Connection>::type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, Func2)
             connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, Func2 slot)
             ^
/home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/../../src/corelib/kernel/qobject.h:300:13: 附注:  template argument deduction/substitution failed:
declarativemaps/qdeclarativegeomap.cpp:699:91: 附注:  mismatched types ‘const typename QtPrivate::FunctionPointer<Func>::Object*’ and ‘QPointer<QGeoMap>’
                         [&copyrightString](const QString &copy){ copyrightString = copy; });
                                                                                           ^
In file included from /home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/qobject.h:1:0,
                 from /home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/../../src/corelib/animation/qabstractanimation.h:43,
                 from /home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/qabstractanimation.h:1,
                 from /home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/QtCore:5,
                 from ../../include/QtLocation/QtLocationDepends:3:
/home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/../../src/corelib/kernel/qobject.h:308:13: 附注:template<class Func1, class Func2> static typename std::enable_if<(QtPrivate::FunctionPointer<Func2>::ArgumentCount == (-1)), QMetaObject::Connection>::type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, const QObject*, Func2, Qt::ConnectionType)
             connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, const QObject *context, Func2 slot,
             ^
/home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/../../src/corelib/kernel/qobject.h:308:13: 附注:  template argument deduction/substitution failed:
declarativemaps/qdeclarativegeomap.cpp:699:91: 附注:  mismatched types ‘const typename QtPrivate::FunctionPointer<Func>::Object*’ and ‘QPointer<QGeoMap>’
                         [&copyrightString](const QString &copy){ copyrightString = copy; });
                                                                                           ^
declarativemaps/qdeclarativegeomap.cpp:703:88: 错误:对‘QDeclarativeGeoMap::connect(QPointer<QGeoMap>&, void (QGeoMap::*)(const QImage&), QDeclarativeGeoMap::mappingManagerInitialized()::__lambda10)’的调用没有匹配的函数
                         [&copyrightImage](const QImage &copy){ copyrightImage = copy; });
                                                                                        ^
declarativemaps/qdeclarativegeomap.cpp:703:88: 附注:备选是:
In file included from /home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/qobject.h:1:0,
                 from /home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/../../src/corelib/animation/qabstractanimation.h:43,
                 from /home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/qabstractanimation.h:1,
                 from /home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/QtCore:5,
                 from ../../include/QtLocation/QtLocationDepends:3:
/home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/../../src/corelib/kernel/qobject.h:208:36: 附注:static QMetaObject::Connection QObject::connect(const QObject*, const char*, const QObject*, const char*, Qt::ConnectionType)
     static QMetaObject::Connection connect(const QObject *sender, const char *signal,
                                    ^
/home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/../../src/corelib/kernel/qobject.h:208:36: 附注: 备选需要 5 实参,但提供了 3 个
/home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/../../src/corelib/kernel/qobject.h:211:36: 附注:static QMetaObject::Connection QObject::connect(const QObject*, const QMetaMethod&, const QObject*, const QMetaMethod&, Qt::ConnectionType)
     static QMetaObject::Connection connect(const QObject *sender, const QMetaMethod &signal,
                                    ^
/home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/../../src/corelib/kernel/qobject.h:211:36: 附注: 备选需要 5 实参,但提供了 3 个
/home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/../../src/corelib/kernel/qobject.h:463:32: 附注:QMetaObject::Connection QObject::connect(const QObject*, const char*, const char*, Qt::ConnectionType) const
 inline QMetaObject::Connection QObject::connect(const QObject *asender, const char *asignal,
                                ^
/home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/../../src/corelib/kernel/qobject.h:463:32: 附注:  no known conversion for argument 2 from ‘void (QGeoMap::*)(const QImage&)’ to ‘const char*’
/home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/../../src/corelib/kernel/qobject.h:228:43: 附注:template<class Func1, class Func2> static QMetaObject::Connection QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, const typename QtPrivate::FunctionPointer<Func2>::Object*, Func2, Qt::ConnectionType)
     static inline QMetaObject::Connection connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal,
                                           ^
/home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/../../src/corelib/kernel/qobject.h:228:43: 附注:  template argument deduction/substitution failed:
declarativemaps/qdeclarativegeomap.cpp:703:88: 附注:  mismatched types ‘const typename QtPrivate::FunctionPointer<Func>::Object*’ and ‘QPointer<QGeoMap>’
                         [&copyrightImage](const QImage &copy){ copyrightImage = copy; });
                                                                                        ^
In file included from /home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/qobject.h:1:0,
                 from /home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/../../src/corelib/animation/qabstractanimation.h:43,
                 from /home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/qabstractanimation.h:1,
                 from /home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/QtCore:5,
                 from ../../include/QtLocation/QtLocationDepends:3:
/home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/../../src/corelib/kernel/qobject.h:260:13: 附注:template<class Func1, class Func2> static typename std::enable_if<((int)(QtPrivate::FunctionPointer<Func2>::ArgumentCount) >= 0), QMetaObject::Connection>::type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, Func2)
             connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, Func2 slot)
             ^
/home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/../../src/corelib/kernel/qobject.h:260:13: 附注:  template argument deduction/substitution failed:
declarativemaps/qdeclarativegeomap.cpp:703:88: 附注:  mismatched types ‘const typename QtPrivate::FunctionPointer<Func>::Object*’ and ‘QPointer<QGeoMap>’
                         [&copyrightImage](const QImage &copy){ copyrightImage = copy; });
                                                                                        ^
In file included from /home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/qobject.h:1:0,
                 from /home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/../../src/corelib/animation/qabstractanimation.h:43,
                 from /home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/qabstractanimation.h:1,
                 from /home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/QtCore:5,
                 from ../../include/QtLocation/QtLocationDepends:3:
/home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/../../src/corelib/kernel/qobject.h:269:13: 附注:template<class Func1, class Func2> static typename std::enable_if<(((int)(QtPrivate::FunctionPointer<Func2>::ArgumentCount) >= 0) && (! QtPrivate::FunctionPointer<Func2>::IsPointerToMemberFunction)), QMetaObject::Connection>::type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, const QObject*, Func2, Qt::ConnectionType)
             connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, const QObject *context, Func2 slot,
             ^
/home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/../../src/corelib/kernel/qobject.h:269:13: 附注:  template argument deduction/substitution failed:
declarativemaps/qdeclarativegeomap.cpp:703:88: 附注:  mismatched types ‘const typename QtPrivate::FunctionPointer<Func>::Object*’ and ‘QPointer<QGeoMap>’
                         [&copyrightImage](const QImage &copy){ copyrightImage = copy; });
                                                                                        ^
In file included from /home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/qobject.h:1:0,
                 from /home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/../../src/corelib/animation/qabstractanimation.h:43,
                 from /home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/qabstractanimation.h:1,
                 from /home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/QtCore:5,
                 from ../../include/QtLocation/QtLocationDepends:3:
/home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/../../src/corelib/kernel/qobject.h:300:13: 附注:template<class Func1, class Func2> static typename std::enable_if<(QtPrivate::FunctionPointer<Func2>::ArgumentCount == (-1)), QMetaObject::Connection>::type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, Func2)
             connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, Func2 slot)
             ^
/home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/../../src/corelib/kernel/qobject.h:300:13: 附注:  template argument deduction/substitution failed:
declarativemaps/qdeclarativegeomap.cpp:703:88: 附注:  mismatched types ‘const typename QtPrivate::FunctionPointer<Func>::Object*’ and ‘QPointer<QGeoMap>’
                         [&copyrightImage](const QImage &copy){ copyrightImage = copy; });
                                                                                        ^
In file included from /home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/qobject.h:1:0,
                 from /home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/../../src/corelib/animation/qabstractanimation.h:43,
                 from /home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/qabstractanimation.h:1,
                 from /home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/QtCore:5,
                 from ../../include/QtLocation/QtLocationDepends:3:
/home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/../../src/corelib/kernel/qobject.h:308:13: 附注:template<class Func1, class Func2> static typename std::enable_if<(QtPrivate::FunctionPointer<Func2>::ArgumentCount == (-1)), QMetaObject::Connection>::type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, const QObject*, Func2, Qt::ConnectionType)
             connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, const QObject *context, Func2 slot,
             ^
/home/aisdk/code/qt/qt-everywhere-src-5.11.1/qtbase/include/QtCore/../../src/corelib/kernel/qobject.h:308:13: 附注:  template argument deduction/substitution failed:
declarativemaps/qdeclarativegeomap.cpp:703:88: 附注:  mismatched types ‘const typename QtPrivate::FunctionPointer<Func>::Object*’ and ‘QPointer<QGeoMap>’
                         [&copyrightImage](const QImage &copy){ copyrightImage = copy; });
                                                                                        ^
declarativemaps/qdeclarativegeomap.cpp:722:70: 错误:对‘QDeclarativeGeoMa
#ifndef __QFTP_CLIENT_H__ #define __QFTP_CLIENT_H__ // make sure to add qftp depending on #include <QTimer> #include <QFile> #include <QUrl> #include <QMap> #include <QVariant> #include <QMutex> #include <QBuffer> #include <QSet> #include "qftp.h" struct RemoteDir; struct SingleCmd; class QFtpClient : public QFtp { Q_OBJECT public: enum QFTP_CMD { QC_NONE, QC_CD, QC_LIST, QC_RENAME, QC_PUT_FILE, QC_PUT_FILES, QC_PUT_TREE, QC_GET_BUFFER, QC_GET_FILE, QC_GET_FILES, QC_GET_TREE, QC_RM_FILE, QC_RM_TREE, QC_MKD, QC_MKDS, }; enum record_type { rt_success, rt_executing, rt_total, rt_count, }; public: QFtpClient(QString serverip = "", QString username = "", QString password = "", qint16 port = 21, QObject* parent = 0); ~QFtpClient(); void setIP(const QString&amp; ip, const qint16 port = 21); void setUser(const QString&amp; username, const QString&amp; password); void close_host(); bool sync_connect(int msec = 3000); // 现存缺陷: 不能创建含中文的目录/文件 // 绝对路径操作接口 // 上传文件/目录 bool put_files(const QList< QPair<QString, QString&gt; >& vfiles, int msec = 30000); //list< pir<localfile, remotefile> > bool put_file(const QString&amp; localabsfile, const QString&amp; remoteabsfile, int msec = 3000); bool put_tree(const QString&amp; localabspath, const QString&amp; remoteabspath, const QStringList& exceptabspath = {}, int msec = 30000); // 下载文件/目录 bool get_buffer(const QString&amp; remoteabsfile, int msec = 3000); bool get_file(const QString&amp; remoteabsfile, const QString&amp; localabsfile, int msec = 3000); bool get_files(const QList< QPair<QString, QString&gt; >& vfiles, int msec = 30000); //list< pir<remotefile, localfile> > bool get_tree(const QString&amp; remoteabspath, const QString&amp; localabspath, const QStringList& exceptabspath = {}, int msec = 30000); // 删除文件/目录 bool rm_file(const QString&amp; remotefile, int msec = 3000); bool rm_tree(const QString&amp; dir, int msec = 30000); // 新建目录 bool mk_dir(const QString&amp; dir, int msec = 3000); bool mk_dir(const QStringList& dirlist, int msec = 3000); // 重命名 bool _rename(const QString&amp; remotefilepath, const QString&amp; newname, int msec = 3000); // 显示列表 bool _list(const QString&amp; remotepath, int msec = 3000); // 当前目录操作接口 bool pwd_put_file(const QString&amp; localabsfile, int msec = 3000); bool pwd_get_file(const QString&amp; remotefile, const QUrl& localurl, int msec = 3000); bool pwd_rm_file(const QString&amp; remotefile, int msec = 3000); bool pwd_rm_tree(const QString&amp; remotedir, int msec = 10000); bool pwd_mk_dir(const QString&amp; remotedir, int msec = 3000); bool pwd_rename(const QString&amp; remotefile, const QString&amp; newname, int msec = 3000); bool pwd_list(int msec = 3000); bool pwd_cd(const QString&amp; dirname, bool done_list = false, int msec = 3000); // 是否被占用 bool is_busy()const; // 是否已连接 bool is_connect()const; QString pwd(); signals: void signal_state_changed(int); void signal_command_finish(int cmdid, QVariantList params, QString errorstring = ""); void signal_ftp_log(const QString&amp;, bool error = false); void signal_list(const QList<QUrlInfo>&); void signal_get_buffer(const QByteArray&); void signal_done(int cmdid, int ok_num, int exec_num, int total_num); private: bool inner_put_file(const QString&amp; localabsfile, const QString&amp; remoteabsfile, int msec = 3000); bool inner_put_files(QVariantList& files, int msec = 30000); bool inner_put_tree(const QString&amp; localabspath, const QString&amp; remoteabspath, const QStringList& vExcept = {}, int msec = 30000); bool inner_get_buffer(const QString&amp; remoteabsfile, int msec = 3000); bool inner_get_file(const QString&amp; remoteabsfile, const QString&amp; localabsfile, int msec = 3000); bool inner_get_files(QVariantList& files, int msec = 30000); bool inner_get_tree(const QString&amp; remoteabspath, const QString&amp; localabspath, const QStringList& vExcept = {}, int msec = 30000); bool inner_rm_file(const QString&amp; remotefile, int msec = 3000); bool inner_rm_tree(const QString&amp; dir, int msec = 30000); bool inner_mk_dir(const QString&amp; dir, int msec = 3000); bool inner_mk_dir(const QStringList& dirlist, int msec = 3000); bool inner_rename(const QString&amp; remotefilepath, const QString&amp; newname, int msec = 3000); bool inner_list(const QString&amp; remotepath = "", int msec = 3000); bool inner_cd(const QString&amp; dirname, bool done_list = false, int msec = 3000); // done_list - 切换完成后, 是否需要list(用于ui显示) void connect_host(); void connect_result(QString errstr); void login_result(QString errstr); void close_result(QString errstr); void list_result(const SingleCmd& smd); void get_result(const SingleCmd& smd, QString errstr); bool has_cmd(); bool next_cmd(); bool next_cmd_util_done(int msec); void cd_result(const SingleCmd& smd, QString errstr); void put_result(const SingleCmd& smd, QString errstr); void mkd_result(const SingleCmd& smd, QString errstr); void rmd_result(const SingleCmd& smd, QString errstr); void rm_result(const SingleCmd& smd, QString errstr); void rename_result(const SingleCmd& smd, QString errstr); void build_pwd_cd_cmd(const QString&amp; dirname, bool done_list = false); // 当前目录cd void build_cd_cmd(const QString&amp; remotepath); // 绝对路径cd void build_cd_cmd(const QString&amp; remotepath, QList<SingleCmd>& l); void build_mkdir_cmd(const QString&amp; remotepath); void build_rmdir_cmd(const QString&amp; remotepath); void build_rm_cmd(const QString&amp; remotepath); void build_put_cmd(const QString&amp; localfile, const QString&amp; remotefile); void build_puts_cmd(const QVariantList&); void build_putree_cmd(const QString&amp; localpath, const QString&amp; remotepath, const QStringList& vExcept = {}); void build_get_buffer_cmd(const QString&amp; remotefile); void build_get_cmd(const QString&amp; remotefile, const QString&amp; localfile); void build_gets_cmd(const QVariantList&); void build_getree_cmd(const QString&amp; remotepath, const QString&amp; localpath, const QStringList& vExcept = {}); void build_rename_cmd(const QString&amp; remotefilepath, const QString&amp; newname); void build_list_cmd(const QString&amp; remotepath); void clear_cmd(); void reset_record(); void inc_record(record_type, int = 1); private slots: void slot_state_changed(int); void slot_timer_connect(); void slot_finish(int, bool); void slot_listinfo(const QUrlInfo&); void slot_inner_cmd(int cmdid, QVariantList params, QString errorstring); protected: QUrl m_url; QTimer* m_pConnect = Q_NULLPTR; QPair<QString, QString&gt; m_CurrentPath; // local/remote path // download member QList< QPair<QString, QString&gt; > m_PendingPath; // local/remote path QBuffer* m_buffer = 0; // rmdir member QList<SingleCmd> m_rmlist; // cmd member QList<SingleCmd> m_lCmd; QMap<int, SingleCmd> m_mapCmd; // list member QFtp::Command m_listcmd = QFtp::Command::None; QFtp::Command m_prevlistcmd = QFtp::Command::None; QList<QUrlInfo> m_listresult; QStringList m_PathSection = {}; QFTP_CMD m_cmd = QC_NONE; int success_count = 0, execute_count = 0, total_count = 0; QSet<QString&gt; m_vExcept; }; #endif 这是QFtpclient.h
最新发布
07-11
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值