Can I ask a very silly question? OK. How do you compile something simple like this? All my work has been on projects that already have Makefile stuff installed.

rh
Well, whatever view you put in.


#include <QtCore/QtCore>
#include <QtGui/QtGui>

int main(int argc, char *argv[])
{
  QApplication app(argc, argv);

  QStandardItemModel m;
  QStandardItem * itA = new QStandardItem("A");
  itA->appendRow(new QStandardItem("A1"));
  itA->appendRow(new QStandardItem("A2"));
  QStandardItem * itB = new QStandardItem("B");
  itB->appendRow(new QStandardItem("B1"));
  itB->appendRow(new QStandardItem("B2"));
  m.invisibleRootItem()->appendRow(itA);
  m.invisibleRootItem()->appendRow(itB);

  QTreeView t;
  t.header()->hide();

  QComboBox w;
  w.setModel(&m);
  w.setView(&t);
  w.setMinimumContentsLength(10);
  w.show();
  t.expandAll();

  return app.exec();
}

Some signal handling is needed to make it work properly, but this should get you started if you want something like that.

Andre'

Reply via email to