The String Lists Model : QStringListModel « Qt « C++






The String Lists Model

  

#include <QtGui>

int main(int argc, char* argv[])
{
  QApplication app(argc, argv);
  QStringListModel model;
  QStringList toBuy;
  toBuy << "A" << "B"    << "C" << "D";
  model.setStringList(toBuy);
  QListViewview;
  view.setModel(&model);
  view.show();
  return app.exec();
}

   
    
  








Related examples in the same category

1.QStringListModel and QStringList 2