views:

223

answers:

5

am trying to create a GUI for a c code written in LINUX. this code basically connects two systems,opens the serial port,writes data from one system to the other via the port.how do i go about this? the development tools present with me are Qt designer version 3.3.5 and K Develop,which one should I use.and how to go about it? am a total beginner.....totally clueless

+1  A: 

I think you may be looking in the wrong place. You should probably search the web for a tutorial on C++ programming, or get a book on it (there are plenty out there). Once you're comfortable with C++ (it'll take a while if you're not already), you can start to read about writing KDE applications. There are probably some introductory things to read on the KDE website, and don't forget that Google is your friend throughout the process ;-)

By the way, Qt Designer is just a program for doing GUI layouts, while KDevelop is a full featured IDE that combines Qt Designer, a text editor, and a bunch of other stuff. You can use KDevelop for writing anything from very simple "Hello World" C++ programs up to, well, something as complex as KDevelop itself.

David Zaslavsky
A: 

The doc.trolltech.com site has a huge amount of documentation. You should go definitely take a look. I would use the latest available Qt library for your distro, since it is a new developpment.

Regarding the serial port C code, I would keep it and call it from your C++ code. Beware of time consuming operations that can ruin the interactive feeling of your app.

shodanex
+2  A: 

In Linux, every hardware device is mapped to the file-system using standard file-system permissions.

If you're just using a simple serial port protocol under Linux, you can treat any serial port device as a file. Meaning, they can be opened, read, written and handled just using standard files.

The 'filename' for a serial port is typically /dev/ttyS0 or /dev/ttyUSB0 depending on the type of serial port. It is often symlinked to /dev/modem on regular distributions.

sybreon
+1  A: 

If you've actually got to write the serial port part (I'm not clear on this from your question), the other system calls you'll need to know about are 'ioctl' and 'termios', to set various serial port parameters.

Sharkey
+1  A: 

Seems your using QT. You should try QextSerialPort which is a serial port class for QT.

rdoursenaud