ossp-pkg/as/as-gui/as_main.cpp
1.3
#include <qapplication.h>
#include <qtable.h>
#include <qimage.h>
#include <qpixmap.h>
#include <qstringlist.h>
#include "titraq.h"
// OSSP logo: static const char *ossplogo_xpm[]
#include "gfx/ossplogo.xpm"
// Table size
const int numRows = 10;
const int numCols = 6;
int main(int argc, char **argv)
{
QApplication App(argc, argv);
QTable table(numRows, numCols);
QHeader *header = table.horizontalHeader();
header->setLabel(0, QObject::tr("Klein"), 40);
header->setLabel(1, QObject::tr("Krasse Checkung"));
header->setLabel(5, QObject::tr("Combo Buxen"));
header->setMovingEnabled(TRUE);
QImage img(ossplogo_xpm);
QPixmap pix = img.scaleHeight(table.rowHeight(3));
table.setPixmap(3, 2, pix);
table.setText(3, 2, "OSSP");
QStringList comboEntries;
comboEntries << "uno" << "dos" << "tres" << "quatro";
for (int i = 0; i < numRows; ++i){
QComboTableItem * item = new QComboTableItem(&table, comboEntries, FALSE);
item->setCurrentItem(i % 4);
table.setItem(i, 5, item);
}
for (int j = 0; j < numRows; ++j)
table.setItem(j, 1, new QCheckTableItem(&table, "Checkung"));
// Titraqform *pMainform = new Titraqform;
// App.setMainWidget(pMainform);
// pMainform->show();
App.setMainWidget(&table);
table.show();
return App.exec();
}