LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-19-2005, 12:23 AM   #1
chanwing
Member
 
Registered: Feb 2005
Posts: 42

Rep: Reputation: 15
Smile Qt Programming Problem




I am new for using the Qt.
I have already tried to use the Qt designer to make a dialog and then call "uic" to convert into "cpp" and "h" files.
After that, I write a simple program with "vi" to run the dialog.
However, I find it difficult for me to write a complex program with lots of files.
Every time I need to run the "uic" then run the "moc" and then finally run the "qmake".
Are there any simple method that just like click a button to compile and run all the things?
When I write a C++ program in Visual C++ 6.0, I can compile and run it easily. Also, I can find out which methods in which classes easily and all the functions are in different colors. It is so convenient.
Are there any software that can have similar platform for me to write a program with Qt?
Can anyone help me and answer my questions?
Thank you
 
Old 04-19-2005, 01:37 AM   #2
Mega Man X
LQ Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 65
Have you tried KDevelop?

http://www.kdevelop.org/
 
Old 04-19-2005, 03:41 AM   #3
chanwing
Member
 
Registered: Feb 2005
Posts: 42

Original Poster
Rep: Reputation: 15

in fact, I try to create a new project about qt in kdevelop but can't create(I don't know why) and I don't how to use kdevelop.
I try to use it but I can't find anything that can help me to change ui file into cpp/h file.
Actually,.......
If I am right, is it........
Kdevelop = Visual Studio 6.0
Qt = MFC library
???
Where can I find more information about using the Kdevelop?
is Kdevelop the unique tool for Qt?
 
Old 04-19-2005, 05:28 AM   #4
chaitanya
LQ Newbie
 
Registered: Apr 2005
Posts: 8

Rep: Reputation: 0
Hello chanwing,

Directly you can write your program in .cpp file after that follow the below steps
Assume you've written your program. Now,

1. qmake -project main.cpp
The above command will create a .pro file.

Note: The filename can be anything but that should contain the definition of
"main()" function.

2. qmake
This creates a makefile.

3. make
This creates the binary.

From now onwards if you make any changes to your source file you can issue only make.
 
Old 04-19-2005, 06:28 AM   #5
ahwkong
Member
 
Registered: Aug 2004
Location: Australia
Distribution: Fedora
Posts: 282

Rep: Reputation: 30
the Makefile generated by qmake will define a target such that the ui file will be processed by uic to generate a header file and cpp file. So, normally you do not have to worry about the "ui converion to c++".

Besides, kdevelop has good documentation and is very easy to use. There is NO REASONABLE excuse to say "do not know to use kdevelop" unless you did not put effort in reading the doc.
 
Old 04-19-2005, 07:36 PM   #6
chanwing
Member
 
Registered: Feb 2005
Posts: 42

Original Poster
Rep: Reputation: 15

Thank you chaitanya and ahwkong.
oh, you mean that qmake can convert the ui into cpp and I don't need to use "uic" command to convert?

I think I really need to understand how to use the Kdevelop by doc .
But, can anyone tell me how to create a new project in Kdevelop with Qt? I just follow the step of making a new project but still can't. is it my Linux having problem? or something that I miss before I create a new project?
 
Old 04-19-2005, 08:36 PM   #7
ahwkong
Member
 
Registered: Aug 2004
Location: Australia
Distribution: Fedora
Posts: 282

Rep: Reputation: 30
Ok. No offence intented, but I think you really need to study the doc with a bit more time.

To get you started , here is a way to create a qt project:

In kdevelop 3.1.0,

Project -> New Project ... -> (A dialog shows and In the treeview ) C++ -> Qmake project -> Application.

That is.

When first time you build the program, it'd say 'Makefile not found. Run qmake?'. Says yes and, yes sir, you now have a qt project.
 
Old 04-20-2005, 04:18 AM   #8
chanwing
Member
 
Registered: Feb 2005
Posts: 42

Original Poster
Rep: Reputation: 15
hahaha.........icic.......sorry about it that I always think that the pop-up message of "makefile not found" means I can't create the project........

my Kdevelop version is 2.X.X (just in the RedHat 9.2)

I saw the doc a bit more but I don't know how to execute a file.
my steps in Kdevelop are as follow:
1. create a qt project
2. add a file into the project
3. compile the file
4. make

when I start to make, it always pop-up a message that I need to check "build ->configure or something".

I search and see the doc in the Kdevelop but it don't have any examples or detail information about it.
It just includes some general information.

where can I find the information to solve my problem?
(sorry that I don't have enough makefile concept because I just know how to use the simple method of qmake)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
pthread's programming problem keiwu Programming 3 02-14-2005 01:17 AM
programming problem..........help urgent djadhav Programming 5 10-20-2004 04:47 AM
another c programming problem Randall Programming 8 01-29-2003 04:45 PM
simple c programming problem abi_sh Programming 8 07-24-2002 08:40 PM
Socket programming problem krivi Programming 3 01-14-2002 02:04 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration