Results 1 to 9 of 9

Thread: Using K Objects in Qt project

  1. #1

    Default Using K Objects in Qt project [SOLVED]

    Hi,

    all projects I have been working so far has been created using pure Qt code. Now I see some interesting K classes and want to use them. I put them in my test application (using KUrl object) and at linking time I get this:

    obj/form1.o(.text+0x42a): In function Form1::Form1[not-in-charge](QWidget*, char const*, bool, unsigned)':
    : undefined reference to KURLRequester::KURLRequester[in-charge](QWidget*, char const*)'

    I put LIBS += -L/opt/kde/lib in my pro file but no help
    Last edited by dec0ding; 17th January 2006 at 13:04.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Using K Objects in Qt project

    You have to link with proper kde libs (LIBS += -lkdeui -lkdecore and/or other). And use KApplication instead of QApplication. Generally this is called KDE programming

  3. #3
    Join Date
    Jan 2006
    Location
    Napoli, Italy
    Posts
    621
    Thanks
    5
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Using K Objects in Qt project

    Quote Originally Posted by dec0ding
    Hi,

    all projects I have been working so far has been created using pure Qt code. Now I see some interesting K classes and want to use them. I put them in my test application (using KUrl object) and at linking time I get this:
    If you need to use KDE Widget I suggest you to make a KDE Application.
    In this way you can use complete KDE framework utilities.

    Bye
    A camel can go 14 days without drink,
    I can't!!!

  4. #4

    Default Re: Using K Objects in Qt project

    Quote Originally Posted by mcosta
    If you need to use KDE Widget I suggest you to make a KDE Application.
    In this way you can use complete KDE framework utilities.

    Bye
    Ok but I have written 1000 code so I need to use some KDE Widgets now, that is why I asked...

    Wysota: I tryed -lkdeui and -lkdecore but both show this error:

    usr/lib/gcc-lib/i486-slackware-linux/3.3.6/../../../../i486-slackware-linux/bin/ld: cannot find -lkdeui
    collect2: ld returned 1 exit status
    make: *** [learn] Error 1

    Thanks

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Using K Objects in Qt project

    Quote Originally Posted by dec0ding
    Wysota: I tryed -lkdeui and -lkdecore but both show this error:
    You need to provide a path to look for those libs (using -Lsome_directory)

  6. #6

    Default Re: Using K Objects in Qt project

    Ok solved...
    I put the project in KDevelop and now working from there

    Thanks both
    Last edited by dec0ding; 17th January 2006 at 13:05.

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

    Default Re: Using K Objects in Qt project

    Quote Originally Posted by dec0ding
    I put in my *.pro file this:

    LIBS += -L/opt/kde/lib/

    then, where do I put -lkdeui, -lkdecore?e
    In the same place:

    LIBS += -L/opt/kde/lib/ -lkdeui -lkdecore

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

    Default Re: Using K Objects in Qt project

    You should take in consideration, that by using kde libs, you are loosing one of Qt best fetures - its portability.
    So if you want to write applications that will run on kde explicitly, then ok, but if not, better create your own classes in Qt that do the same as the KDE calsses that you use do.

  9. #9

    Default Re: Using K Objects in Qt project

    Quote Originally Posted by jacek
    In the same place:

    LIBS += -L/opt/kde/lib/ -lkdeui -lkdecore
    Thanks

    theLSB: well u said good thing that I never thought of...maybe I will go on with pure Qt ...

Similar Threads

  1. How to Compile VTKDesigner2 with Qt?
    By alfredoaal in forum Newbie
    Replies: 0
    Last Post: 5th September 2008, 05:34
  2. Professional Classes & Objects Structure
    By webstylemedia in forum Newbie
    Replies: 4
    Last Post: 4th August 2008, 10:50
  3. Set up the Qt4.3.2 with Visual Studio 2005
    By lamoda in forum Installation and Deployment
    Replies: 6
    Last Post: 30th January 2008, 06:51
  4. Importing qt project to an eclipse workspace
    By isahin in forum Installation and Deployment
    Replies: 2
    Last Post: 28th January 2008, 18:00
  5. Qt4 open src mingw from a PC to another
    By nvictor in forum Installation and Deployment
    Replies: 11
    Last Post: 1st May 2007, 17:41

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.