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
|
QWidget *
SoQtExaminerViewer:: buildBottomTrim(QWidget * parent)
{
QWidget * w = new QWidget(parent);
w->setFixedHeight(20);
QLabel * label = new QLabel(this->leftWheelStr, w);
label->adjustSize();
label->setAlignment(Qt::AlignLeft | Qt::AlignTop);
label->setMargin(2);
this->leftWheelLabel = label;
label = new QLabel(this->bottomWheelStr, w);
label->adjustSize();
label->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
label->setMargin(2);
this->bottomWheelLabel = label;
label = new QLabel(this->rightWheelStr, w);
label->adjustSize();
label->setAlignment(Qt::AlignRight | Qt::AlignTop);
label->setMargin(2);
this->rightWheelLabel = label;
SoQtThumbWheel * t = new SoQtThumbWheel(SoQtThumbWheel::Horizontal, w);
this->bottomWheel = t;
t->setRangeBoundaryHandling(SoQtThumbWheel::ACCUMULATE);
QObject::connect(t, SIGNAL(wheelMoved(float)),
PRIVATE(this), SLOT(bottomWheelChanged(float)));
QObject::connect(t, SIGNAL(wheelPressed()),
PRIVATE(this), SLOT(bottomWheelPressed()));
QObject::connect(t, SIGNAL(wheelReleased()),
PRIVATE(this), SLOT(bottomWheelReleased()));
this->bottomWheelVal = t->value();
QGridLayout * gl = new QGridLayout();
gl->setColStretch(0, 0);
gl->setColStretch(1, 0);
gl->setColStretch(2, 0);
gl->setColStretch(3, 1);
gl->setColStretch(4, 0);
gl->addWidget(this->leftWheelLabel, 0, 0, Qt::AlignVCenter | Qt::AlignHCenter);
gl->addWidget(this->bottomWheelLabel, 0, 1, Qt::AlignVCenter | Qt::AlignRight);
gl->addWidget(t, 0, 2, Qt::AlignVCenter | Qt::AlignLeft);
gl->addWidget(this->rightWheelLabel, 0, 4, Qt::AlignVCenter | Qt::AlignRight);
gl->activate()
return w;
} |
Partager