13 setWindowTitle( tr(
"Available US3 Runs..." ) );
17 QVBoxLayout*
main =
new QVBoxLayout(
this );
18 main->setSpacing ( 2 );
19 main->setContentsMargins( 2, 2, 2, 2 );
22 QFontMetrics* fm =
new QFontMetrics( font );
33 tw =
new QTableWidget(
runInfo.size(), 4, this );
42 tw->setHorizontalHeaderLabels( headers );
43 tw->verticalHeader()->hide();
44 tw->setShowGrid(
false );
45 tw->setSelectionBehavior( QAbstractItemView::SelectRows );
46 tw->setMinimumWidth( 640 );
47 tw->setMinimumHeight( 480 );
48 tw->setRowHeight( 0, fm->height() + 4 );
49 tw->setColumnWidth( 0, 50 );
50 tw->setColumnWidth( 1, 150 );
51 tw->setColumnWidth( 2, 250 );
52 tw->setColumnWidth( 3, 350 );
55 for (
int i = 0; i <
runInfo.size(); i++ )
59 QTableWidgetItem* item =
new QTableWidgetItem( QString::number( r.
ID ) );
60 item ->setFlags(item->flags() ^ Qt::ItemIsEditable);
61 tw ->setItem( i, 0, item );
63 item =
new QTableWidgetItem( r.
date );
64 item ->setFlags(item->flags() ^ Qt::ItemIsEditable);
65 tw ->setItem( i, 1, item );
67 item =
new QTableWidgetItem( r.
runID );
68 item ->setFlags(item->flags() ^ Qt::ItemIsEditable);
69 tw ->setItem( i, 2, item );
71 item =
new QTableWidgetItem( r.
label );
72 item ->setFlags(item->flags() ^ Qt::ItemIsEditable);
73 tw ->setItem( i, 3, item );
77 QHeaderView* qHeader =
tw ->horizontalHeader();
78 connect( qHeader, SIGNAL( sectionClicked(
int ) ),
81 main->addWidget(
tw );
84 QHBoxLayout* buttons =
new QHBoxLayout;
87 connect( pb_cancel, SIGNAL( clicked() ), SLOT( reject() ) );
88 buttons->addWidget( pb_cancel );
91 connect( pb_accept, SIGNAL( clicked() ), SLOT(
select() ) );
92 buttons->addWidget( pb_accept );
94 main->addLayout( buttons );
106 QMessageBox::information(
this,
108 tr(
"Error making the DB connection.\n" ) );
115 QStringList q(
"get_experiment_desc" );
119 expIDs << db.
value( 0 ).toString();
123 foreach ( QString
expID, expIDs )
126 q << QString(
"get_experiment_info" )
132 r.
ID = expID.toInt();
142 QMessageBox::information(
this,
144 tr(
"There are no US3 runs in the DB to load.\n" ) );
154 tw -> sortItems( col );
160 int ndx =
tw ->currentRow();
162 expID =
tw ->item( ndx, 0 )->text();