LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Qt Programming Problem (https://www.linuxquestions.org/questions/programming-9/qt-programming-problem-314748/)

chanwing 04-19-2005 12:23 AM

Qt Programming Problem
 
:newbie:

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
:confused:

Mega Man X 04-19-2005 01:37 AM

Have you tried KDevelop?

http://www.kdevelop.org/

chanwing 04-19-2005 03:41 AM

:D
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?

chaitanya 04-19-2005 05:28 AM

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.

ahwkong 04-19-2005 06:28 AM

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.

chanwing 04-19-2005 07:36 PM

;)
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?

ahwkong 04-19-2005 08:36 PM

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.

chanwing 04-20-2005 04:18 AM

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)


All times are GMT -5. The time now is 04:13 AM.