我用C++開發了一款遊戲,並且希望確保一切都正確完成。 使用QHashIterator來檢查列表中的哪個項目具有最低值(用於尋路的F-成本)是否是一個很好的解決方案。 從我的代碼 段: while(!pathFound){ //do while path is found
QHashIterator<int, PathFinding*> iterator(openList);
我有一個QHash和一個單獨的QMap。我可以單獨序列化它們。但我想他們serilize在單個文件: QMap<int,QString> myMap;
QHash<QString,MyCalss> myHash;
// .. fill: both have 4 (key,value) pairs.
// write here
QDataStream out (&myFile);
out<
我想創建一個QSet<Tag>,我想在程序中使用它。 Tag是我的自定義類。 當我建立我的代碼獲得關於qHash超載gcc的錯誤: Exercise.cpp.o
In file included from /opt/Qt/5.5/gcc_64/include/QtCore/qglobal.h:74:0,
from /opt/Qt/5.5/gcc_64/include/QtCore