Results 1 to 7 of 7

Thread: KPasswordEdit problem

  1. #1
    Join Date
    Oct 2009
    Posts
    13
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default KPasswordEdit problem

    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

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: KPasswordEdit problem

    may we can see the code, which causes the segmentation fault?

  3. #3
    Join Date
    Oct 2009
    Posts
    13
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: KPasswordEdit problem

    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

  4. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: KPasswordEdit problem

    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.

  5. #5
    Join Date
    Oct 2009
    Posts
    13
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: KPasswordEdit problem

    Quote Originally Posted by Lykurg View Post
    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

  6. #6
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: KPasswordEdit problem

    Quote Originally Posted by gd View Post
    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?

  7. #7
    Join Date
    Oct 2009
    Posts
    13
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: KPasswordEdit problem

    Quote Originally Posted by Lykurg View Post
    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

Similar Threads

  1. Problem with QAbstractListModel
    By eekhoorn12 in forum Qt Programming
    Replies: 3
    Last Post: 26th August 2009, 14:26
  2. Replies: 1
    Last Post: 23rd April 2009, 09:05
  3. Replies: 19
    Last Post: 3rd April 2009, 23:17
  4. Grid Layout Problem
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2006, 12:45
  5. fftw problem
    By lordy in forum General Programming
    Replies: 1
    Last Post: 16th March 2006, 21:36

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
  •  
Qt is a trademark of The Qt Company.