Results 1 to 7 of 7

Thread: QVECTOR abnormally terminating the program

  1. #1
    Join Date
    Oct 2009
    Posts
    26
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    3

    Default QVECTOR abnormally terminating the program

    Hello,
    I wanted to create a QLabel array ...so i created a QVECTOR ..but the program terminates abnormamlly...
    where am i wrong??
    Thanks
    Attached Files Attached Files

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanked 268 Times in 268 Posts
    Wiki edits
    20

    Default Re: QVECTOR abnormally terminating the program

    Do you understand what a pointer is and that you can't use an uninitialised pointer?

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

    Nishant (16th October 2010)

  4. #3
    Join Date
    Oct 2009
    Posts
    26
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    3

    Default Re: QVECTOR abnormally terminating the program

    Yes...i do know i cant use an unitialised pointer..but can you please tell me where i am doing that..i am using vectors for the first time
    thanks

  5. #4
    Join Date
    Oct 2009
    Posts
    26
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    3

    Default Re: QVECTOR abnormally terminating the program

    ok...got that...i added a line for the vector l...but now its terminating when i click the add button.it says index out of range...nd why is that?
    Thanks

  6. #5
    Join Date
    Oct 2009
    Posts
    26
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    3

    Default Re: QVECTOR abnormally terminating the program

    ok...m uploading the updated code...but the ADD button is not working....someone please help me out...
    Attached Files Attached Files

  7. #6
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Wiki edits
    17

    Default Re: QVECTOR abnormally terminating the program

    Have you run the program in a debugger to find exactly where it crashes or breaks?
    Did you take any notice of the warning your compiler probably produced during compilations? GCC produces:
    Qt Code:
    1. frame.cpp: In member function ‘void frame::t1changed()’:
    2. frame.cpp:38: warning: ‘i’ may be used uninitialized in this function
    To copy to clipboard, switch view to plain text mode 
    Why might i be uninitialised here?
    What do you think that declaring a local variable int i inside a for() loop using i as its index will do?

  8. The following user says thank you to ChrisW67 for this useful post:

    Nishant (16th October 2010)

  9. #7
    Join Date
    Oct 2009
    Posts
    26
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    3

    Default Re: QVECTOR abnormally terminating the program

    Thanku everyone....resolved it nw..

Similar Threads

  1. Terminating a console app
    By cejohnsonsr in forum Newbie
    Replies: 3
    Last Post: 30th August 2010, 22:21
  2. designer behaved abnormally...
    By sh123 in forum Qt Tools
    Replies: 3
    Last Post: 10th January 2009, 13:01
  3. designer behaved abnormally...
    By sh123 in forum Qt Tools
    Replies: 1
    Last Post: 16th December 2008, 19:00
  4. Replies: 19
    Last Post: 21st January 2008, 10:13
  5. Terminating a thread.
    By kiranraj in forum Qt Programming
    Replies: 3
    Last Post: 9th July 2007, 12:14

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.