Here's what I found on my Qt-4.2.2 installation (you may have to poke around to find things on your system):
Start in the qt "include" directory.On my system, is it at /usr/local/Trolltech/Qt-4.2.2/include I'm guessing that on your system this may be /usr/include/qt4, according to the "-I..." stuff that you are seeing. On my system there is a Qt sub-directory and there's where i see "qapplication.h". (You can go to /usr/include and run "find . -name qtapplication.h") When I look for the text "setMainWidget" in that qtapplication.h, I see: CPP / C++ / C Code:
So, it's telling us that something changed between Qt3 and Qt4. For an immediate fix, you can define QT3_SUPPORT: CPP / C++ / C Code:
Now, try make again (no need to run qmake unless you want to). Next step: investigate what the heck they did. Go to the trolltech web site and look at the documentation for qapplication in qt4.2. http://doc./4.2/qapplication.html Here's the scoop: Huh? It indicates that there is a setMainWidget in QApplication, and no indication that it was removed. (This is the Qt-4.2 documentation, right?) However --- it does say that "you need not have a main widget". So, just delete the setMainWidget line in your program, and remove the QT3_SUPPORT definition while you are at it: CPP / C++ / C Code:
Now start all over and see what you get. For me, it worked. Your Mileage May Vary. Lesson learned: When you get an example program, even from a reputable source, if it doesn't work for you, then you might discover that later revisions in the tools make earlier examples non-functional. Where was the example file that you got? Lesson learned: Programming, like life, is an adventure. For some people the trip is more important than the destination. For others, we just want to get the job done. It's still an adventure. In my installation, in /usr/local/Trolltech/Qt-4.2.2 there is a subdirectory of "examples" that has a lot of subdirectories with source files that work with Qt-4.2.2 (Copy them to some place where you can use them; in their original place you probably don't have write privileges anyhow.) Regards, Dave Footnote: "It's not a problem; it's an opportunity!" --- My old pal Jorge Rivera "I like opportunities as much as the next guy. It's just that on Saturday afternoons I would rather define my own adventures rather than working on other people's opportunities (like the boss's deadline)." ---davekw7x
|
|