Results 1 to 5 of 5

Thread: program crash on signalMapping QList

  1. #1
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Thanks
    116
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default program crash on signalMapping QList

    hi friends,

    i try to add QSignalMapping to QList having graphicsItem
    Qt Code:
    1. for(i =0; i<14; i++){
    2. mapValue[i] = i ;
    3. connect(list_item[i], SIGNAL(gpioPinSet()), signalMapper, SLOT(map()));
    4. signalMapper->setMapping(list_item[i],mapValue[i]);
    5. }
    6. connect(signalMapper, SIGNAL(mapped(int )), this, SIGNAL(gpioPinSet(int)));
    7. connect(this, SIGNAL(gpioPinSet(int )), this, SLOT(pin1Status(int )));
    To copy to clipboard, switch view to plain text mode 

    and the program crashed spitting
    *** glibc detected *** ./tidscreen: corrupted double-linked list: 0x09fbe9e8 ***
    ======= Backtrace: =========
    /lib/libc.so.6[0x322112b]
    /lib/libc.so.6[0x32230bd]
    /lib/libc.so.6(__libc_malloc+0x7e)[0x3224ebe]
    /usr/local/Trolltech/Qt-4.4.3/lib/libQtCore.so.4(_Z7qMallocj+0x1d)[0x3eb39fd]
    /usr/local/Trolltech/Qt-4.4.3/lib/libQtGui.so.4[0xb588e9]
    /usr/local/Trolltech/Qt-4.4.3/lib/libQtGui.so.4[0xb58c12]
    /usr/local/Trolltech/Qt-4.4.3/lib/libQtGui.so.4[0xb5197d]
    /usr/local/Trolltech/Qt-4.4.3/lib/libQtGui.so.4(_ZN4QCss6Parser4initERK7QStringb+0x8 b)[0xb51bbb]
    /usr/local/Trolltech/Qt-4.4.3/lib/libQtGui.so.4(_ZN4QCss6ParserC1ERK7QStringb+0x57)[0xb522b7]
    /usr/local/Trolltech/Qt-4.4.3/lib/libQtGui.so.4[0xb5254f]
    /usr/local/Trolltech/Qt-4.4.3/lib/libQtGui.so.4[0xb52bbd]
    /usr/local/Trolltech/Qt-4.4.3/lib/libQtGui.so.4(_ZN4QCss14ValueExtractor17extractBac kgroundEP6QBrushP7QStringPNS_6RepeatEP6QFlagsIN2Qt 13AlignmentFlagEEPNS_6OriginEPNS_10AttachmentESD_+ 0x41e)[0xb54b5e]
    please help ..
    "Behind every great fortune lies a crime" - Balzac

  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: program crash on signalMapping QList

    First I don't understand the use of
    Quote Originally Posted by wagmare View Post
    Qt Code:
    1. mapValue[i] = i ;
    2. // and
    3. connect(signalMapper, SIGNAL(mapped(int )), this, SIGNAL(gpioPinSet(int)));
    4. connect(this, SIGNAL(gpioPinSet(int )), this, SLOT(pin1Status(int )));
    To copy to clipboard, switch view to plain text mode 
    Couldn't you establish the connection between mapped and pin1Status direct?

    Anyway, how does the definition of mapValue and list_item look like?

  3. #3
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Thanks
    116
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: program crash on signalMapping QList

    QList<GpioItem *> list_item;
    int mapValue[12];

    GpioItem is a QGraphicsItem
    Last edited by wagmare; 22nd July 2009 at 16:03. Reason: explaining GpioItem
    "Behind every great fortune lies a crime" - Balzac

  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: program crash on signalMapping QList

    Quote Originally Posted by wagmare View Post
    int mapValue[12];
    then mapValue[13] = 13 ; is out of range...

  5. The following user says thank you to Lykurg for this useful post:

    wagmare (22nd July 2009)

  6. #5
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Thanks
    116
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: program crash on signalMapping QList

    see how stupid i am .. hahaha .. i am sitting with this for more than a hour .. thinking mapping() values and functions ... thank you vary much ..

    sorry to bother u all with this silly mistake ..
    "Behind every great fortune lies a crime" - Balzac

Similar Threads

  1. Program Crash
    By jonmatteo in forum Qt Programming
    Replies: 5
    Last Post: 17th June 2009, 14:47
  2. QListWidgetItem subclass - Crash program in drag/drop
    By estanisgeyer in forum Qt Programming
    Replies: 1
    Last Post: 17th April 2009, 09:24
  3. Program crash when a signal is emitted
    By croscato in forum Qt Programming
    Replies: 7
    Last Post: 22nd November 2008, 22:24
  4. QT MySQL
    By sabeeshcs in forum Newbie
    Replies: 6
    Last Post: 12th January 2007, 04:19
  5. QList crash in destructor
    By mclark in forum Newbie
    Replies: 7
    Last Post: 6th December 2006, 15:27

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.