Results 1 to 14 of 14

Thread: How to use KLed

  1. #1
    Join Date
    Jul 2006
    Posts
    42
    Thanks
    13
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default How to use KLed

    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

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 975 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to use KLed

    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/

  3. The following user says thank you to jacek for this useful post:

    nleverin (5th September 2007)

  4. #3
    Join Date
    Jul 2006
    Posts
    42
    Thanks
    13
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: How to use KLed

    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?

  5. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 975 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to use KLed

    Quote Originally Posted by Mongwei Popp
    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.

  6. The following user says thank you to jacek for this useful post:

    nleverin (5th September 2007)

  7. #5
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,709
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: How to use KLed

    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.
    Attached Files Attached Files

  8. The following user says thank you to high_flyer for this useful post:

    nleverin (5th September 2007)

  9. #6
    Join Date
    Jul 2006
    Posts
    42
    Thanks
    13
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: How to use KLed

    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

  10. #7
    Join Date
    Jul 2006
    Posts
    42
    Thanks
    13
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: How to use KLed

    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

  11. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 975 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to use KLed

    Try:
    Qt Code:
    1. $ LD_LIBRARY_PATH=/path/to/directory/with/libQLed.so/file ./your_app
    To copy to clipboard, switch view to plain text mode 
    or update your ld.so.conf and run ldconfig.

  12. The following user says thank you to jacek for this useful post:

    nleverin (5th September 2007)

  13. #9
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,709
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: How to use KLed

    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)

  14. The following user says thank you to high_flyer for this useful post:

    nleverin (5th September 2007)

  15. #10
    Join Date
    Jul 2006
    Posts
    42
    Thanks
    13
    Qt products
    Qt3
    Platforms
    Unix/X11

    Smile Re: How to use KLed

    Thank you'all!
    It is so wonderful that I can see the led on my application the first time.

    Mongwei

  16. #11
    Join Date
    Jun 2007
    Posts
    7
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default how to use kled

    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
    Attached Files Attached Files

  17. #12
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,709
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: How to use KLed

    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.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  18. The following user says thank you to high_flyer for this useful post:

    nleverin (5th September 2007)

  19. #13
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 975 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to use kled

    Quote Originally Posted by jagadish View Post
    i am the beginer of Qt.i want to use the kled in my project.
    Please, don't post the same question multiple times.

  20. #14
    Join Date
    Aug 2008
    Posts
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: How to use KLed

    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

Similar Threads

  1. KLed in a list view
    By villy in forum Qt Programming
    Replies: 6
    Last Post: 10th August 2006, 13:23

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.