.ui.h / kdevelop question
I think I got the concept right. I have to use a .ui.h file to make (and code) my own slots. That's OK. But where do I have to code, say a Dialog's constructor? because the .cpp file, and .h and moc.h files are re-created everytime I build the project, so it doesn't make sense to write any code there.
What do you think? |
The method most people use (including me) is to write the new class (that inherites the one created in Designer) in a new set of .h and .cpp files (header and implementation). Then you can just #include the orginal header and it can be overwritten by uic without any problems. The rule is: don't modify the files build by automatic tools.
|
OK.... I'm starting to work on that.
I had a UI called "Principal", and I was able to compile it without a problem. I changed its name to PrincipalBase, created a file called principal.h that I will use to extend PrincipalBase, the problem is that I can't build now. :'( This is the content of principal.h (in case I made a mistake on the extension): Code:
#include "principalbase.h" Code:
attention: commands are imposed for the target "principalbase.h" Any idea of what I'm doing wrong? :scratch: |
You need to run 'uic' on the .ui file (clear the project, then build again). Also, make sure that the whole class is renamed, not only the header file.
|
When I start kdevelop, it gets stuck switching between two of the file tabs that I had opened before I closed kdevelop the last time and I can't do anything at all. How can I keep it from happening? :mad:
|
Your KDevelop config is kept in ~/.kde/share/config/kdevelop3rc. If you delete it, you get the default config.
In your case it may be easier to edit last session. If probect is someproject/ and has someproject/someproject.kdevelop, you need to edit/remove someproject/someproject.kdevses |
I did something a little less radical. I removed the last doc in the project's .kdevses file. That did the trick.
Will keep you posted about my advances... and Thanks, Mara! |
I managed (somehow, don't ask :-) ) to extend my original class and make the two QDateEdit fields to have today's date as their date. However, I am starting to miss code completion, and I also had to manually add the .h filed needed as includes (qdatetime.h, qdatetimeedit.h), and that's certainly not the kind of work I want to do (I-m thinking about coing java in eclipse, right now). Is it possible to make kdevelop code-complete as I write? and also that it automagically adds/removes header files as needed?
|
I'm wondering how you're adding the new classes. Do as much as possible in Designer, the include its' files, they have all the needed includes (usually).
Also, if you have't already, look into Project Options->C++ specific->Code completion You can add your own code completion databases. |
I extended the hard way. Created two new files: form.h and form.cpp and wrote all the code there. What's the "lazy" way?
|
'Generate new class' button on on the right side (below 'Open project') or Project->New class
|
Mara, you have been very helpful! I appreciate that! :-)
Do you know how I can build (or maybe install through apt) QT's MySQL Plugin? I'm on a kubuntu breezy box... boxes, as a matter of fact. ;-) |
Quote:
Code:
./configure -plugin-sql-mysql |
oops REMOVED same as above..
page not refreshing or even *reacting* when hitting submit.. ?? @moderator.. delete me ??? |
It was a lot simpler than compiling something. There's a package for each driver.
from apt-cache search libqt3: Code:
libqt3-mt-ibase - InterBase/FireBird database driver for Qt3 (Threaded) Code:
apt-get install libqt3-mt-mysql |
All times are GMT -5. The time now is 07:17 PM. |