do the following:
1. Read the docs
2. I feel your constructors are not in the correct form:
QFont ( const QString & family,
int pointSize
= -1,
int weight
= -1,
bool italic
= false )
QFont ()
QFont ( const QString & family, int pointSize = -1, int weight = -1, bool italic = false )
QFont ( const QFont & font, QPaintDevice * pd )
QFont ( const QFont & font )
To copy to clipboard, switch view to plain text mode
These are from my qt4 doc...i don't think this has changed since qt3...but you can confirm
3. Read a Qt book...whenever you create a QApplication obj, you also need to call show and exec functions:
//include files
int main(int argc, char *argv[])
{
// your code...
app.show() //actually shows the app window on screen!
return app.exec(); //you don't return 0, when using Qt!!
}
//include files
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
// your code...
app.show() //actually shows the app window on screen!
return app.exec(); //you don't return 0, when using Qt!!
}
To copy to clipboard, switch view to plain text mode
4. you are creating font etc objs on the stack....thus you need to pass them by reference to the constructors above and not by value.
5. You "seldom" need to use C++ in its true form with Qt...eg when you wish to use "cout" etc...try understanding qt and recoding ur prog...
6. If there is no harm upgrade to qt4! please
7. enclose your code in [ code] [ / code] blocks
8. comment your code!!
Bookmarks