Hi all,
newbie question after two years of honored Qt development
One sunny day I decided to kill myself trying to make up console applications...the beginning of the end.
I searched around for several hours, no examples, no a-b-c docs... I can't make a stupid hello world console application.
// main.cpp
#include <QtCore>
#include "backdoor.h"
int main(int argc, char *argv[])
{
Backdoor bd;
bd.spit("Hello world!");
return a.exec();
}
// main.cpp
#include <QtCore>
#include "backdoor.h"
int main(int argc, char *argv[])
{
QCoreApplication a(argc,argv);
Backdoor bd;
bd.spit("Hello world!");
return a.exec();
}
To copy to clipboard, switch view to plain text mode
// backdoor.h
#include <QtCore>
{
private:
public:
Backdoor();
};
// backdoor.h
#include <QtCore>
class Backdoor : public QObject
{
private:
QTextStream out;
public:
Backdoor();
void spit(QString str);
};
To copy to clipboard, switch view to plain text mode
// backdoor.cpp
#include "backdoor.h"
Backdoor::Backdoor()
:out(stdout)
{
}
{
out << str;
}
// backdoor.cpp
#include "backdoor.h"
Backdoor::Backdoor()
:out(stdout)
{
}
void Backdoor::spit(QString str)
{
out << str;
}
To copy to clipboard, switch view to plain text mode
this code looks trivial, a stupid output, but I've not been able to make it run properly (no output!)...
1_ what's wrong with QTextStream? What did I forget?
2_ what is the basis concept to make console application? (an example of usage with an object and, possibly, an event to initiate me would be very very very apprecciated)
120 Experience Points to who'll answer good!
Thanks in advance
Bookmarks