Results 1 to 20 of 27

Thread: QT4.2 corrupted double-linked list and QRadioButton existance

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2007
    Location
    Warsaw, Poland
    Posts
    52
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    7

    Default Re: QT4.2 corrupted double-linked list and QRadioButton existance

    Below are links to working application (I have circumvented the problem above) and package of code files and file containing some data to test program (one humble *.dat file).

    Anyway, I would be glad if someone experienced checked some of my code for bugs and bad habits. I know it is difficult to ask you for such thing but marcel suggested such a solution himself.

    The "funny" thing is when I de-comment code connected to QTranslator in main.cpp I get SIGSEV gift.
    In other words I cannot translate my application using .ts file made by Linguist.

    So my inference is that there is some crucial memory management bug in MY code that sometimes throws irrational SIGSEV, blocking me of using certain normal ways of programming.

    I just cannot find it!

    Program and code package in:
    http://www.mjakobczyk.pl/pub/code/

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    8
    Thanked 541 Times in 521 Posts

    Default Re: QT4.2 corrupted double-linked list and QRadioButton existance

    I compiled your application( on Windows, Qt 4.3 ) but I cannot get it to crash( I uncommented the translator lines in main).
    Could you say what steps are involved?

    Regards

  3. #3
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts

    Default Re: QT4.2 corrupted double-linked list and QRadioButton existance

    Here's at least one issue that prevents it from launching for me:
    Qt Code:
    1. void MWin::initialization(void) {
    2. ...
    3. tableViewWidget = new MyMVC(list); // list is yet uninitialized
    4. ...
    5. list = new QList<MTR::Book>; // it's being initialized somewhere here afterwards
    6. ...
    7. }
    To copy to clipboard, switch view to plain text mode 
    I would suggest allocating QList objects on the stack and passing them as references. Allocating them on the heap is more error prone. QList is an implicitly shared class so unmodified copies are cheap.
    J-P Nurmi

  4. The following user says thank you to jpn for this useful post:

    mtrpoland (21st July 2007)

  5. #4
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    8
    Thanked 541 Times in 521 Posts

    Default Re: QT4.2 corrupted double-linked list and QRadioButton existance

    Yeah, that and correct the following from:
    Qt Code:
    1. namespace MTR {
    2. class Book;
    3. class SBook;
    4. }
    To copy to clipboard, switch view to plain text mode 

    to:
    Qt Code:
    1. namespace MTR {
    2. class Book;
    3. struct SBook;
    4. }
    To copy to clipboard, switch view to plain text mode 

    I was getting a few warnings and a linker error because of this.

    Regards

  6. The following user says thank you to marcel for this useful post:

    mtrpoland (21st July 2007)

  7. #5
    Join Date
    May 2007
    Location
    Warsaw, Poland
    Posts
    52
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    7

    Default Re: QT4.2 corrupted double-linked list and QRadioButton existance

    Gentlemen, now all indeed does work. A nod of respect. Thank you very much. Now I see that the key was what highlighted jpn. It destabilized my application.

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.