layoutDlg->setMargin(11);
// Create check box "Use Bounding Box Center"
- QHBoxLayout* aCheckBox = new QHBoxLayout(this);
+ QHBoxLayout* aCheckBox = new QHBoxLayout;
myIsBBCenter = new QCheckBox(tr("USE_BBCENTER"));
myIsBBCenter->setChecked(true);
{
if ( !activeView().IsNull() )
{
- activeView()->SetBackgroundColor( Quantity_TOC_RGB, color.red()/255.,
- color.green()/255., color.blue()/255.);
- activeView()->Update();
- emit vpChangeBGColor( color );
+ activeView()->SetBackgroundColor( Quantity_TOC_RGB, color.red()/255.,
+ color.green()/255., color.blue()/255.);
+ activeView()->Update();
+ emit vpChangeBGColor( color );
}
}
*/
void OCCViewer_ViewPort3d::fitAll( bool keepScale, bool withZ, bool upd )
{
- if ( activeView().IsNull() )
+ if ( activeView().IsNull() )
return;
else
{
int aState = theEvent->modifiers();
- int aButton = theEvent->button();
+ int aButton = theEvent->buttons();
if ( aButton == Qt::LeftButton ||
( aButton == Qt::LeftButton && aState == Qt::ShiftModifier ) ) {
myDrawRect = myEnableDrawMode;
}
}
}
- else {
+ else
emit mouseMoving( this, theEvent );
- }
}
}
}
case PANGLOBAL:
if ( theEvent->button() == Qt::LeftButton ) {
- myViewPort->setCenter( theEvent->x(), theEvent->y() );
+ myViewPort->setCenter( theEvent->x(), theEvent->y() );
myViewPort->getView()->SetScale(myCurScale);
- resetState();
- }
+ resetState();
+ }
break;
case WINDOWFIT:
if ( theEvent->button() == Qt::LeftButton ) {
- myCurrX = theEvent->x();
- myCurrY = theEvent->y();
- QRect rect = SUIT_Tools::makeRect(myStartX, myStartY, myCurrX, myCurrY);
- if ( !rect.isEmpty() ) myViewPort->fitRect(rect);
- resetState();
- }
+ myCurrX = theEvent->x();
+ myCurrY = theEvent->y();
+ drawRect();
+ QRect rect = SUIT_Tools::makeRect(myStartX, myStartY, myCurrX, myCurrY);
+ if ( !rect.isEmpty() ) myViewPort->fitRect(rect);
+ endDrawRect();
+ resetState();
+ }
break;
}
// so we must emit it BEFORE resetting the selection rectangle
if ( theEvent->button() == Qt::LeftButton && myDrawRect ) {
- myDrawRect = false;
drawRect();
endDrawRect();
resetState();
myIsNameVisible = new QCheckBox(tr("IS_VISIBLE"), myNameGrp);
aVBox->addWidget(myIsNameVisible);
- QHBoxLayout* aHBox = new QHBoxLayout(myNameGrp);
+ QHBoxLayout* aHBox = new QHBoxLayout;
aHBox->setSpacing(5);
QLabel* aLabel = new QLabel(tr("NAME"));
aHBox->addWidget(aLabel);
aLabels.append(aLabel);
aVBox->addLayout(aHBox);
- aHBox = new QHBoxLayout(myNameGrp);
+ aHBox = new QHBoxLayout;
aHBox->setSpacing(5);
aLabel = new QLabel(tr("FONT"));
aHBox->addWidget(aLabel);
myIsLabelsVisible = new QCheckBox(tr("IS_VISIBLE"), myLabelsGrp);
aVBox->addWidget(myIsLabelsVisible);
- aHBox = new QHBoxLayout(myLabelsGrp);
+ aHBox = new QHBoxLayout;
aHBox->setSpacing(5);
aLabel = new QLabel(tr("NUMBER"));
aHBox->addWidget(aLabel);
aLabels.append(aLabel);
aVBox->addLayout(aHBox);
- aHBox = new QHBoxLayout(myLabelsGrp);
+ aHBox = new QHBoxLayout;
aHBox->setSpacing(5);
aLabel = new QLabel(tr("OFFSET"));
aHBox->addWidget(aLabel);
aLabels.append(aLabel);
aVBox->addLayout(aHBox);
- aHBox = new QHBoxLayout(myLabelsGrp);
+ aHBox = new QHBoxLayout;
aHBox->setSpacing(5);
aLabel = new QLabel(tr("FONT"));
aHBox->addWidget(aLabel);
myIsTicksVisible = new QCheckBox(tr("IS_VISIBLE"), myTicksGrp);
aVBox->addWidget(myIsTicksVisible);
- aHBox = new QHBoxLayout(myTicksGrp);
+ aHBox = new QHBoxLayout;
aHBox->setSpacing(5);
aLabel = new QLabel(tr("LENGTH"));
aHBox->addWidget(aLabel);
layoutDlg->setMargin(11);
// Create check box "Use Bounding Box Center"
- QHBoxLayout* aCheckBox = new QHBoxLayout(this);
+ QHBoxLayout* aCheckBox = new QHBoxLayout;
myIsBBCenter = new QCheckBox(tr("USE_BBCENTER"));
myIsBBCenter->setChecked(true);
// Create croup button with radio buttons
myGroupBoxSel = new QGroupBox( "", this );
- QVBoxLayout *vbox = new QVBoxLayout;
+ QVBoxLayout *vbox = new QVBoxLayout( myGroupBoxSel );
vbox->setMargin(11);
vbox->addStretch(1);
vbox->addWidget(mySelectPoint);
connect(mySelectPoint, SIGNAL(clicked()), this, SLOT(onSelectPoint()));
- myGroupBoxSel->setLayout(vbox);
-
// Create croup box with grid layout
myGroupBoxCoord = new QGroupBox(this);
myGroupBoxCoord->setObjectName("GroupBox");