You are not logged in.

Dear visitor, welcome to KDE-Forum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

Ganymed

Beginner

  • "Ganymed" started this thread

Posts: 5

Location: Kassel (Germany)

  • Send private message

1

Friday, February 25th 2005, 7:29pm

Problems with KComboBox and KColorButton

Hi,
there is a widget which contains a KColorCombo element. I construct it normally with

Source code

1
KC_Color = new KColorCombo(this);

But when I open the widget (it is subclassed from QDialog), it crashes with "segmentation fault". What do I do wrong?? I have included the file <kcolorcombo.h> and I have linked -lkdeui and -lkdecore . It compiles and links normally (I am using SuSE 9.1).
The same happens when I put a KColorButton into the widget. It is shown and when I put a color on it manually, I can see how the Button changes its color which it should show. But when I click it, the application crashes also with the message "segmentation fault".

Mathias

wysota

Trainee

Posts: 65

Location: Warsaw, POLAND

  • Send private message

2

Friday, February 25th 2005, 8:01pm

RE: Problems with KComboBox and KColorButton

Use the debugger (like gdb) to see where the crash occurs.
Live and let live - use the search engine.
"Use the docs Luke, use the docs!"

Ganymed

Beginner

  • "Ganymed" started this thread

Posts: 5

Location: Kassel (Germany)

  • Send private message

3

Saturday, February 26th 2005, 11:43am

Hi,
gdb shows following:

Quoted


Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1099130752 (LWP 5338)]
0x404ac9fa in KInstance::config () from /opt/kde3/lib/libkdecore.so.4


I don't really know what this could be...

wysota

Trainee

Posts: 65

Location: Warsaw, POLAND

  • Send private message

4

Saturday, February 26th 2005, 11:56am

Do a backtrace (bt)
Live and let live - use the search engine.
"Use the docs Luke, use the docs!"

Ganymed

Beginner

  • "Ganymed" started this thread

Posts: 5

Location: Kassel (Germany)

  • Send private message

5

Saturday, February 26th 2005, 5:03pm

This is the result given by bt

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#0  0x404ac9fa in KInstance::config () from /opt/kde3/lib/libkdecore.so.4
#1  0x404ae212 in KGlobal::config () from /opt/kde3/lib/libkdecore.so.4
#2  0x404aeb22 in KGlobalSettings::showIconsOnPushButtons ()
   from /opt/kde3/lib/libkdecore.so.4
#3  0x402035b7 in KPushButton::readSettings () from /opt/kde3/lib/libkdeui.so.4
#4  0x4021cfab in KPushButton::init () from /opt/kde3/lib/libkdeui.so.4
#5  0x4021d1af in KPushButton::KPushButton () from /opt/kde3/lib/libkdeui.so.4
#6  0x4021d1f7 in KDialogBaseButton::KDialogBaseButton ()
   from /opt/kde3/lib/libkdeui.so.4
#7  0x4021d280 in (anonymous namespace)::SButton::append ()
   from /opt/kde3/lib/libkdeui.so.4
#8  0x4026d115 in KDialogBase::makeButtonBox ()
   from /opt/kde3/lib/libkdeui.so.4
#9  0x40290eef in KDialogBase::KDialogBase () from /opt/kde3/lib/libkdeui.so.4
#10 0x00000025 in ?? ()
#11 0x00000004 in ?? ()
#12 0xbfffe360 in ?? ()
#13 0xbfffe370 in ?? ()
#14 0xbfffe380 in ?? ()
#15 0x01ffe350 in ?? ()
#16 0x40362dbc in __JCR_LIST__ () from /opt/kde3/lib/libkdeui.so.4
#17 0xbfffe360 in ?? ()
#18 0xbfffe370 in ?? ()
---Type <return> to continue, or q <return> to quit---
#19 0xbfffe3a8 in ?? ()
#20 0x402a9ceb in KColorDialog::KColorDialog ()
   from /opt/kde3/lib/libkdeui.so.4
#21 0x40017a82 in ?? ()
#22 0x0831fee8 in ?? ()
#23 0x08394b60 in ?? ()
#24 0x0837ba98 in ?? ()
#25 0x080cc3b0 in ?? ()
#26 0x0837cbd8 in ?? ()
#27 0x00000000 in ?? ()
#28 0x083935a8 in ?? ()
#29 0x00000000 in ?? ()
#30 0x4034c814 in vtable for KDialogBase () from /opt/kde3/lib/libkdeui.so.4
#31 0x03400201 in ?? ()
#32 0x08382b50 in ?? ()
#33 0x00000001 in ?? ()
#34 0x00000000 in ?? ()
#35 0x03400201 in ?? ()
#36 0x00040019 in ?? ()
#37 0x040041e3 in ?? ()
#38 0x40c2b400 in av_ () from /usr/lib/libqt.so.3
#39 0x00000100 in ?? ()
#40 0x000000e6 in ?? ()
---Type <return> to continue, or q <return> to quit---
#41 0x000002ff in ?? ()
#42 0x00000218 in ?? ()
#43 0xffeeeeee in ?? ()
#44 0xffeeeeee in ?? ()
#45 0x0817a618 in ?? ()
#46 0x08179098 in ?? ()
#47 0x00000000 in ?? ()
#48 0x08379708 in ?? ()
#49 0x00000000 in ?? ()
#50 0x00000000 in ?? ()
#51 0x08394440 in ?? ()
#52 0xbfffe4a0 in ?? ()
#53 0x00000000 in ?? ()
#54 0x00000000 in ?? ()
#55 0x00000000 in ?? ()
#56 0x00000000 in ?? ()
#57 0x08393d70 in ?? ()
#58 0x00000000 in ?? ()
#59 0x080bc0a0 in ?? ()
#60 0x080bc0a0 in ?? ()
#61 0x080bc0a0 in ?? ()
#62 0x00000000 in ?? ()
#63 0x00000000 in ?? ()
---Type <return> to continue, or q <return> to quit---
#64 0x00000020 in ?? ()
#65 0x083926b8 in ?? ()
#66 0x08394b60 in ?? ()
#67 0xbfffe4d0 in ?? ()
#68 0xbfffe4f8 in ?? ()
#69 0x4000ca40 in _dl_runtime_resolve () from /lib/ld-linux.so.2
#70 0x402ae15d in KColorButton::chooseColor () from /opt/kde3/lib/libkdeui.so.4
Previous frame inner to this frame (corrupt stack?)

wysota

Trainee

Posts: 65

Location: Warsaw, POLAND

  • Send private message

6

Saturday, February 26th 2005, 5:22pm

Hmm... You either have an incorrectly compiled program (try make clean && make) or you have a problem with some icons or settings.
Live and let live - use the search engine.
"Use the docs Luke, use the docs!"

Ganymed

Beginner

  • "Ganymed" started this thread

Posts: 5

Location: Kassel (Germany)

  • Send private message

7

Saturday, February 26th 2005, 6:39pm

My program is compiled properly. I have tried to do make clean and make. But the error occurs on SuSE 9.1 and on Gentoo. The code cannot be wrong because I only construct it as described. The point is, that the error only occurs, when I click on the button. I try to get out, what message gdb gives when I use a KColorCombo, perhaps another.

I try to write an app which contains only a KColorCombo to look whether it depends on my app or on missing components, as you said.

anda_skoa

Professional

Posts: 1,273

Location: Graz, Austria

Occupation: Software Developer

  • Send private message

8

Wednesday, March 2nd 2005, 2:17pm

Maybe your are having a QApplication instance instead of KApplication

Cheers,
_
Qt/KDE Developer
Debian User

Ganymed

Beginner

  • "Ganymed" started this thread

Posts: 5

Location: Kassel (Germany)

  • Send private message

9

Wednesday, March 2nd 2005, 5:37pm

Thats right, I have a pure Qt-Application. Is this wrong? How can I "repair" this without modifying THE WHOLE app? I thought, that this would be no problem, because KColorCombo is subclassed from QComboBox.

anda_skoa

Professional

Posts: 1,273

Location: Graz, Austria

Occupation: Software Developer

  • Send private message

10

Saturday, March 5th 2005, 4:03pm

You don't have to modify the whole app, you just need to create KApplications instead of QApplication in main.cpp.

But maybe it is sufficient to just create a KInstance instance.

Cheers,
_
Qt/KDE Developer
Debian User