• 8059阅读
  • 14回复

Qt学习:GridArrayQt 生成LED屏幕数组 [复制链接]

上一主题 下一主题
离线yehuohan
 

图酷模式  只看楼主 倒序阅读 楼主  发表于: 2016-04-10
— 本帖被 XChinux 执行加亮操作(2016-04-10) —

用于生成LED屏幕显示的数组,学习了一些控件的用法,了解了Qt的界面框架。




- 软件开源
- vs2013+qt5.6.0
- 自定义LED屏幕像素尺寸
- 只用于灰度LED屏幕
- 支持旋转,翻转等操作
- 鼠标中键可以拖动,滚轮缩放大小
- 可以保存成GAQ文件,方便下次接着编辑
- 可以导入图片,成生图片数组(二值化方式)
- 右键导出数组txt
- 支持文字输入
- 支持中文和英文



地址


https://github.com/yehuohan/GridArrayQt
离线liudianwu

只看该作者 1楼 发表于: 2016-04-10
很好很强大!
欢迎关注微信公众号:Qt实战/Qt入门和进阶(各种开源作品、经验整理、项目实战技巧,专注Qt/C++软件开发,视频监控、物联网、工业控制、嵌入式软件、国产化系统应用软件开发) QQ:517216493  WX:feiyangqingyun  QQ群:751439350
离线jx347638458

只看该作者 2楼 发表于: 2016-04-10
楼主我Qt5.4  windows下有很多错误
离线jx347638458

只看该作者 3楼 发表于: 2016-04-10
刘大师您编译成功了么,我的有很多错误
本帖提到的人: @liudianwu
离线yehuohan

只看该作者 4楼 发表于: 2016-04-10
回 jx347638458 的帖子
jx347638458:楼主我Qt5.4  windows下有很多错误 (2016-04-10 14:20) 

你贴下吧,我用的是vs2013+qt5.6.1_x86
离线jx347638458

只看该作者 5楼 发表于: 2016-04-11
..\GridArrayQt\GridArrayQt.cpp:618:2: warning: identifier 'nullptr' is a keyword in C++11 [-Wc++0x-compat]
  bool *gp = nullptr;
  ^
..\GridArrayQt\GridArrayQt.cpp: In member function 'void GridArrayQt::createDrawArea()':
..\GridArrayQt\GridArrayQt.cpp:84:45: warning: lambda expressions only available with -std=c++11 or -std=gnu++11
   [&](QString str){statusMsg2->setText(str);});
                                             ^
..\GridArrayQt\GridArrayQt.cpp:84:46: error: no matching function for call to 'GridArrayQt::connect(QDrawArea*&, void (QDrawArea::*)(QString&), GridArrayQt::createDrawArea()::<lambda(QString)>)'
   [&](QString str){statusMsg2->setText(str);});
                                              ^
..\GridArrayQt\GridArrayQt.cpp:84:46: note: candidates are:
In file included from C:\Qt\5.4\mingw491_32\include/QtWidgets/qwidget.h:38:0,
                 from C:\Qt\5.4\mingw491_32\include/QtWidgets/qmainwindow.h:37,
                 from C:\Qt\5.4\mingw491_32\include/QtWidgets/QMainWindow:1,
                 from ..\GridArrayQt\GridArrayQt.h:4,
                 from ..\GridArrayQt\GridArrayQt.cpp:1:
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:196:36: note: 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,
                                    ^
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:196:36: note:   candidate expects 5 arguments, 3 provided
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:199:36: note: 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,
                                    ^
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:199:36: note:   candidate expects 5 arguments, 3 provided
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:477:32: note: QMetaObject::Connection QObject::connect(const QObject*, const char*, const char*, Qt::ConnectionType) const
inline QMetaObject::Connection QObject::connect(const QObject *asender, const char *asignal,
                                ^
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:477:32: note:   no known conversion for argument 2 from 'void (QDrawArea::*)(QString&)' to 'const char*'
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:213:43: note: 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,
                                           ^
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:213:43: note:   template argument deduction/substitution failed:
..\GridArrayQt\GridArrayQt.cpp:84:46: note:   candidate expects 5 arguments, 3 provided
   [&](QString str){statusMsg2->setText(str);});
                                              ^
In file included from C:\Qt\5.4\mingw491_32\include/QtWidgets/qwidget.h:38:0,
                 from C:\Qt\5.4\mingw491_32\include/QtWidgets/qmainwindow.h:37,
                 from C:\Qt\5.4\mingw491_32\include/QtWidgets/QMainWindow:1,
                 from ..\GridArrayQt\GridArrayQt.h:4,
                 from ..\GridArrayQt\GridArrayQt.cpp:1:
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:245:13: note: template<class Func1, class Func2> static typename QtPrivate::QEnableIf<((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)
             ^
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:245:13: note:   template argument deduction/substitution failed:
..\GridArrayQt\GridArrayQt.cpp: In substitution of 'template<class Func1, class Func2> static typename QtPrivate::QEnableIf<((int)(QtPrivate::FunctionPointer<Func2>::ArgumentCount) >= 0), QMetaObject::Connection>::Type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, Func2) [with Func1 = void (QDrawArea::*)(QString&); Func2 = GridArrayQt::createDrawArea()::<lambda(QString)>]':
..\GridArrayQt\GridArrayQt.cpp:84:46:   required from here
..\GridArrayQt\GridArrayQt.cpp:84:46: error: template argument for 'template<class Func1, class Func2> static typename QtPrivate::QEnableIf<((int)(QtPrivate::FunctionPointer<Func2>::ArgumentCount) >= 0), QMetaObject::Connection>::Type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, Func2)' uses local type 'GridArrayQt::createDrawArea()::<lambda(QString)>'
   [&](QString str){statusMsg2->setText(str);});
                                              ^
..\GridArrayQt\GridArrayQt.cpp:84:46: error:   trying to instantiate 'template<class Func1, class Func2> static typename QtPrivate::QEnableIf<((int)(QtPrivate::FunctionPointer<Func2>::ArgumentCount) >= 0), QMetaObject::Connection>::Type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, Func2)'
In file included from C:\Qt\5.4\mingw491_32\include/QtWidgets/qwidget.h:38:0,
                 from C:\Qt\5.4\mingw491_32\include/QtWidgets/qmainwindow.h:37,
                 from C:\Qt\5.4\mingw491_32\include/QtWidgets/QMainWindow:1,
                 from ..\GridArrayQt\GridArrayQt.h:4,
                 from ..\GridArrayQt\GridArrayQt.cpp:1:
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:254:13: note: template<class Func1, class Func2> static typename QtPrivate::QEnableIf<(((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,
             ^
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:254:13: note:   template argument deduction/substitution failed:
..\GridArrayQt\GridArrayQt.cpp:84:46: note:   cannot convert '<lambda closure object>GridArrayQt::createDrawArea()::<lambda(QString)>{((GridArrayQt*)this)}' (type 'GridArrayQt::createDrawArea()::<lambda(QString)>') to type 'const QObject*'
   [&](QString str){statusMsg2->setText(str);});
                                              ^
In file included from C:\Qt\5.4\mingw491_32\include/QtWidgets/qwidget.h:38:0,
                 from C:\Qt\5.4\mingw491_32\include/QtWidgets/qmainwindow.h:37,
                 from C:\Qt\5.4\mingw491_32\include/QtWidgets/QMainWindow:1,
                 from ..\GridArrayQt\GridArrayQt.h:4,
                 from ..\GridArrayQt\GridArrayQt.cpp:1:
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:285:13: note: template<class Func1, class Func2> static typename QtPrivate::QEnableIf<(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)
             ^
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:285:13: note:   template argument deduction/substitution failed:
..\GridArrayQt\GridArrayQt.cpp: In substitution of 'template<class Func1, class Func2> static typename QtPrivate::QEnableIf<(QtPrivate::FunctionPointer<Func2>::ArgumentCount == (-1)), QMetaObject::Connection>::Type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, Func2) [with Func1 = void (QDrawArea::*)(QString&); Func2 = GridArrayQt::createDrawArea()::<lambda(QString)>]':
..\GridArrayQt\GridArrayQt.cpp:84:46:   required from here
..\GridArrayQt\GridArrayQt.cpp:84:46: error: template argument for 'template<class Func1, class Func2> static typename QtPrivate::QEnableIf<(QtPrivate::FunctionPointer<Func2>::ArgumentCount == (-1)), QMetaObject::Connection>::Type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, Func2)' uses local type 'GridArrayQt::createDrawArea()::<lambda(QString)>'
   [&](QString str){statusMsg2->setText(str);});
                                              ^
..\GridArrayQt\GridArrayQt.cpp:84:46: error:   trying to instantiate 'template<class Func1, class Func2> static typename QtPrivate::QEnableIf<(QtPrivate::FunctionPointer<Func2>::ArgumentCount == (-1)), QMetaObject::Connection>::Type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, Func2)'
In file included from C:\Qt\5.4\mingw491_32\include/QtWidgets/qwidget.h:38:0,
                 from C:\Qt\5.4\mingw491_32\include/QtWidgets/qmainwindow.h:37,
                 from C:\Qt\5.4\mingw491_32\include/QtWidgets/QMainWindow:1,
                 from ..\GridArrayQt\GridArrayQt.h:4,
                 from ..\GridArrayQt\GridArrayQt.cpp:1:
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:293:13: note: template<class Func1, class Func2> static typename QtPrivate::QEnableIf<(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,
             ^
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:293:13: note:   template argument deduction/substitution failed:
..\GridArrayQt\GridArrayQt.cpp:84:46: note:   cannot convert '<lambda closure object>GridArrayQt::createDrawArea()::<lambda(QString)>{((GridArrayQt*)this)}' (type 'GridArrayQt::createDrawArea()::<lambda(QString)>') to type 'const QObject*'
   [&](QString str){statusMsg2->setText(str);});
                                              ^
..\GridArrayQt\GridArrayQt.cpp: In member function 'void GridArrayQt::setupMenu()':
..\GridArrayQt\GridArrayQt.cpp:120:2: warning: lambda expressions only available with -std=c++11 or -std=gnu++11
  });
  ^
..\GridArrayQt\GridArrayQt.cpp:120:3: error: no matching function for call to 'GridArrayQt::connect(QAction*&, void (QAction::*)(bool), GridArrayQt::setupMenu()::<lambda()>)'
  });
   ^
..\GridArrayQt\GridArrayQt.cpp:120:3: note: candidates are:
In file included from C:\Qt\5.4\mingw491_32\include/QtWidgets/qwidget.h:38:0,
                 from C:\Qt\5.4\mingw491_32\include/QtWidgets/qmainwindow.h:37,
                 from C:\Qt\5.4\mingw491_32\include/QtWidgets/QMainWindow:1,
                 from ..\GridArrayQt\GridArrayQt.h:4,
                 from ..\GridArrayQt\GridArrayQt.cpp:1:
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:196:36: note: 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,
                                    ^
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:196:36: note:   candidate expects 5 arguments, 3 provided
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:199:36: note: 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,
                                    ^
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:199:36: note:   candidate expects 5 arguments, 3 provided
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:477:32: note: QMetaObject::Connection QObject::connect(const QObject*, const char*, const char*, Qt::ConnectionType) const
inline QMetaObject::Connection QObject::connect(const QObject *asender, const char *asignal,
                                ^
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:477:32: note:   no known conversion for argument 2 from 'void (QAction::*)(bool)' to 'const char*'
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:213:43: note: 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,
                                           ^
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:213:43: note:   template argument deduction/substitution failed:
..\GridArrayQt\GridArrayQt.cpp:120:3: note:   candidate expects 5 arguments, 3 provided
  });
   ^
In file included from C:\Qt\5.4\mingw491_32\include/QtWidgets/qwidget.h:38:0,
                 from C:\Qt\5.4\mingw491_32\include/QtWidgets/qmainwindow.h:37,
                 from C:\Qt\5.4\mingw491_32\include/QtWidgets/QMainWindow:1,
                 from ..\GridArrayQt\GridArrayQt.h:4,
                 from ..\GridArrayQt\GridArrayQt.cpp:1:
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:245:13: note: template<class Func1, class Func2> static typename QtPrivate::QEnableIf<((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)
             ^
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:245:13: note:   template argument deduction/substitution failed:
..\GridArrayQt\GridArrayQt.cpp: In substitution of 'template<class Func1, class Func2> static typename QtPrivate::QEnableIf<((int)(QtPrivate::FunctionPointer<Func2>::ArgumentCount) >= 0), QMetaObject::Connection>::Type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, Func2) [with Func1 = void (QAction::*)(bool); Func2 = GridArrayQt::setupMenu()::<lambda()>]':
..\GridArrayQt\GridArrayQt.cpp:120:3:   required from here
..\GridArrayQt\GridArrayQt.cpp:120:3: error: template argument for 'template<class Func1, class Func2> static typename QtPrivate::QEnableIf<((int)(QtPrivate::FunctionPointer<Func2>::ArgumentCount) >= 0), QMetaObject::Connection>::Type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, Func2)' uses local type 'GridArrayQt::setupMenu()::<lambda()>'
  });
   ^
..\GridArrayQt\GridArrayQt.cpp:120:3: error:   trying to instantiate 'template<class Func1, class Func2> static typename QtPrivate::QEnableIf<((int)(QtPrivate::FunctionPointer<Func2>::ArgumentCount) >= 0), QMetaObject::Connection>::Type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, Func2)'
In file included from C:\Qt\5.4\mingw491_32\include/QtWidgets/qwidget.h:38:0,
                 from C:\Qt\5.4\mingw491_32\include/QtWidgets/qmainwindow.h:37,
                 from C:\Qt\5.4\mingw491_32\include/QtWidgets/QMainWindow:1,
                 from ..\GridArrayQt\GridArrayQt.h:4,
                 from ..\GridArrayQt\GridArrayQt.cpp:1:
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:254:13: note: template<class Func1, class Func2> static typename QtPrivate::QEnableIf<(((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,
             ^
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:254:13: note:   template argument deduction/substitution failed:
..\GridArrayQt\GridArrayQt.cpp:120:3: note:   cannot convert '<lambda closure object>GridArrayQt::setupMenu()::<lambda()>{((GridArrayQt*)this)}' (type 'GridArrayQt::setupMenu()::<lambda()>') to type 'const QObject*'
  });
   ^
In file included from C:\Qt\5.4\mingw491_32\include/QtWidgets/qwidget.h:38:0,
                 from C:\Qt\5.4\mingw491_32\include/QtWidgets/qmainwindow.h:37,
                 from C:\Qt\5.4\mingw491_32\include/QtWidgets/QMainWindow:1,
                 from ..\GridArrayQt\GridArrayQt.h:4,
                 from ..\GridArrayQt\GridArrayQt.cpp:1:
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:285:13: note: template<class Func1, class Func2> static typename QtPrivate::QEnableIf<(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)
             ^
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:285:13: note:   template argument deduction/substitution failed:
..\GridArrayQt\GridArrayQt.cpp: In substitution of 'template<class Func1, class Func2> static typename QtPrivate::QEnableIf<(QtPrivate::FunctionPointer<Func2>::ArgumentCount == (-1)), QMetaObject::Connection>::Type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, Func2) [with Func1 = void (QAction::*)(bool); Func2 = GridArrayQt::setupMenu()::<lambda()>]':
..\GridArrayQt\GridArrayQt.cpp:120:3:   required from here
..\GridArrayQt\GridArrayQt.cpp:120:3: error: template argument for 'template<class Func1, class Func2> static typename QtPrivate::QEnableIf<(QtPrivate::FunctionPointer<Func2>::ArgumentCount == (-1)), QMetaObject::Connection>::Type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, Func2)' uses local type 'GridArrayQt::setupMenu()::<lambda()>'
  });
   ^
..\GridArrayQt\GridArrayQt.cpp:120:3: error:   trying to instantiate 'template<class Func1, class Func2> static typename QtPrivate::QEnableIf<(QtPrivate::FunctionPointer<Func2>::ArgumentCount == (-1)), QMetaObject::Connection>::Type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, Func2)'
In file included from C:\Qt\5.4\mingw491_32\include/QtWidgets/qwidget.h:38:0,
                 from C:\Qt\5.4\mingw491_32\include/QtWidgets/qmainwindow.h:37,
                 from C:\Qt\5.4\mingw491_32\include/QtWidgets/QMainWindow:1,
                 from ..\GridArrayQt\GridArrayQt.h:4,
                 from ..\GridArrayQt\GridArrayQt.cpp:1:
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:293:13: note: template<class Func1, class Func2> static typename QtPrivate::QEnableIf<(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,
             ^
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:293:13: note:   template argument deduction/substitution failed:
..\GridArrayQt\GridArrayQt.cpp:120:3: note:   cannot convert '<lambda closure object>GridArrayQt::setupMenu()::<lambda()>{((GridArrayQt*)this)}' (type 'GridArrayQt::setupMenu()::<lambda()>') to type 'const QObject*'
  });
   ^
..\GridArrayQt\GridArrayQt.cpp:129:2: warning: lambda expressions only available with -std=c++11 or -std=gnu++11
  });
  ^
..\GridArrayQt\GridArrayQt.cpp:129:3: error: no matching function for call to 'GridArrayQt::connect(QAction*&, void (QAction::*)(bool), GridArrayQt::setupMenu()::<lambda()>)'
  });
   ^
..\GridArrayQt\GridArrayQt.cpp:129:3: note: candidates are:
In file included from C:\Qt\5.4\mingw491_32\include/QtWidgets/qwidget.h:38:0,
                 from C:\Qt\5.4\mingw491_32\include/QtWidgets/qmainwindow.h:37,
                 from C:\Qt\5.4\mingw491_32\include/QtWidgets/QMainWindow:1,
                 from ..\GridArrayQt\GridArrayQt.h:4,
                 from ..\GridArrayQt\GridArrayQt.cpp:1:
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:196:36: note: 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,
                                    ^
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:196:36: note:   candidate expects 5 arguments, 3 provided
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:199:36: note: 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,
                                    ^
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:199:36: note:   candidate expects 5 arguments, 3 provided
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:477:32: note: QMetaObject::Connection QObject::connect(const QObject*, const char*, const char*, Qt::ConnectionType) const
inline QMetaObject::Connection QObject::connect(const QObject *asender, const char *asignal,
                                ^
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:477:32: note:   no known conversion for argument 2 from 'void (QAction::*)(bool)' to 'const char*'
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:213:43: note: 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,
                                           ^
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:213:43: note:   template argument deduction/substitution failed:
..\GridArrayQt\GridArrayQt.cpp:129:3: note:   candidate expects 5 arguments, 3 provided
  });
   ^
In file included from C:\Qt\5.4\mingw491_32\include/QtWidgets/qwidget.h:38:0,
                 from C:\Qt\5.4\mingw491_32\include/QtWidgets/qmainwindow.h:37,
                 from C:\Qt\5.4\mingw491_32\include/QtWidgets/QMainWindow:1,
                 from ..\GridArrayQt\GridArrayQt.h:4,
                 from ..\GridArrayQt\GridArrayQt.cpp:1:
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:245:13: note: template<class Func1, class Func2> static typename QtPrivate::QEnableIf<((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)
             ^
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:245:13: note:   template argument deduction/substitution failed:
..\GridArrayQt\GridArrayQt.cpp: In substitution of 'template<class Func1, class Func2> static typename QtPrivate::QEnableIf<((int)(QtPrivate::FunctionPointer<Func2>::ArgumentCount) >= 0), QMetaObject::Connection>::Type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, Func2) [with Func1 = void (QAction::*)(bool); Func2 = GridArrayQt::setupMenu()::<lambda()>]':
..\GridArrayQt\GridArrayQt.cpp:129:3:   required from here
..\GridArrayQt\GridArrayQt.cpp:129:3: error: template argument for 'template<class Func1, class Func2> static typename QtPrivate::QEnableIf<((int)(QtPrivate::FunctionPointer<Func2>::ArgumentCount) >= 0), QMetaObject::Connection>::Type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, Func2)' uses local type 'GridArrayQt::setupMenu()::<lambda()>'
  });
   ^
..\GridArrayQt\GridArrayQt.cpp:129:3: error:   trying to instantiate 'template<class Func1, class Func2> static typename QtPrivate::QEnableIf<((int)(QtPrivate::FunctionPointer<Func2>::ArgumentCount) >= 0), QMetaObject::Connection>::Type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, Func2)'
In file included from C:\Qt\5.4\mingw491_32\include/QtWidgets/qwidget.h:38:0,
                 from C:\Qt\5.4\mingw491_32\include/QtWidgets/qmainwindow.h:37,
                 from C:\Qt\5.4\mingw491_32\include/QtWidgets/QMainWindow:1,
                 from ..\GridArrayQt\GridArrayQt.h:4,
                 from ..\GridArrayQt\GridArrayQt.cpp:1:
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:254:13: note: template<class Func1, class Func2> static typename QtPrivate::QEnableIf<(((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,
             ^
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:254:13: note:   template argument deduction/substitution failed:
..\GridArrayQt\GridArrayQt.cpp:129:3: note:   cannot convert '<lambda closure object>GridArrayQt::setupMenu()::<lambda()>{((GridArrayQt*)this)}' (type 'GridArrayQt::setupMenu()::<lambda()>') to type 'const QObject*'
  });
   ^
In file included from C:\Qt\5.4\mingw491_32\include/QtWidgets/qwidget.h:38:0,
                 from C:\Qt\5.4\mingw491_32\include/QtWidgets/qmainwindow.h:37,
                 from C:\Qt\5.4\mingw491_32\include/QtWidgets/QMainWindow:1,
                 from ..\GridArrayQt\GridArrayQt.h:4,
                 from ..\GridArrayQt\GridArrayQt.cpp:1:
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:285:13: note: template<class Func1, class Func2> static typename QtPrivate::QEnableIf<(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)
             ^
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:285:13: note:   template argument deduction/substitution failed:
..\GridArrayQt\GridArrayQt.cpp: In substitution of 'template<class Func1, class Func2> static typename QtPrivate::QEnableIf<(QtPrivate::FunctionPointer<Func2>::ArgumentCount == (-1)), QMetaObject::Connection>::Type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, Func2) [with Func1 = void (QAction::*)(bool); Func2 = GridArrayQt::setupMenu()::<lambda()>]':
..\GridArrayQt\GridArrayQt.cpp:129:3:   required from here
..\GridArrayQt\GridArrayQt.cpp:129:3: error: template argument for 'template<class Func1, class Func2> static typename QtPrivate::QEnableIf<(QtPrivate::FunctionPointer<Func2>::ArgumentCount == (-1)), QMetaObject::Connection>::Type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, Func2)' uses local type 'GridArrayQt::setupMenu()::<lambda()>'
  });
   ^
..\GridArrayQt\GridArrayQt.cpp:129:3: error:   trying to instantiate 'template<class Func1, class Func2> static typename QtPrivate::QEnableIf<(QtPrivate::FunctionPointer<Func2>::ArgumentCount == (-1)), QMetaObject::Connection>::Type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, Func2)'
In file included from C:\Qt\5.4\mingw491_32\include/QtWidgets/qwidget.h:38:0,
                 from C:\Qt\5.4\mingw491_32\include/QtWidgets/qmainwindow.h:37,
                 from C:\Qt\5.4\mingw491_32\include/QtWidgets/QMainWindow:1,
                 from ..\GridArrayQt\GridArrayQt.h:4,
                 from ..\GridArrayQt\GridArrayQt.cpp:1:
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:293:13: note: template<class Func1, class Func2> static typename QtPrivate::QEnableIf<(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,
             ^
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:293:13: note:   template argument deduction/substitution failed:
..\GridArrayQt\GridArrayQt.cpp:129:3: note:   cannot convert '<lambda closure object>GridArrayQt::setupMenu()::<lambda()>{((GridArrayQt*)this)}' (type 'GridArrayQt::setupMenu()::<lambda()>') to type 'const QObject*'
  });
   ^
..\GridArrayQt\GridArrayQt.cpp:155:91: warning: lambda expressions only available with -std=c++11 or -std=gnu++11
  connect(qEdit_Clear,&QAction::triggered,[=]{pDrawArea->clearGrid();pDrawArea->drawGrid();});
                                                                                           ^
..\GridArrayQt\GridArrayQt.cpp:155:92: error: no matching function for call to 'GridArrayQt::connect(QAction*&, void (QAction::*)(bool), GridArrayQt::setupMenu()::<lambda()>)'
  connect(qEdit_Clear,&QAction::triggered,[=]{pDrawArea->clearGrid();pDrawArea->drawGrid();});
                                                                                            ^
..\GridArrayQt\GridArrayQt.cpp:155:92: note: candidates are:
In file included from C:\Qt\5.4\mingw491_32\include/QtWidgets/qwidget.h:38:0,
                 from C:\Qt\5.4\mingw491_32\include/QtWidgets/qmainwindow.h:37,
                 from C:\Qt\5.4\mingw491_32\include/QtWidgets/QMainWindow:1,
                 from ..\GridArrayQt\GridArrayQt.h:4,
                 from ..\GridArrayQt\GridArrayQt.cpp:1:
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:196:36: note: 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,
                                    ^
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:196:36: note:   candidate expects 5 arguments, 3 provided
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:199:36: note: 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,
                                    ^
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:199:36: note:   candidate expects 5 arguments, 3 provided
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:477:32: note: QMetaObject::Connection QObject::connect(const QObject*, const char*, const char*, Qt::ConnectionType) const
inline QMetaObject::Connection QObject::connect(const QObject *asender, const char *asignal,
                                ^
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:477:32: note:   no known conversion for argument 2 from 'void (QAction::*)(bool)' to 'const char*'
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:213:43: note: 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,
                                           ^
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:213:43: note:   template argument deduction/substitution failed:
..\GridArrayQt\GridArrayQt.cpp:155:92: note:   candidate expects 5 arguments, 3 provided
  connect(qEdit_Clear,&QAction::triggered,[=]{pDrawArea->clearGrid();pDrawArea->drawGrid();});
                                                                                            ^
In file included from C:\Qt\5.4\mingw491_32\include/QtWidgets/qwidget.h:38:0,
                 from C:\Qt\5.4\mingw491_32\include/QtWidgets/qmainwindow.h:37,
                 from C:\Qt\5.4\mingw491_32\include/QtWidgets/QMainWindow:1,
                 from ..\GridArrayQt\GridArrayQt.h:4,
                 from ..\GridArrayQt\GridArrayQt.cpp:1:
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:245:13: note: template<class Func1, class Func2> static typename QtPrivate::QEnableIf<((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)
             ^
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:245:13: note:   template argument deduction/substitution failed:
..\GridArrayQt\GridArrayQt.cpp: In substitution of 'template<class Func1, class Func2> static typename QtPrivate::QEnableIf<((int)(QtPrivate::FunctionPointer<Func2>::ArgumentCount) >= 0), QMetaObject::Connection>::Type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, Func2) [with Func1 = void (QAction::*)(bool); Func2 = GridArrayQt::setupMenu()::<lambda()>]':
..\GridArrayQt\GridArrayQt.cpp:155:92:   required from here
..\GridArrayQt\GridArrayQt.cpp:155:92: error: template argument for 'template<class Func1, class Func2> static typename QtPrivate::QEnableIf<((int)(QtPrivate::FunctionPointer<Func2>::ArgumentCount) >= 0), QMetaObject::Connection>::Type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, Func2)' uses local type 'GridArrayQt::setupMenu()::<lambda()>'
  connect(qEdit_Clear,&QAction::triggered,[=]{pDrawArea->clearGrid();pDrawArea->drawGrid();});
                                                                                            ^
..\GridArrayQt\GridArrayQt.cpp:155:92: error:   trying to instantiate 'template<class Func1, class Func2> static typename QtPrivate::QEnableIf<((int)(QtPrivate::FunctionPointer<Func2>::ArgumentCount) >= 0), QMetaObject::Connection>::Type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, Func2)'
In file included from C:\Qt\5.4\mingw491_32\include/QtWidgets/qwidget.h:38:0,
                 from C:\Qt\5.4\mingw491_32\include/QtWidgets/qmainwindow.h:37,
                 from C:\Qt\5.4\mingw491_32\include/QtWidgets/QMainWindow:1,
                 from ..\GridArrayQt\GridArrayQt.h:4,
                 from ..\GridArrayQt\GridArrayQt.cpp:1:
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:254:13: note: template<class Func1, class Func2> static typename QtPrivate::QEnableIf<(((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,
             ^
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:254:13: note:   template argument deduction/substitution failed:
..\GridArrayQt\GridArrayQt.cpp:155:92: note:   cannot convert '<lambda closure object>GridArrayQt::setupMenu()::<lambda()>{((GridArrayQt*)this)}' (type 'GridArrayQt::setupMenu()::<lambda()>') to type 'const QObject*'
  connect(qEdit_Clear,&QAction::triggered,[=]{pDrawArea->clearGrid();pDrawArea->drawGrid();});
                                                                                            ^
In file included from C:\Qt\5.4\mingw491_32\include/QtWidgets/qwidget.h:38:0,
                 from C:\Qt\5.4\mingw491_32\include/QtWidgets/qmainwindow.h:37,
                 from C:\Qt\5.4\mingw491_32\include/QtWidgets/QMainWindow:1,
                 from ..\GridArrayQt\GridArrayQt.h:4,
                 from ..\GridArrayQt\GridArrayQt.cpp:1:
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:285:13: note: template<class Func1, class Func2> static typename QtPrivate::QEnableIf<(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)
             ^
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:285:13: note:   template argument deduction/substitution failed:
..\GridArrayQt\GridArrayQt.cpp: In substitution of 'template<class Func1, class Func2> static typename QtPrivate::QEnableIf<(QtPrivate::FunctionPointer<Func2>::ArgumentCount == (-1)), QMetaObject::Connection>::Type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, Func2) [with Func1 = void (QAction::*)(bool); Func2 = GridArrayQt::setupMenu()::<lambda()>]':
..\GridArrayQt\GridArrayQt.cpp:155:92:   required from here
..\GridArrayQt\GridArrayQt.cpp:155:92: error: template argument for 'template<class Func1, class Func2> static typename QtPrivate::QEnableIf<(QtPrivate::FunctionPointer<Func2>::ArgumentCount == (-1)), QMetaObject::Connection>::Type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, Func2)' uses local type 'GridArrayQt::setupMenu()::<lambda()>'
  connect(qEdit_Clear,&QAction::triggered,[=]{pDrawArea->clearGrid();pDrawArea->drawGrid();});
                                                                                            ^
..\GridArrayQt\GridArrayQt.cpp:155:92: error:   trying to instantiate 'template<class Func1, class Func2> static typename QtPrivate::QEnableIf<(QtPrivate::FunctionPointer<Func2>::ArgumentCount == (-1)), QMetaObject::Connection>::Type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, Func2)'
In file included from C:\Qt\5.4\mingw491_32\include/QtWidgets/qwidget.h:38:0,
                 from C:\Qt\5.4\mingw491_32\include/QtWidgets/qmainwindow.h:37,
                 from C:\Qt\5.4\mingw491_32\include/QtWidgets/QMainWindow:1,
                 from ..\GridArrayQt\GridArrayQt.h:4,
                 from ..\GridArrayQt\GridArrayQt.cpp:1:
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:293:13: note: template<class Func1, class Func2> static typename QtPrivate::QEnableIf<(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,
             ^
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:293:13: note:   template argument deduction/substitution failed:
..\GridArrayQt\GridArrayQt.cpp:155:92: note:   cannot convert '<lambda closure object>GridArrayQt::setupMenu()::<lambda()>{((GridArrayQt*)this)}' (type 'GridArrayQt::setupMenu()::<lambda()>') to type 'const QObject*'
  connect(qEdit_Clear,&QAction::triggered,[=]{pDrawArea->clearGrid();pDrawArea->drawGrid();});
                                                                                            ^
..\GridArrayQt\GridArrayQt.cpp:156:71: warning: lambda expressions only available with -std=c++11 or -std=gnu++11
  connect(qEdit_ZoomIn,&QAction::triggered,[=]{pDrawArea->zoomInGrid();});
                                                                       ^
..\GridArrayQt\GridArrayQt.cpp:156:72: error: no matching function for call to 'GridArrayQt::connect(QAction*&, void (QAction::*)(bool), GridArrayQt::setupMenu()::<lambda()>)'
  connect(qEdit_ZoomIn,&QAction::triggered,[=]{pDrawArea->zoomInGrid();});
                                                                        ^
..\GridArrayQt\GridArrayQt.cpp:156:72: note: candidates are:
In file included from C:\Qt\5.4\mingw491_32\include/QtWidgets/qwidget.h:38:0,
                 from C:\Qt\5.4\mingw491_32\include/QtWidgets/qmainwindow.h:37,
                 from C:\Qt\5.4\mingw491_32\include/QtWidgets/QMainWindow:1,
                 from ..\GridArrayQt\GridArrayQt.h:4,
                 from ..\GridArrayQt\GridArrayQt.cpp:1:
C:\Qt\5.4\mingw491_32\include/QtCore/qobject.h:196:36: note: 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,
                                    ^
本帖提到的人: @yehuohan
离线yehuohan

只看该作者 6楼 发表于: 2016-04-11
回 jx347638458 的帖子
jx347638458:..\GridArrayQt\GridArrayQt.cpp:618:2: warning: identifier 'nullptr' is a keyword in C++11 [-Wc++0x-compat]
  bool *gp = nullptr;
  ^
..\GridArrayQt\GridArrayQt.cpp: In member function 'void GridArrayQt::createDrawArea()':
.. .. (2016-04-11 08:41) 

vs2013支持c++11,程序里面的nullptr  lamda表达式这些都要c++才行,你的mingw 的时候要加一个参数,-std=c++11
离线yehuohan

只看该作者 7楼 发表于: 2016-04-11
回 jx347638458 的帖子
jx347638458:..\GridArrayQt\GridArrayQt.cpp:618:2: warning: identifier 'nullptr' is a keyword in C++11 [-Wc++0x-compat]
  bool *gp = nullptr;
  ^
..\GridArrayQt\GridArrayQt.cpp: In member function 'void GridArrayQt::createDrawArea()':
.. .. (2016-04-11 08:41) 

你用的qtcreator打开的??
离线realfan

只看该作者 8楼 发表于: 2016-04-11
回 jx347638458 的帖子
jx347638458:刘大师您编译成功了么,我的有很多错误 (2016-04-10 14:27) 

稍做修改,就可以了。如果用QtCreator打开,需要在pro中加CONFIG += c++11
要把qtextctrl.h qtextctrl.cpp两个文件加到工程中,加到GridArrayQt.pri文件中也可以
HEADERS += ./GridArrayQt.h \
    ./QDrawArea.h \
    ./common.h \
    ./qtextctrl.h

SOURCES += ./QDrawArea.cpp \
    ./GridArrayQt.cpp \
    ./main.cpp \
    ./qtextctrl.cpp

QDrawArea类的setPointCursor改成如下形式
void setPointCursor(const QPointCursor & pc, const QCursor &c)
QTextCtrl类的第二个构造函数改成
QTextCtrl(const QRect &rect, QWidget *parent = 0)
应该就可以了。
如果有必要,所有代码文件编码改成UTF8
离线yehuohan

只看该作者 9楼 发表于: 2016-04-11
回 realfan 的帖子
realfan:稍做修改,就可以了。如果用QtCreator打开,需要在pro中加CONFIG += c++11
要把qtextctrl.h qtextctrl.cpp两个文件加到工程中,加到GridArrayQt.pri文件中也可以
HEADERS += ./GridArrayQt.h \
    ./QDrawArea.h \
....... (2016-04-11 09:40) 

win下我用vs+qt的qtcreator没试过
离线jx347638458

只看该作者 10楼 发表于: 2016-04-11
大神讲的太详细了,感谢感谢
本帖提到的人: @realfan
离线jx347638458

只看该作者 11楼 发表于: 2016-04-11
回 yehuohan 的帖子
yehuohan:你用的qtcreator打开的?? (2016-04-11 09:22) 

嗯嗯,解决了,感谢作者分享,
离线xzp21st

只看该作者 12楼 发表于: 2016-04-11
不错的作品 谢谢分享~~~
离线liuhao1314

只看该作者 13楼 发表于: 2019-03-01
楼主  您好  请问怎么下载项目呢  原楼的链接过期了。谢谢大佬。
离线hp_201111

只看该作者 14楼 发表于: 2019-03-03
回 liuhao1314 的帖子
liuhao1314:楼主  您好  请问怎么下载项目呢  原楼的链接过期了。谢谢大佬。 (2019-03-01 15:33) 

搜  GridArrayQt

找到一个
https://github.com/niniba/GridArrayQt
快速回复
限100 字节
 
上一个 下一个