PDA

View Full Version : How to use KLed



mp33919
14th August 2006, 22:32
I have Qt3.1 running on Linux machine. I tried to use KLed in my Qt's form. I have included kled.h but I still can not pass the compiler. The error I got: undefined reference to KLed::KLed. I guest I have to specify the lib but I did not know which one I should use. Can anyone tell me how to use KLed or any KDE stuffs in toolbox in general?

Thanks

jacek
14th August 2006, 22:42
If you want to use those widgets, then your application must be a KDE application --- not Qt one. This means that you should link your program with proper KDE libraries and you might have to create KApplication instance instead of QApplication.

http://developer.kde.org/documentation/tutorials/

mp33919
14th August 2006, 23:50
Thanks for your infomation.
I think it is too late to tranfer the Qt project to KDE project. The application has been written and released long time ago. Now, I need to add a few "leds" into the application. I am looking for an easy way to do so, any suggestions?

jacek
15th August 2006, 00:03
Now, I need to add a few "leds" into the application. I am looking for an easy way to do so, any suggestions?
You might try this: http://www.qt4lab.org/widgets.htm
or write your own widget along with Qt Designer plugin. It shouldn't take you much time, since all you need is a QLabel and two pixmaps wrapped in a nice interface.

high_flyer
17th August 2006, 11:00
At my early days with Qt, I saw that a Qt led widget was a thing I will need a lot, so I took the KLed class and stripped all KDE dependencies from it, and got QLed as a designer plugin.
You are welcome to use it :)
As I said, this was done during my early days with Qt, so it may very well be that the things I've done could have been done better. (but it works well)
You are welcome to improve it, and post it back! ;)

Cheers.

mp33919
18th August 2006, 20:26
Thanks high_flyer,

I have downloaded your zip file. I will try to use it "directly". Since I am a beginner of Qt programming, I am just happy to have someone like you to help me out of the problem I have.

Sincerely,

Mongwei

mp33919
23rd August 2006, 23:07
Hi,

After I download high_flyer's qled and made a nice libQLed.so, I got another problem.

I put qled into my form, compile it and link it and got a executable file. But when I run it, I got the the error: "error while loading shared libraries:libQLed.so:can not open shared object file. No such file or directory"

What happen? What should I do now?

Help!!!

Thanks

jacek
23rd August 2006, 23:28
Try:
$ LD_LIBRARY_PATH=/path/to/directory/with/libQLed.so/file ./your_appor update your ld.so.conf and run ldconfig.

high_flyer
23rd August 2006, 23:44
jacek is right - your LD_LIBRARY_PATH needs to include the path where your qledplugin is.
(actually you should put the plugin in the designer plugin directory, so you can use it with designer too)

mp33919
24th August 2006, 18:30
Thank you'all!
It is so wonderful that I can see the led on my application the first time.

Mongwei

jagadish
29th June 2007, 14:12
hai,
i am the beginer of Qt.i want to use the kled in my project.i downloaded the following attachment from this forum,but am not able to use this &how to plugin the kled into the QT designer.please give detailed steps .am using qt 4.1 in win xp.
thanks

high_flyer
29th June 2007, 16:28
you are a Qt4 user (as stated in your post header) but this plugin is for Qt3.
You will have to port it to Qt4 if you want to use it with Qt4.

jacek
29th June 2007, 20:27
i am the beginer of Qt.i want to use the kled in my project.
Please, don't post the same question multiple times.

cL4r4
1st September 2008, 08:47
i'm currently using Qt3 on QDevelop using Ubuntu version 8.04.
i would like to use Led blinking for my application and i have no idea of how to do.
so is there anyone who can teach me how to use that "qledplugin" step by step?
because i totally don't understand how to create lib path or .so file
i really appreciate any of the help u give out.

thank so much in advance