Results 1 to 5 of 5

Thread: Error using kdebutton widget in QT

  1. #1
    Join Date
    Jan 2006
    Posts
    7
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Error using kdebutton widget in QT

    hi
    i m using KDE3 and QT3.3.4

    i want to use a KDE button which is provided in the QT-Designer menu. When i add this button to a form and compile, it gives an error:

    [localhost test]$ make
    g++ -o test .obj/main.o .obj/frm_main.o .obj/qmake_image_collection.o .obj/moc_frm_main.o -L/usr/lib/qt-3.3/lib -L/usr/X11R6/lib -lqt-mt -lXext -lX11 -lm
    .obj/frm_main.o(.text+0x1a6): In function `frm_main::frm_main(QWidget*, char const*, unsigned int)':
    .ui/frm_main.cpp:38: undefined reference to `KKeyButton::KKeyButton(QWidget*, char const*)'
    .obj/frm_main.o(.text+0x312): In function `frm_main::frm_main(QWidget*, char const*, unsigned int)':
    .ui/frm_main.cpp:38: undefined reference to `KKeyButton::KKeyButton(QWidget*, char const*)'
    collect2: ld returned 1 exit status
    make: *** [test] Error 1

    I know that this is some linking problem. How to solve it?Please help...
    Where and how should i add this KDE include dir information.
    My KDE header files are in '/usr/include/kde/'

    Thanks...

  2. #2
    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: Error using kdebutton widget in QT

    Try adding "LIBS += -lkdeui" to your .pro file.

  3. #3
    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: Error using kdebutton widget in QT

    You may also need to substitute QApplication with KApplication.

  4. #4
    Join Date
    Jan 2006
    Posts
    7
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Error using kdebutton widget in QT

    Thanks
    Adding "LIBS += -lkdeui" to .pro file worked.

    But still a problem, when i click on this button, it leads to "Segmentation Fault" and the application gets terminated. What can be the possible cause and a solution???
    I have mapped the 'Clicked()' event to form's 'Close()'

    Thanks...

  5. #5
    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: Error using kdebutton widget in QT

    Quote Originally Posted by mysearch05
    But still a problem, when i click on this button, it leads to "Segmentation Fault" and the application gets terminated.
    Could you post the backtrace?

    Quote Originally Posted by mysearch05
    What can be the possible cause and a solution???
    As Wysota suggested, you might need to use KApplication and other KDE classes to make it work.

Similar Threads

  1. QDockWidget inside another widget in the center?
    By Antebios in forum Qt Programming
    Replies: 1
    Last Post: 16th February 2010, 07:06
  2. Widget Focus
    By navi1084 in forum Qt Programming
    Replies: 6
    Last Post: 29th September 2008, 10:22
  3. Playbutton functionality
    By uchennaanyanwu in forum Qt Programming
    Replies: 5
    Last Post: 31st July 2008, 22:29
  4. How to Open & Close a Widget ?!!
    By Fatla in forum Qt Programming
    Replies: 6
    Last Post: 13th June 2008, 20:39
  5. Tricky problem with ARGB widget / UpdateLayeredWindow
    By nooky59 in forum Qt Programming
    Replies: 3
    Last Post: 21st February 2008, 10:35

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.