![]() |
PyQT + MySQL DB
This question is to the coders......
I've looked online, but I couldn't find a guide that told me everything from start to finish....and there are gaps between the guides out there..... Can someone please just give me 1 detailed example? just 1 simple one? (For Now) I want an app with one button, one line edit. This button will simply insert the text in the line into a column in a MySQL database.on a server, in the same network. Once I see that done from start to finish. I can build on it....... I have Python 2.6 and PyQT4 Designer Installed.....I made the UI....(attached) But I'm COMPLETELY clueless of what to do with signals or slots....or whats the connection code........or How to compile it into a working program..... Can someone please please please help me? please be as DETAILED as you can.....I'm clueless...... Attachment 8335 |
Re: PyQT + MySQL DB
Just so we are on the same page, what target environment are we talking about ? Is this on your desktop, and supposed to run on a N900 later on, or ? The PyQt examples/demo package has plenty of detailed examples, though I might have cut some database examples from the N900 default install...
|
Re: PyQT + MySQL DB
Thanks for your reply attila77.
My ultimate aim is actually learning Python. To keep my interest peeked in this learning endeavor, I wanted to make things for my n900. (For windows, I just make things with Visiual Studio which is what I'm used to) I am running the dev tools on Windows. The target Environment (for now) is the n900. The app i want to make should "ultimately" be able to communicate with a MySQL db, lets say on a windows 2003 server with WAMP/XAMP (on the same Network that the n900 is connected to lets say), or atleast a local .db (sqlite?). |
Re: PyQT + MySQL DB
I see. The main thing to keep in mind is that this Python+Qt stuff does not quite work the way you might be used to in VS, so the example you are trying to make is one of the more complex ones, as it involves a whole slew of technologies, Python, Qt, Qt's database models, UI design, etc. It's nowhere as integrated as your VS experience was (which is both an advantage and a disadvantage).
I really really really (really) suggest you start out with a 'hello world' style plain Python tutorial first, and then slowly progress to Qt, Qt GUI apps, and then databases. Taking it all in at once (especially with data models and networking) is a mighty big bite. That said, here's how you do GUI SQL in PyQt (example taken straight from the pyqt examples package I mentioned earlier on): Code:
import sys |
Re: PyQT + MySQL DB
I came across this example when I first started my research. It was doing too many things so I got a bit lost.....
I already did the Hello World. It's just a label. then you make the .ui into a .py and execute that. What is hindering me is that no body goes from start to finish. All tutorials pick one part and completely ignore the other. For instance, I have now a working .py that can make a sqlite .db file and insert stuff in it......just like the one you posted...... HOWEVER, the insert statements and views are static. what if I want the Insert to take a value from a lineEdit box? What will be the story of the slots/receive/sender then? Lets say I want the results to display inside a GUI i made, not to spontaneously pop up like the example code? And every time I see the word "import"...I get a good feeling it will not work as something will be missing in my setup.....:p......something i have to somehow "compile".... hmmm. maybe i'm getting too old....... :( |
Re: PyQT + MySQL DB
Quote:
Quote:
Quote:
Check out this: http://zetcode.com/tutorials/pyqt4/ A bit dated, but does guide you through the basic concepts. AFAICS it does not deal with Designer, but in reality, the Designer is just a front end that generates (the same) code, so it does not matter much. |
All times are GMT. The time now is 05:00. |
vBulletin® Version 3.8.8