PDA

View Full Version : Configure QT vs build plugins manually!!!



nnidza
15th January 2007, 14:21
I manage to build plugins and configure QT to work with both, PostgreSQL and MySQL. But there is something I don't understand... What is the difference between configure QT to work with MySQL and build plugins manually?
After I build plugins should I call configure QT?

configure -qt-sql-mysql -lmysql -I c:\path\to\mysqlsrc\include -L c:\path\to\msyqlinstall\lib\opt

Can I just build QT default debug libraries and then build plugins for PostgreSQL and MySQL?
Is this going to work???

Is there any difference between this two methods? Is there any difference between code that I write in my application? Should I use some specific method to call a plugin in the code... Just don't ask If my applications work ... Yes, they work!!!

I am writing a tutorial to make this installation process simple, so I would appreciate yours help...

wysota
15th January 2007, 14:27
Just don't ask If my applications work ... Yes, they work!!!

I think you answered the question yourself...

nnidza
15th January 2007, 14:48
No help me to understand myself :-)
Honestly...

wysota
15th January 2007, 16:22
I don't get it - first you say you'd appreciate help and then you say you don't need it? So why did you ask the question here if you already knew the answer?

nnidza
15th January 2007, 16:46
>> I think you answered the question yourself...
>> I don't get it - first you say you'd appreciate help and then you say you don't need it? So >>why did you ask the question here if you already knew the answer?

Sorry but we didn't understand each other. Maybe my questions were confusing as I am confused too :-(
I want help thats why I post this questions, thinkings... I got some clue but I am not sure. Thats why I want your opinion or someone else's opinion too...
I look for earlier posts and I have found some solutions. But let me hear yours.
And as I said I would like to finish my tutorial and post it somewhere to help the others...

wysota
15th January 2007, 17:47
If you ask if something should be done in a particular way and few lines later you write that it works for you if you do it that way, then... well... then you're answering your own question - that's why I said so. Plugins are plugins - they don't have to be built at the same time as the rest of the framework, just make sure they use the same build key (if you don't know what it is, then it probably means they have the same build key) and you don't mix debug and release versions.

VireX
15th January 2007, 22:12
wysota, you completely misunderstood him. Maybe you skimmed over it too fast.
"Is there any difference between this two methods? Is there any difference between code that I write in my application?"
That is the question, not "does my app work? yes it works" as you imply.

wysota
15th January 2007, 23:34
wysota, you completely misunderstood him.
I think you misunderstood me, maybe I wasn't clear enough :)

"Is there any difference between this two methods? Is there any difference between code that I write in my application?"
That is the question,

Yes, I know that.


not "does my app work? yes it works" as you imply.
I did not imply anything like that.

If you want to screw in a screw and you ask whether you should do it with a screwdriver or with a knife (or your teeth or whatever) and you ask which one you should use and right away you say that your screws are screwed in correctly, then I'll say that you have just answered the question yourself - if it works, then the method is ok - maybe not the best possible one, but may be the best method in particular circumstances.

If you build Qt and you want to build SQL support as well, then you can do it while building Qt, but if you want to build it afterwards, you can do it afterwards - the concept of plugins implies that you don't need to rebuild the whole application (Qt framework here) to introduce new functionality (particular SQL driver here) to the application.

Of course using the "-qt-sql-mysql" switch you won't build a plugin, but rather compile the support directly into Qt, but in such situation you obviously can't do it afterwards and I assume the author is aware of that (otherwise his applications wouldn't work). Just remember that when you compile particular SQL support directly into Qt (not as a plugin), then all applications using that library will require that SQL client library (libmysqlclient here) even if the application itself doesn't use SQL at all (so you can end up with an application that displays a sum of two integers that needs MySQL, PostgreSQL and even other libraries). That's another advantage of using plugins. But it all applies to plugins in general, not to Qt or MySQL.

VireX
16th January 2007, 01:01
He was saying, he has two screw drivers, and they both did the job good, but couldn't figure out which screw-driver is better.

nnidza
16th January 2007, 21:37
OK, lets forget about what I wrote ...
Just as I said my questions, thinkings wasn't clear enough because I got too many
questions in the same time and I do apologize for that.
Let me try on this way...

My absolute interests are databases and building forms to access data.
I know how to build forms, how to access data using forms, mostly I understand principles of QT C++ programming ...

But what I don't know is use of dlls, libs,.. configure such things...
So thats why I want to ask you following questions...

FIRST CASE

1. I want to configure my QT with MySQL, PostgreSQL.
I got QT installed, MySQL and PostgreSQL installed in following locations:
C:\PSQL, C:\MySQL. I set variables to point to specific directories...
I didn't make any debug libraries, so I just got a fresh install.

What are the steps that I should do?
(build debug libraries, configure manually, build plugins...)
What do you recommend?
What do I get as the result of this operations?
Which files should I use with my .exe file?


SECOND CASE

2. I got QT installed, MySQL and PostgreSQL installed in following locations:
C:\PSQL, C:\MySQL. I set variables to point to specific directories...
Suppose I clicked on the build debug libraries, so my QT works but without
MySQL and PostgreSQL support.

What are the steps that I should do?
(configure, build plugins,...)
What do I get as the result of this operations...
(dll files, libs,... what?)
Which files should I use with my .exe file?
(plugins, or some other dll files,...)



I made a couple of small application but I don't know how I made them work.
I have used configure, build plugins,... so somehow I got some files, place them into the directory where .exe is placed an they work. Not just on my computer.
And thats why I want to know what is the appropriate way to do so...
Sometimes miracle happen!