Results 1 to 4 of 4

Thread: Segmentation Faul using addItem (QListWidget)

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 370 Times in 336 Posts

    Default Re: Segmentation Faul using addItem (QListWidget)

    the mistake in ctor
    Qt Code:
    1. QLabel *playerLabel = new QLabel(tr("Players:"));
    2. QListWidget *playerView = new QListWidget();
    To copy to clipboard, switch view to plain text mode 

    must be
    Qt Code:
    1. playerLabel = new QLabel(tr("Players:"));
    2. playerView = new QListWidget();
    To copy to clipboard, switch view to plain text mode 
    becuase you already have playerLabel, playerView as class member variables.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  2. #2

    Default Re: Segmentation Faul using addItem (QListWidget)

    thank you spirit, it runs perfectly fine now!

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.