1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
| //stapellayout/stapelwidgetone.cpp
#include <QtGui>
#include <QApplication>
#include <QPoint>
#include "stapelwidgetone.h"
StapelWidgetOne::StapelWidgetOne( QWidget*parent): QFrame(parent)
{
//lay = new QGridLayout(frame);
pageTreeWidget = new QTreeWidget(this);
pageTreeWidget->setColumnCount(1);
QStringList headers;
headers<<tr("PatientInformation");
pageTreeWidget->setHeaderLabels(headers);
widgetStack = new QStackedWidget(this);
QPoint point ( pageTreeWidget->pos() );
widgetStack->move( point.x(), point.y()+ 192);
picture = new QTreeWidgetItem(pageTreeWidget);
picturechild = new QTreeWidgetItem(picture);
picture->setText(0,tr("Picture"));
picturechild->setText(0,tr("PictureChild"));
patient = new QTreeWidgetItem(pageTreeWidget);
patient->setText(0,tr("Patient"));
saveButton = new QPushButton("Load new Image");
saveButton->setEnabled(true);
connect ( saveButton, SIGNAL( clicked() ), this, SLOT() );
selectSave = new QRadioButton("select");
groupLayout = new QGroupBox("Image");
vBox = new QVBoxLayout(groupLayout);
vBox->addWidget(saveButton);
int selectId = widgetStack->addWidget(selectSave);
int groupId = widgetStack->addWidget(groupLayout);
//Signal-Slot-Verbindung einrichten
connect( pageTreeWidget, SIGNAL( itemActivated ( pageTreeWidget->currentItem() ,1 ) ),
widgetStack, SLOT( setCurrentIndex( int) ) );
}
void StapelWidgetOne::widgetInsert(QWidget *wid)
{
widgetStack->addWidget(wid);
} |
Partager