I spent the weekend trying to figure it out, and I'm in the last step. My goal: get visual studio 2010 and Qt 4.7.3 to work together.
I installed Qt from the source, specifying the following configuration for the assembly:
configure.exe -debug-and-release -opensource -platform win32-msvc2010 -no-webkit -no-phonon -no-phonon-backend -no- script -no-scripttools -no-qt3support -no- multimedia -no-ltcg
After setup, I started nmake, no problem.
In my visual studio 2010 solution, I have two projects.
He complains that he cannot link the Qt libraries. In general properties
AssetIO Qt IDE, Qt visual studio . AssetIO . Short :
"", . AssetIO . , V++ Directories, Include:
, :
, , include AssetIO:
C:\qt_source\4.7.3\
AssetIO:
C:\qt_source\4.7.3\Bin
, ( )
main.cpp
int main(int argc, char* argv[])
{
AssetIO::LevelLoader a;
a.dostuff();
return 0;
}
LevelLoader.h
#ifndef LEVELLOADER_HPP
#define LEVELLOADER_HPP
namespace AssetIO
{
class LevelLoader {
public:
explicit LevelLoader();
~LevelLoader();
void dostuff();
};
}
#endif
LevelLoader.cpp
#include "LevelLoader.hpp"
#include <QDomDocument>
#include <QFile>
#include <QDebug>
#include <QString>
using namespace AssetIO;
enum ComponentType { Drawable = 0, Position };
ComponentType ConvertToComponentType(QString tagName)
{
if(tagName.toLower() == "Drawable") {
return Drawable;
}
else if(tagName.toLower() == "Position") {
return Position;
}
else {
exit(EXIT_FAILURE);
}
}
LevelLoader::LevelLoader()
{
}
LevelLoader::~LevelLoader()
{
}
void LevelLoader::dostuff()
{
QDomDocument doc("la");
QFile file("../../../Resources/input.sto");
if(!file.open(QIODevice::ReadOnly)) {
exit(EXIT_FAILURE);
}
if( !doc.setContent(&file)) {
file.close();
}
file.close();
QDomElement root = doc.documentElement();
if(root.tagName() != "Root") {
exit(EXIT_FAILURE);
}
QDomNode headerNode = root.firstChild();
QDomElement e = headerNode.toElement();
if(e.tagName().toLower() != "HeaderInfo") {
}
QDomNodeList componentNode = headerNode.childNodes();
int s = componentNode.count();
QString componentTag(componentNode.at(0).toElement().tagName());
QDomNamedNodeMap a = componentNode.at(0).attributes();
}
, . - ? .