使用對象我有聲明的函數爲:如何申報使用此功能
bool getIndex(const QString itemUid, QModelIndex& index /*out*/);
我怎麼申報對象中傳遞的指數?
我曾嘗試:
QModelIndex *modelIndex;
getIndex(auid, modelIndex );
有和沒有 「*」,但我得到的編譯錯誤。
的編譯錯誤是:
用於調用的TreeModel :: getIndex不匹配功能(QString的,QModelIndex * &)
[C++:參數傳遞「參考傳遞」]的可能重複(http://stackoverflow.com/questions/19827119/c-argument-passing-passed-by-reference) – NathanOliver
'QModeIndex modeIndex;' – 101010
什麼是你的編譯錯誤? – Steephen