Darhuuk
7th January 2008, 16:38
Hi, I've been tying to fix this bug for over 6 hours now and finally decided to make an account here. Ok, so the problem:
I made a custom widget that can show information about a current poker game, there's 4 labels that can be set (see screenshot) plus the label on the box. Everything works perfect in Designer, I tested every function by debugging everything though the widget's constructor (I just recompiled the plugin, restarted Designer and saw if the output was what it should be). So far, so good, the plugin showed up in the Designed widget menu, I could add it, move, ... everything seemed fine.
The problem is that I can't seem to use it in a different project. The .ui file compiles and everything, but g++ complains about not finding any "PokerTableInfo.h" file. I searched for it and the only location it's in is in the original map, so no surprises here, it's not in the include path... In my desperation I copied the header file into the other project's directory, but then the linker gives me errors (I'm asuming this is because it can't find the implementation of the methodes declared in the PokerTableInfo.h file).
Just to see if other custom widgets had the same problem, I made a project with the analogclock widget from the Qt examples and sure enough, I get exactly the same problem (no .h file found, etc).
Has anyone got any idea how to fix this? I'm a complete C/C++ newbie (only been programming in it for around a week), but I've programmed in a bunch of languages for the past 10 years and had some pretty intense programming courses in univeristy (Java though). So if I overlooked something, go easy on me ;).
Source code's attached in the zip, feel free to abuse it. The methods should be quite straigthforward. (And yes, I know some of the implementations are horrible, but I just want to get it to work right now, fine tuning is for later.)
I made a custom widget that can show information about a current poker game, there's 4 labels that can be set (see screenshot) plus the label on the box. Everything works perfect in Designer, I tested every function by debugging everything though the widget's constructor (I just recompiled the plugin, restarted Designer and saw if the output was what it should be). So far, so good, the plugin showed up in the Designed widget menu, I could add it, move, ... everything seemed fine.
The problem is that I can't seem to use it in a different project. The .ui file compiles and everything, but g++ complains about not finding any "PokerTableInfo.h" file. I searched for it and the only location it's in is in the original map, so no surprises here, it's not in the include path... In my desperation I copied the header file into the other project's directory, but then the linker gives me errors (I'm asuming this is because it can't find the implementation of the methodes declared in the PokerTableInfo.h file).
Just to see if other custom widgets had the same problem, I made a project with the analogclock widget from the Qt examples and sure enough, I get exactly the same problem (no .h file found, etc).
Has anyone got any idea how to fix this? I'm a complete C/C++ newbie (only been programming in it for around a week), but I've programmed in a bunch of languages for the past 10 years and had some pretty intense programming courses in univeristy (Java though). So if I overlooked something, go easy on me ;).
Source code's attached in the zip, feel free to abuse it. The methods should be quite straigthforward. (And yes, I know some of the implementations are horrible, but I just want to get it to work right now, fine tuning is for later.)