QtRoot problems

Please, find the final version of your project.
To build your project I have to create the Qt project file as follows:[code]######################################################################

Automatically generated by qmake (1.07a) Wed Jan 16 16:39:25 2008

######################################################################

TEMPLATE = app
INCLUDEPATH += . $(ROOTSYS)/include
TARGET = proj_0

Input

HEADERS += proj_0.h proj_0widget.h
INTERFACES += proj_0widgetbase.ui
SOURCES += main.cpp proj_0.cpp proj_0widget.cpp

LIBS += $$system({ROOTSYS}/bin/root-config --glibs) LIBS += -lGQt[/code]I added 3 lines to the automatically created project file. The project file doesn't use any *.pri files. These lines should answer all your questions (I hope) Sorry, I have no KDevelop and have no intention to learn it, because it is available on Unix platforms only (assuming Cygwin is the Unix platform too).[code] . . . INCLUDEPATH += . (ROOTSYS)/include
. . .
. . .
LIBS += $$system(${ROOTSYS}/bin/root-config --glibs)
LIBS += -lGQt[/code] The entire Qt project directory looks like this. There is no hidden directory.

[rcas6003] ~/scratch/tmp/> tar -tzvf proj0.tar.gz drwxr-xr-x fine/rhstar 0 2008-01-16 18:34:17 src/ -rw-r--r-- fine/rhstar 1033 2008-01-16 16:11:58 src/hi16-app-proj_0.png -rw-r--r-- fine/rhstar 2749 2008-01-16 16:11:58 src/hi32-app-proj_0.png -rw-r--r-- fine/rhstar 1961 2008-01-16 16:30:28 src/main.cpp -rw-r--r-- fine/rhstar 1503 2008-01-16 17:09:02 src/proj_0.cpp -rw-r--r-- fine/rhstar 557 2008-01-16 16:32:25 src/proj_0.h -rw-r--r-- fine/rhstar 2824 2008-01-16 18:27:52 src/proj_0widget.cpp -rw-r--r-- fine/rhstar 492 2008-01-16 17:08:38 src/src.pro -rw-r--r-- fine/rhstar 563 2008-01-16 16:44:34 src/proj_0widget.h -rw-r--r-- fine/rhstar 7459 2008-01-16 18:25:23 src/proj_0widgetbase.ui drwxr-xr-x fine/rhstar 0 2008-01-16 18:29:59 src/settings/ -rw-r--r-- fine/rhstar 1737 2008-01-16 18:29:59 src/settings/addressParameters.dat
I have to create “settings/addressParameters.dat” to test the “tab1” of your project (See attachment). Let me know if I have missed anything.
proj0_3.tar.gz (9.09 KB)


Wow :astonished: Thanks for all the work Valeri!

Unfortunately, when I do the qmake; make sequence, I am getting the same errors as before from make ( error: forward declaration of `struct TQtWidget’).

Those three lines you put in the .pro file, these are things I have configured into kdevelop since the beginning, it is adding the lib and include paths, invoking root-config --glibs (this is verifiable from looking at the make output), and I even tried -lGQt (I found a reference to it in some file somewhere in your historam example, don’t remember which, I thought it might be the key lib for this). None of this solved the problem. And now, I still get it with your code, which worked for you.

Also, uic is always putting

into proj_0widgetbase.cpp. Of course, there exists no file “tqtwidget.h”. I can put an empty text file with that name in the src directory (of course this is a hack not a solution). Then I get the forward declaration error.

So, I need to research what parameters uic is looking at and what it does precisely. And also, what would produce a forward declaration error (in general). I have never used forward declarations before, I don’t know what kind of dependancies they have. Perhaps this problem is a result of a broken installation of something, or weird settings in a config file somewhere. I know this: Your histogram example compiles and runs for me, and my code that you modified and posted compiles and runs for you. There is a difference in our systems that produces errors for me and not for you.

I apologize for the large file I uploaded (yes, I did think about it before I uploaded). I included the whole kdevelop project, as I didn’t know you don’t ever use it. It seems like an IDE always produces lots of overhead, a disadvantage to that way of doing things.

[quote=“mrogers”]. . .Unfortunately, when I do the qmake; make sequence, I am getting the same errors as before from make ( error: forward declaration of `struct TQtWidget’).[/quote]As a matter of the fact, your project does work :exclamation: for me and I can not reproduce your trouble.[quote=“mrogers”] . . . Also, uic is always putting

into proj_0widgetbase.cpp. Of course, there exists no file “tqtwidget.h”. I can put an empty text file [/quote] :open_mouth: [quote=“mrogers”]with that name in the src directory (of course this is a hack not a solution). Then I get the forward declaration error.
.[/quote] Sure :bulb: This is where :bulb: your problem came from. You did not tell me about such CUSTOM step. This is an apparent uic bug. You did not fix things you made it worse. You did provide the EMPTY header file to describe the real TQtWidget class, did not you?
Can you grep the generated code for #include “tqtwidget.h”? Can you try that ? What you really had to do is to replace the wrong header file name “tqtwidget.h” with the real one, namely, “TQtWidget.h”

[quote=“mrogers”]I It seems to have updated Qt to version 3.3.7 in the process?[/quote] This is where your problem came from!!! This Qt “uic” bug was introduced with Qt 3.3.5 and HIGHER. This is why I did not see the problem. My version of Qt is 3.3.4. This one is FREE of that bug ( or feature )

Yes, I copy TQtWidget.h into tqtwidget.h, and I get a successful compile of my original project.

I haven’t looked closely at your modifications yet, since my original problem occurred with your code. I will begin to determine what more I need to do to get my TH1 to draw (if anything).

–Just saw you next post come in re: Qt 3.3.7 vs. Qt 3.3.4. So you think this is a uic bug? There is no way to reconfigure what uic generates? qmake; make does work for your histogram example, and I checked the files in .ui (yes, they are freshly generated each time), only ‘TQtWidget.h’ is included, no additional all lower-case version like when I do it with the code I sent you (your version and my version both). Where can I define this behavior? With a little testing, I get the same problem with custom widgets included from Qwt in designer (all lower-case include is generated, forward declaration error…)

I have full functionality with my original kdevelop project :exclamation::smiley: It was that file the whole time. It makes perfect sense now… :blush: I would like to solve the #include “tqtwidget.h” mystery though.

Hello
Now as soon as we sorted out where is the problem came from I want to call your attention to the last slide of the my ROOT 2007 Workshop talk
indico.cern.ch/conferenceOtherVi … nfId=13356 [quote=“QtRoot project status and examples of its use at STAR”]• Qt4 is imminent.
• STAR plans to complete it by July, 2007
• Needs to understand how long we should keep the Qt3
brand if any.
– Ideally, would like to switch to qt4 support (only) in 2008
– Will support longer depending on community needs (please,
feedback)[/quote]Think and check another thread on this forum root.cern.ch/phpBB2/viewtopic.php?t=5936 Take in account Qt4 is NOT the other better version of Qt3. It is another :open_mouth: package. But … please let’s close this thread… and start another one :wink: if any on issue

Yes, I agree, we should close this thread. It works now :slight_smile: