qml常见问题及其解决

\main.cpp:23: error: invalid use of incomplete type 'class QDeclarativeEngine'
     QDeclarativeContext *context=engine->rootContext();


.........................................................


\qmetatype.h:1708: error: redefinition of 'struct QMetaTypeId<QList<QObject*> >'
     struct QMetaTypeId< TYPE >                                          \
            ^
.........................................................


QtQml\qqmlcontext.h:106: in expansion of macro 'Q_DECLARE_METATYPE'
 Q_DECLARE_METATYPE(QList<QObject*>)
 ^
.........................................................


main\main.cpp:63: error: 'qInstallMsgHandler' was not declared in this scope
     qInstallMsgHandler(myMessageOutput);
#include <qdeclarative.h>


.........................................................


/mnt/nfs # ./lead -qws
./zq_lead: error while loading shared libraries: libQtXmlPatterns.so.4: cannot open shared object file: No such file or directory


/mnt/nfs # ls
libQtXmlPatterns.la        libQtXmlPatterns.so.4  
libQtXmlPatterns.prl       libQtXmlPatterns.so.4.8
libQtXmlPatterns.so        libQtXmlPatterns.so.4.8.4


.........................................................


/mnt/nfs # ./lead -qws
sh: /opt/app//initSettings.sh: not found
init ini file....... 
sh: /opt/app//initSettings.sh: not found
Segmentation fault


.........................................................




 QML Rectangle: Cannot anchor to an item that isn't a parennce to `vtable for CommonData'


.........................................................
common/commondata.h:19: 错误:undefined reference to `vtable for CommonData'


.........................................................


/storage/main.cpp:18: 错误:aggregate 'CommonData cCommonData' has incomplete type and cannot be defined




    property variant focusStateArray: [1, 0, 0, 0, 0, 0]


    function getBtnFocusState(index){
        focusStateArray = [1, 1, 1, 1, 1, 1];
        return focusStateArray[index];
    }


    function setBtnFocusState(index, value){
        var arr = focusStateArray;
        arr[index] = value;
        focusStateArray = arr;
        console.log("focusStateArray...", focusStateArray[index]);
    }


.........................................................


/code/menu/netSetting.cpp:161: 错误:cannot call member function 'void CNetSetting::getState(int)' without object【修复】


static int function(){
//静态回调函数里面不能使用直接使用Qt信号,即使在Qt类进行的声明和实现;
要发送信号,使用单例函数+信号方可发送。



.........................................................


/dataSwitching/dataSwitching.cpp:183: 警告:deprecated conversion from string constant to 'char*'【修复】


不能直接将char arr[] 参数填入有char *的参数,需要强转。


.........................................................


Error:
# QPixmap: It is not safe to use pixmaps outside the GUI thread
QCoreApplication::sendPostedEvents: Cannot send posted events for objects in another thread
QPixmap: It is not safe to use pixmaps outside the GUI thread
ping: bad address 'www.baidu.com'
ping: bad address 'www.baidu.com'【修复】


ui里面直接调用第三方库,库中存在ping等待命令调用,并存在跳转函数时,会使ui先卡顿,然后挂死。



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值