PDA

View Full Version : KPasswordEdit problem



gd
11th November 2009, 14:07
Hi

I've a problem with KPasswordEdit. I compile an application using this
widget, as soon as I open a window containing this widget, I got a
Segmentation fault signal, while I didn't get any warning nor any problem to
compile the application, did I miss anything? (I compile with the library
-lkdeui from kde3)

Qt version: 3.3.8
KDE version: 3.5.7

Bye

Lykurg
11th November 2009, 14:47
may we can see the code, which causes the segmentation fault?

gd
11th November 2009, 15:04
Sure! I did not include it before because it is really very basic.

Anyway here is the related part of my code:

KPasswordEdit *passwd;

passwd=new KPasswordEdit(set_TR_IP_group,"Password");
passwd->setGeometry(QRect(58,94,106,20));

As you can see I just define it and set its geometry. I cannot figure out what is wrong with that.

Bye

Lykurg
11th November 2009, 15:07
Well that's not the code that producing the problem. It's probably how you use it with layouts etc. So just debug to see in which line the app crashes and post the code of that function. Than we can tell you more.

EDIT: Just recognize you don't use layouts... Anyway, debug to get the line.

gd
11th November 2009, 16:23
Well that's not the code that producing the problem. It's probably how you use it with layouts etc. So just debug to see in which line the app crashes and post the code of that function. Than we can tell you more.

EDIT: Just recognize you don't use layouts... Anyway, debug to get the line.

Well, it seems the line causing the crash is

passwd=new KPasswordEdit(set_TR_IP_group,"Password");

I really don't know why.

This is the gdb output:

Program received signal SIGSEGV, Segmentation fault.
[Switch to Thread -1229744432 (LWP 3786]
0xb706997d in KInstance::config() from /usr/lib/libkdecore.so.4

#0 0xb706997d in KInstance::config () from /usr/lib/libkdecore.so.4
#1 0xb7062ab2 in KGlobal::config () from /usr/lib/libkdecore.so.4
#2 0xb7e1a033 in KPasswordEdit::KPasswordEdit () from /usr/lib/libkdeui.so.4
#3 0x0805e0f2 in MulisAcq (this=0xbf985be2, parent=0x0, name=0x0,modal=false,fl=0) at .ui/mulis_acq.cpp:347
#4 0x0804ddde in main ()

The line 387 is the one I have indicated before.
Is it a KDE bug???
Any suggestions to implement a passwordedit in different way??

Thank you in advance.
Bye

Lykurg
11th November 2009, 16:57
Any suggestions to implement a passwordedit in different way??

QLineEdit with a proper QLineEdit::setEchoMode(), but it seems that your problem is in KInstance::config(). Where do you call that?

gd
11th November 2009, 17:22
QLineEdit with a proper QLineEdit::setEchoMode(), but it seems that your problem is in KInstance::config(). Where do you call that?

Thank you! I have implemented the passwordedit using QLineEdit.

By the way I did not call KInstance explicitly in my code. Probably it is called internally when the KPasswordEdit is created.

Bye