Results 1 to 2 of 2

Thread: QListWidget Problem

  1. #1
    Join Date
    Sep 2007
    Posts
    20
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QListWidget Problem

    Hello Using Vista, Qt4.3.1 and Msvc 2005 pro

    I created a ui form in the QT Designer and I am loading it thru ui.setupUi;

    ui.setModel(indexModel);
    when I try to set the Model I get a this error.
    error C2248: 'QListWidget::setModel' : cannot access private member declared in class 'QListWidget'

    I have made a QListWidget and tried to setModel , works fine .
    QListWidget *dummy = new QListWidget();
    dummy->setMode(indexModel);

    I was wondering if anyone may have come across this one ,and what you did to fix it .

    thanks .

  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: QListWidget Problem

    Hi,

    You don't use a model with QListWidget. QListWidget has its own built-in private model which works with QListWidgetItems. This is why QListWidget::setModel() has been made private, you can't change it. Use QListView if you want to use a real model.
    J-P Nurmi

  3. The following 2 users say thank you to jpn for this useful post:

    Ondertitel (5th August 2012), pmabie (8th October 2007)

Similar Threads

  1. Replies: 13
    Last Post: 15th December 2006, 11:52
  2. Grid Layout Problem
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2006, 12:45
  3. Problem with bitBlt
    By yellowmat in forum Newbie
    Replies: 1
    Last Post: 5th April 2006, 14:08
  4. keypress while editing an item in QListWidget
    By Beluvius in forum Qt Programming
    Replies: 3
    Last Post: 4th April 2006, 09:56
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

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.