The Ultimate Qt Community site
Home News Forum Wiki Contest FAQ Links

Go Back   Qt Centre Forum > Qt > KDE Forum

KDE Forum KDE programming and usage issues.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 16th April 2007, 04:24
hildebrand hildebrand is offline
Beginner
 
Join Date: Apr 2007
Qt products used: Qt3
Qt platforms used: Unix/X11
Posts: 11
Thanks: 1
Thanked 0 Times in 0 Posts
Default KDE/QWT doubt on debian sarge

I have got Debian Sarge installed on my system. I have the following doubts:-
(1) I want to use kde widgets within qt3 designer. In particular i wanted to use the KDoubleSpinBox widget. I am not finding the relevant header file in /usr/include/kde which also i had to manually specify in the make file. Where are they? Do i need some other package to be installed to get the header file. Other kde widgets seem to be there. (some are missing like kintspinbox). My code refuses to compile here due to this. Any suggestions anybody? The widget works fine in preview though!!

(2) I want to add my qwt widgets also to the designer toolbox. how can I do that?

(3) Where is the help available for the kde widgets? (qt widget help is ofcourse got through qt3-doc). It would be really useful.

If anybody can guide I would appreciate it.
Reply With Quote
  #2  
Old 16th April 2007, 08:21
guilugi guilugi is offline
Intermediate user
 
Join Date: Jan 2006
Location: Paris, France
Qt products used: Qt4
Qt platforms used: MacOS , Unix/X11 , Windows
Posts: 227
Thanks: 3
Thanked 21 Times in 21 Posts
Default Re: KDE/QWT doubt on debian sarge

For your KDE issue, here are source files..not sure they are up to date though
http://api.kde.org/3.4-api/kdeui/html/files.html

EDIT : Here is the up-to-date link !
http://api.kde.org/3.5-api/kdelibs-a...tml/files.html

To include QWT widgets, you should browse Google, but the most simple would be to write
your own Designer plugin for that purpose.
Check the Qt4 Designer docs

Guilugi.
Reply With Quote
  #3  
Old 16th April 2007, 09:38
Uwe Uwe is offline
Advanced user
 
Join Date: Feb 2006
Location: Munich, Germany
Qt products used: Qt3 , Qt4 , Qt/Embedded , Qtopia
Qt platforms used: MacOS , Unix/X11 , Windows
Posts: 453
Thanks: 0
Thanked 94 Times in 88 Posts
Default Re: KDE/QWT doubt on debian sarge

Quote:
Originally Posted by guilugi View Post
To include QWT widgets, you should browse Google, but the most simple would be to write
your own Designer plugin for that purpose.
Check the Qt4 Designer docs
Guilugi.
Qwt comes with a designer plugin (Qt3 + Qt4). I don't use Debian myself, but I'm pretty sure, that all you have to do is to install the Debian packages. If you want to install Qwt from source code, the INSTALL file explains how to build and install the Qwt designer plugin.

Uwe
Reply With Quote
  #4  
Old 16th April 2007, 11:51
jacek jacek is offline
Guru
 
Join Date: Jan 2006
Location: Warsaw, Poland
Qt products used: Qt3 , Qt4
Qt platforms used: Unix/X11 , Windows
Posts: 5,369
Thanks: 28
Thanked 939 Times in 900 Posts
Default Re: KDE/QWT doubt on debian sarge

Quote:
Originally Posted by hildebrand View Post
I am not finding the relevant header file in /usr/include/kde which also i had to manually specify in the make file. Where are they? Do i need some other package to be installed to get the header file.
Try looking for a package called kde-devel or kdelibs-devel.
Reply With Quote
  #5  
Old 19th April 2007, 05:46
hildebrand hildebrand is offline
Beginner
 
Join Date: Apr 2007
Qt products used: Qt3
Qt platforms used: Unix/X11
Posts: 11
Thanks: 1
Thanked 0 Times in 0 Posts
Default Re: KDE/QWT doubt on debian sarge

Debian Sarge has qt3.3 and designer installed.

The kde-devel package is installed. Package of Qwt (libqwt-dev) is also installed but i don't see any plugin installed. (I had installed the kdesdk package along with libqt3-mt-dev and qt3-designer, qt3-doc etc to get my system ready for qt programming). Also funny thing, I went throug kde core api available somewhere in /usr/share/doc/kde (which is what i was looking for not the online version) and the classes nowhere mentions KDoubleSpinBox although it is mentioned in the kdialog.h header file also. I am not able to connect where is it available.
I request anybody who has debian 3.3 installed to put the widget in a form and compile it. It doesn't work. And to begin with where is the class if it is not there in kde core. Preview works very fine in qte-designer but make fails. What is the mismatch?

Awaiting an early reply
Hildebrand Victor
Reply With Quote
  #6  
Old 19th April 2007, 07:22
hildebrand hildebrand is offline
Beginner
 
Join Date: Apr 2007
Qt products used: Qt3
Qt platforms used: Unix/X11
Posts: 11
Thanks: 1
Thanked 0 Times in 0 Posts
Default Re: KDE/QWT doubt on debian sarge

I have found the solution but problem is still not over.
The kde documents i got from kdesdk-doc-html and kdelibs4-doc packages.
I found out that the Makefile generated by qmake by default does not contain the following:-
(i) It does not contain the setting for the knuminput.h header which actually contains the kdoublespinbox class. (I erroneously thought the file would be called kdoublespinbox.h it is actually knuminput.h which i included in the main form's file). This I added as -I/usr/include/kde3 for the header file in INCPATH in the header
(2) Since this class is part of the kdeui library I needed to include -lkdeui (qmake should have done this by default along with qt designer but somehow didn't do.)
This has to be done everytime you call qmake(very boring thing to do!!). Then it compiles without problem. (The same problem was there with qwt also where I needed -I/usr/include/qwt and -lqwt to be put)

But now what is my new problem, my code is now compiling. However, when I click on the KDoubleSpinBox icon to increment or decrement the count, It is exiting the program and shows me "Segmentation Fault" in Konsole. Why is this segmentation fault occuring? I noticed this does not occur for KNumInput also in the same header which I used.
Can anyone give a pointer on why this is happening?
Reply With Quote
  #7  
Old 19th April 2007, 20:43
jacek jacek is offline
Guru
 
Join Date: Jan 2006
Location: Warsaw, Poland
Qt products used: Qt3 , Qt4
Qt platforms used: Unix/X11 , Windows
Posts: 5,369
Thanks: 28
Thanked 939 Times in 900 Posts
Default Re: KDE/QWT doubt on debian sarge

Quote:
Originally Posted by hildebrand View Post
It does not contain the setting for the knuminput.h header which actually contains the kdoublespinbox class.
You have to add "INCLUDEPATH += /usr/include/kde3 /usr/include/qwt" to your .pro file.

Quote:
Originally Posted by hildebrand View Post
qmake should have done this by default along with qt designer but somehow didn't do.
Because you haven't told it to do it. Add "LIBS += -lkdeui -lqwt" to your .pro file.

Quote:
Originally Posted by hildebrand View Post
However, when I click on the KDoubleSpinBox icon to increment or decrement the count, It is exiting the program and shows me "Segmentation Fault" in Konsole. Why is this segmentation fault occuring?
It might be caused by lack of KApplication instance, which you should create instead of QApplication.
Reply With Quote
  #8  
Old 20th April 2007, 10:57
hildebrand hildebrand is offline
Beginner
 
Join Date: Apr 2007
Qt products used: Qt3
Qt platforms used: Unix/X11
Posts: 11
Thanks: 1
Thanked 0 Times in 0 Posts
Default Re: KDE/QWT doubt on debian sarge

Quote:
Originally Posted by jacek View Post
It might be caused by lack of KApplication instance, which you should create instead of QApplication.
I tried putting KApplication instead of QApplication in the main.cpp file. Output says some initialisation needs to be done. Whats the format?

I am also not completely convinced that this is the problem. I ran an strace of the said file and it seems to have got a signal at the end which terminated it. The last portion is shown below:-
open("/etc/mtab", O_RDONLY) = 7
fstat64(7, {st_mode=S_IFREG|0644, st_size=239, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x412f3000
read(7, "/dev/hda10 / ext2 rw,errors=remo"..., 4096) = 239
close(7) = 0
munmap(0x412f3000, 4096) = 0
open("/proc/meminfo", O_RDONLY) = 7
fstat64(7, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x412f3000
read(7, "MemTotal: 256740 kB\nMemFre"..., 1024) = 572
close(7) = 0
munmap(0x412f3000, 4096) = 0
ioctl(5, FIONREAD, [1]) = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++

I can't make out whats this happening which caused the problem. whats this ioctl for ?

Hildebrand
Reply With Quote
  #9  
Old 21st April 2007, 22:51
jacek jacek is offline
Guru
 
Join Date: Jan 2006
Location: Warsaw, Poland
Qt products used: Qt3 , Qt4
Qt platforms used: Unix/X11 , Windows
Posts: 5,369
Thanks: 28
Thanked 939 Times in 900 Posts
Default Re: KDE/QWT doubt on debian sarge

Quote:
Originally Posted by hildebrand View Post
I tried putting KApplication instead of QApplication in the main.cpp file. Output says some initialisation needs to be done. Whats the format?
See this: http://api.kde.org/3.5-api/kdelibs-a...dLineArgs.html

Quote:
Originally Posted by hildebrand View Post
I am also not completely convinced that this is the problem. I ran an strace of the said file and it seems to have got a signal at the end which terminated it.
...
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
Strace only shows you system calls. A debugger might give more information, but probably it's caused by a null pointer (for example something might be trying to use unitialized KApp variable).
Reply With Quote
  #10  
Old 23rd April 2007, 04:27
hildebrand hildebrand is offline
Beginner
 
Join Date: Apr 2007
Qt products used: Qt3
Qt platforms used: Unix/X11
Posts: 11
Thanks: 1
Thanked 0 Times in 0 Posts
Default Re: KDE/QWT doubt on debian sarge

I ran gdb with this program. The result is as follows:-
GNU gdb 6.3-debian
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-linux"...Using host libthread_db library "/lib/tls/libthread_db.so.1".

(gdb)
(gdb)
(gdb) start
Breakpoint 1 at 0x804b7ac: file main.cpp, line 6.
Starting program: /home/gajendra/test/testkdoublespinbox/testkdoublespinbox
[Thread debugging using libthread_db enabled]
[New Thread 1092003168 (LWP 3732)]
[Switching to Thread 1092003168 (LWP 3732)]
main (argc=1, argv=0x0) at main.cpp:6
6 QApplication a( argc, argv );
(gdb) next
5 {
(gdb) next
7 Form1 w;
(gdb)
6 QApplication a( argc, argv );
(gdb)
5 {
(gdb)
7 Form1 w;
(gdb)
6 QApplication a( argc, argv );
(gdb)


Session management error: Could not open network socket
7 Form1 w;
(gdb)

Program received signal SIGSEGV, Segmentation fault.
0x40dbf92a in KLocale::doFormatInit () from /usr/lib/libkdecore.so.4
(gdb)
Single stepping until exit from function _ZNK7KLocale12doFormatInitEv,
which has no line number information.
Couldn't get registers: No such process.
(gdb)
Single stepping until exit from function _ZNK7KLocale12doFormatInitEv,
which has no line number information.
Cannot fetch general-purpose registers for thread 1092003168: generic error
(gdb)
Single stepping until exit from function _ZNK7KLocale12doFormatInitEv,
which has no line number information.
Cannot fetch general-purpose registers for thread 1092003168: generic error
(gdb)
Single stepping until exit from function _ZNK7KLocale12doFormatInitEv,
which has no line number information.
Cannot fetch general-purpose registers for thread 1092003168: generic error
(gdb)
Single stepping until exit from function _ZNK7KLocale12doFormatInitEv,
which has no line number information.
Cannot fetch general-purpose registers for thread 1092003168: generic error
(gdb)
Single stepping until exit from function _ZNK7KLocale12doFormatInitEv,
which has no line number information.
Cannot fetch general-purpose registers for thread 1092003168: generic error
(gdb)
Single stepping until exit from function _ZNK7KLocale12doFormatInitEv,
which has no line number information.
Cannot fetch general-purpose registers for thread 1092003168: generic error
(gdb)
Single stepping until exit from function _ZNK7KLocale12doFormatInitEv,
which has no line number information.
Cannot fetch general-purpose registers for thread 1092003168: generic error
(gdb)
Single stepping until exit from function _ZNK7KLocale12doFormatInitEv,
which has no line number information.
Cannot fetch general-purpose registers for thread 1092003168: generic error
(gdb)
Single stepping until exit from function _ZNK7KLocale12doFormatInitEv,
which has no line number information.
Cannot fetch general-purpose registers for thread 1092003168: generic error
(gdb)
Single stepping until exit from function _ZNK7KLocale12doFormatInitEv,
which has no line number information.
Cannot fetch general-purpose registers for thread 1092003168: generic error
(gdb)
Single stepping until exit from function _ZNK7KLocale12doFormatInitEv,
which has no line number information.
Cannot fetch general-purpose registers for thread 1092003168: generic error
(gdb)
Single stepping until exit from function _ZNK7KLocale12doFormatInitEv,
which has no line number information.
Cannot fetch general-purpose registers for thread 1092003168: generic error
(gdb)
Single stepping until exit from function _ZNK7KLocale12doFormatInitEv,
which has no line number information.
Cannot fetch general-purpose registers for thread 1092003168: generic error
(gdb)
Single stepping until exit from function _ZNK7KLocale12doFormatInitEv,
which has no line number information.
Cannot fetch general-purpose registers for thread 1092003168: generic error
(gdb)
Single stepping until exit from function _ZNK7KLocale12doFormatInitEv,
which has no line number information.
Cannot fetch general-purpose registers for thread 1092003168: generic error
(gdb)
Single stepping until exit from function _ZNK7KLocale12doFormatInitEv,
which has no line number information.
Cannot fetch general-purpose registers for thread 1092003168: generic error
(gdb)
Single stepping until exit from function _ZNK7KLocale12doFormatInitEv,
which has no line number information.
Cannot fetch general-purpose registers for thread 1092003168: generic error
(gdb)
Single stepping until exit from function _ZNK7KLocale12doFormatInitEv,
which has no line number information.
Cannot fetch general-purpose registers for thread 1092003168: generic error
(gdb)
Single stepping until exit from function _ZNK7KLocale12doFormatInitEv,
which has no line number information.
Cannot fetch general-purpose registers for thread 1092003168: generic error
(gdb)
Single stepping until exit from function _ZNK7KLocale12doFormatInitEv,
which has no line number information.
Cannot fetch general-purpose registers for thread 1092003168: generic error
(gdb)
Single stepping until exit from function _ZNK7KLocale12doFormatInitEv,
which has no line number information.
Cannot fetch general-purpose registers for thread 1092003168: generic error
(gdb)
Single stepping until exit from function _ZNK7KLocale12doFormatInitEv,
which has no line number information.
Cannot fetch general-purpose registers for thread 1092003168: generic error
(gdb)
Single stepping until exit from function _ZNK7KLocale12doFormatInitEv,
which has no line number information.
Cannot fetch general-purpose registers for thread 1092003168: generic error
(gdb)
Single stepping until exit from function _ZNK7KLocale12doFormatInitEv,
which has no line number information.
Cannot fetch general-purpose registers for thread 1092003168: generic error
(gdb)
Single stepping until exit from function _ZNK7KLocale12doFormatInitEv,
which has no line number information.
Cannot fetch general-purpose registers for thread 1092003168: generic error
(gdb)
Single stepping until exit from function _ZNK7KLocale12doFormatInitEv,
which has no line number information.
Cannot fetch general-purpose registers for thread 1092003168: generic error
(gdb)
Single stepping until exit from function _ZNK7KLocale12doFormatInitEv,
which has no line number information.
Cannot fetch general-purpose registers for thread 1092003168: generic error
(gdb)
Single stepping until exit from function _ZNK7KLocale12doFormatInitEv,
which has no line number information.
Cannot fetch general-purpose registers for thread 1092003168: generic error
(gdb)
Single stepping until exit from function _ZNK7KLocale12doFormatInitEv,
which has no line number information.
Cannot fetch general-purpose registers for thread 1092003168: generic error
(gdb)
Single stepping until exit from function _ZNK7KLocale12doFormatInitEv,
which has no line number information.
Cannot fetch general-purpose registers for thread 1092003168: generic error
(gdb)
Single stepping until exit from function _ZNK7KLocale12doFormatInitEv,
which has no line number information.
Cannot fetch general-purpose registers for thread 1092003168: generic error
(gdb)
Single stepping until exit from function _ZNK7KLocale12doFormatInitEv,
which has no line number information.
Cannot fetch general-purpose registers for thread 1092003168: generic error
(gdb)
Single stepping until exit from function _ZNK7KLocale12doFormatInitEv,
which has no line number information.
Cannot fetch general-purpose registers for thread 1092003168: generic error
(gdb)
Single stepping until exit from function _ZNK7KLocale12doFormatInitEv,
which has no line number information.
Cannot fetch general-purpose registers for thread 1092003168: generic error
(gdb)
Single stepping until exit from function _ZNK7KLocale12doFormatInitEv,
which has no line number information.
Cannot fetch general-purpose registers for thread 1092003168: generic error
(gdb)
Single stepping until exit from function _ZNK7KLocale12doFormatInitEv,
which has no line number information.
Cannot fetch general-purpose registers for thread 1092003168: generic error
(gdb)
Single stepping until exit from function _ZNK7KLocale12doFormatInitEv,
which has no line number information.
Cannot fetch general-purpose registers for thread 1092003168: generic error
(gdb)
Single stepping until exit from function _ZNK7KLocale12doFormatInitEv,
which has no line number information.
Cannot fetch general-purpose registers for thread 1092003168: generic error
(gdb)
Single stepping until exit from function _ZNK7KLocale12doFormatInitEv,
which has no line number information.
Cannot fetch general-purpose registers for thread 1092003168: generic error
(gdb)
Single stepping until exit from function _ZNK7KLocale12doFormatInitEv,
which has no line number information.
Cannot fetch general-purpose registers for thread 1092003168: generic error
(gdb)
Single stepping until exit from function _ZNK7KLocale12doFormatInitEv,
which has no line number information.
Cannot fetch general-purpose registers for thread 1092003168: generic error
(gdb)

I cannot make any head or tail of it. I tried replacing the QApplication definition with KApplication but I got some Message about some init function not being defined.
Can you offer some explanation from the gdb output?
Reply With Quote
  #11  
Old 23rd April 2007, 23:56
jacek jacek is offline
Guru
 
Join Date: Jan 2006
Location: Warsaw, Poland
Qt products used: Qt3 , Qt4
Qt platforms used: Unix/X11 , Windows
Posts: 5,369
Thanks: 28
Thanked 939 Times in 900 Posts
Default Re: KDE/QWT doubt on debian sarge

Quote:
Originally Posted by hildebrand View Post
I ran gdb with this program. The result is as follows:-
[...]
I cannot make any head or tail of it.
Better try:
Quote:
(gdb) run
...
Program received signal SIGSEGV, Segmentation fault.
0x40dbf92a in KLocale::doFormatInit () from /usr/lib/libkdecore.so.4
(gdb) bt
Quote:
Originally Posted by hildebrand View Post
Program received signal SIGSEGV, Segmentation fault.
0x40dbf92a in KLocale::doFormatInit () from /usr/lib/libkdecore.so.4
Again, this can be caused by lack of KApplication instance.

Quote:
Originally Posted by hildebrand View Post
I tried replacing the QApplication definition with KApplication but I got some Message about some init function not being defined.
You mean this message:
Quote:
FAILURE (KCmdLineArgs):
Application has not called KCmdLineArgs::init(...).
Just as it says, your application didn't invoke KCmdLineArgs::init(). See the link in my previous post and check the attached files.
Attached Files
File Type: pro kdetest.pro (312 Bytes, 6 views)
File Type: cpp main.cpp (315 Bytes, 9 views)
Reply With Quote
The following user says thank you to jacek for this useful post:
hildebrand (25th April 2007)
  #12  
Old 24th April 2007, 05:43
hildebrand hildebrand is offline
Beginner
 
Join Date: Apr 2007
Qt products used: Qt3
Qt platforms used: Unix/X11
Posts: 11
Thanks: 1
Thanked 0 Times in 0 Posts
Default Re: KDE/QWT doubt on debian sarge

Yes thats the message I was getting when I tried KApplication. I'll do as you say and get back. I think this is the problem.
Reply With Quote
  #13  
Old 25th April 2007, 04:18
hildebrand hildebrand is offline
Beginner
 
Join Date: Apr 2007
Qt products used: Qt3
Qt platforms used: Unix/X11
Posts: 11
Thanks: 1
Thanked 0 Times in 0 Posts
Default Re: KDE/QWT doubt on debian sarge

I modified the main.cpp file to be similar to the one you sent. My code is now compiling and working!! Thanks a lot.
As for the Qwt plugin, I knew that qwt4.2 is coming default with Debian Sarge. They do not seem to be bundling the plugin with the package. From the qwt website qwt.sourceforge.net I downloaded the source package for qwt4.2 which comes with plugin also within it. I compiled it and copied the libqwtplugin.so to the correct plugin location manually as root(make install was not copying it to correct location). Once I did that my qwt widgets now appear in qwt designer. Now I have to start using them!!
Reply With Quote
  #14  
Old 25th April 2007, 06:13
Uwe Uwe is offline
Advanced user
 
Join Date: Feb 2006
Location: Munich, Germany
Qt products used: Qt3 , Qt4 , Qt/Embedded , Qtopia
Qt platforms used: MacOS , Unix/X11 , Windows
Posts: 453
Thanks: 0
Thanked 94 Times in 88 Posts
Default Re: KDE/QWT doubt on debian sarge

Quote:
Originally Posted by hildebrand View Post
As for the Qwt plugin, I knew that qwt4.2 is coming default with Debian Sarge. They do not seem to be bundling the plugin with the package. From the qwt website qwt.sourceforge.net I downloaded the source package for qwt4.2 which comes with plugin also within it.
Qwt 4.2 is several years old. You already build your own Qwt library, so consider to start with Qwt 5.0.x: it works with Qt 3.3 and Qt 4.

Uwe
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
QT4 minimum requirements Debian GNU/Linux Sarge Everall Installation and Deployment 10 21st February 2006 12:21


All times are GMT +1. The time now is 02:26.


Powered by vBulletin Version 3.7.4 Copyright ©2000 - 2009, Jelsoft Enterprises Ltd., vRewrite 1.5 SEOed URLs completed by Tech Help Forum and Chalo Na.
© 2006–2009 Qt Centre - The Ultimate Qt Community site
Nokia, Qt and their respective logos are trademarks of Nokia Corporation in Finland and/or other countries worldwide.