PDA

View Full Version : Newbie Questions



Pether
12th July 2009, 23:21
Hello

I downloaded Qt a few days ago thinking that i'd make a GUI for my program that i wrote in C++, and i was told Qt would be the program to use.

I have been doing C++ for about a weekend. I have created a small tool that will ask the user a series of queries, and then print everything to a text file in a specific format. Pretty easy, but later versions will load about 20 textfiles and let the user add, edit and remove entries, all which are crossreferenced all over the place.


Anyway, but since i am a newbie, i am just completely unaware how to connect the gui to my program.
How do i link this QLineEdit to the array i have created?
How do i use this button to write everything to the file?

I'd hope for a good tutorial as well.
The ones i have tried are just too weak.

john_god
13th July 2009, 00:25
I start with QT less than a year ago and I used the book "C++ GUI Programming with Qt 4". I think you will find some good examples there. Also you can use the QT Assistant. For specific QLineEdit check this link.

http://doc.trolltech.com/3.3/qlineedit.html (http://doc.trolltech.com/3.3/qlineedit.html)

The more you read more pratice you will achieve with QT :cool:

aamer4yu
13th July 2009, 05:18
The best tutorials are the Qt Assistant and Qt Demos. A beginner might not need to look beyond that.
Just start with the Qt Assistant home page and learn about different sections. Then read what interests you, find a relevant example in Qt Demo.. and try to mess a little.. thats how u learn :)

Pether
14th July 2009, 19:35
I couldnt find anything usefull there.

Seems like Qt isnt very newbiefriendly.

All i want is to print whatever is in this form to a textfile.
Isnt that hard. And seeing that i already have it working in a console, all i need is to connect it to a gui. :crying:

wysota
14th July 2009, 19:42
Seems like Qt isnt very newbiefriendly.
Especially if you started learning C++ two days ago.

Pether
14th July 2009, 22:35
I started writing the first part of the 2 months ago and was no problem with that.
Started with the gui with qt just a few days ago, but as always with programming i have learnt, is that they all lack proper tutorials.

'-Woo! You now know how to type Hello, world in 500 different ways, you can now take a job as a professional programmer, yay you!'

And seeing that qt has rewritted everything from c++ to its own language it is just harder.

wysota
14th July 2009, 22:45
Ok, because of being annoyed with a useless title of this thread I'm now going to inflict massive agressiveness on words you have written :)


Started with the gui with qt just a few days ago, but as always with programming i have learnt, is that they all lack proper tutorials.
Probably because of lack of will of opening the documentation. Or maybe you just missed the "Tutorials, Examples and Demonstrations" entry at the very beginning of the reference that points you to more or less than 100 tutorials and examples explained in detail. There is also the "All Overviews and HOWTOs" page listing the next hundred or so descriptions on how to do things. I assume you have read them before becoming convinced none of them is "proper".


And seeing that qt has rewritted everything from c++ to its own language it is just harder.
Qt doesn't provide a "language", it's plain old C++. If you have spent more than the weekend studying the language (C++, not Qt, the latter is not a language) or maybe read any of the "improper" tutorials you might have known that yourself. Qt doesn't prevent you from using anything from C++.

But on the other hand if you have been programming in a similar manner as you are asking questions (being rude and completely uninformative) then I understand why you got stuck.

How do you expect us to help you if you say nothing about your program apart from acknowledging that you didn't undestand basics of Qt (nor C++, I presume) before gettings your hands wet?

Pether
14th July 2009, 23:38
Seems like Qt got a retarded Community as well.


I said what my program was, and what i needed from Qt.
It was extremely simple. And then i said that it wasnt possible to find tutorials about that, since they are about totaly different things.

Bye bye

nish
15th July 2009, 02:04
Seems like Qt got a retarded Community as well.
whats the make of your phone?
Nokia? -> they are so retarded that they bought Qt.
Motorola? -> they are so retarded that they are using Qtopia in their phones from ages.
Sony Ericsson? -> retarded Qt already ported to S60 on Nokia... soon u will see on other symbian platform
HTC,ASUS etc (Windows Mobile)? -> unfortunately they got Qt there also..

Whats your OS?
i dont need to answer that.. RTFM.

Looks like you live in a world full of retarded ppl all around you, and only u seem to be normal human:)



I said what my program was, and what i needed from Qt.
It was extremely simple. And then i said that it wasnt possible to find tutorials about that, since they are about totaly different things.


so that means the tutorial says how to write "Hello World" program..
and your need is to to write "Hi Mom!! see i am programming!!"
ofcourse... tutorial doesnt have that..

i think before learning C++ or Qt,, you first need to understand what a programmer is.
A programmer is someone who 80% of time do innovation, and rest 20% time invents.
If every requirment of yours is supposed to be in a tutorial then there is no need of a programmer.

furthermore, if you spent just 2 days on Qt Assistant, then your current problem is a matter of how
fast you type on keyboard.



Bye bye
Its good you dont want to join the retarded community. Thx a lot.:D

jano_alex_es
15th July 2009, 08:32
Well, just to add some info:


How do i link this QLineEdit to the array i have created?


Just type "QlineEdit" in the QT Assistant index and you will find all the info you could need. Take a look to "text()" and "insert ( const QString & newText )"



How do i use this button to write everything to the file?

You could use QFile to manage your files and (from Qt Assistant) "Data is usually read and written using QDataStream or QTextStream, but you can also call the QIODevice-inherited functions read(), readLine(), readAll(), write()."


But, of course, the most important is to read, read and read (and learn, learn and learn... and, in my case, ask in the forum, ask in the forum and ask in the forum :P)