Results 1 to 13 of 13

Thread: Numerous functions with similar names/actions

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2007
    Location
    Ontario, Canada
    Posts
    22
    Thanks
    4
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Numerous functions with similar names/actions

    jpn, I have changed my code to what you suggested and it compiles but unforunately I am setgfaulting on an invalid call to show(); Do the object names need to be named like an array (ie, label[1]) or do they stay the same (ie, label1). I have created the UI in designer and it wont let me input square brackets into the object name. If I must name the object names as arrays I would have to modifiy the .ui manually.

    Is there anyway to determine the exact line that the program is failing on, gdb's output was:
    Program received signal SIGSEGV, Segmentation fault.
    [Switching to Thread -1223964144 (LWP 19874)]
    0x0804bd1b in QWidget::show (this=0x0) at /usr/include/qt4/QtGui/qwidget.h:463
    463 inline void show() { setVisible(true); }

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

    Default Re: Numerous functions with similar names/actions

    Quote Originally Posted by kramed View Post
    jpn, I have changed my code to what you suggested and it compiles but unforunately I am setgfaulting on an invalid call to show(); Do the object names need to be named like an array (ie, label[1]) or do they stay the same (ie, label1). I have created the UI in designer and it wont let me input square brackets into the object name.
    This happens because you have an uninitialized array of pointers. You must assign sensible values to pointers in the array. Unfortunately there is no way to tell designer to assign to a custom array. What you can do about it is to assign them by hand:
    Qt Code:
    1. setupUi(this);
    2. ass_labels[0] = ass_label1;
    3. ass_labels[1] = ass_label2;
    4. ...
    To copy to clipboard, switch view to plain text mode 

    Is there anyway to determine the exact line that the program is failing on, gdb's output was:
    Try command "bt" aka backtrace.
    J-P Nurmi

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

    kramed (14th August 2007)

  4. #3
    Join Date
    Aug 2007
    Location
    Ontario, Canada
    Posts
    22
    Thanks
    4
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Numerous functions with similar names/actions

    Thank you very much for the assistance, you have been a great help indeed.

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.