]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Porting to Qt4.
authormkr <mkr@opencascade.com>
Wed, 11 Jul 2007 12:19:50 +0000 (12:19 +0000)
committermkr <mkr@opencascade.com>
Wed, 11 Jul 2007 12:19:50 +0000 (12:19 +0000)
src/OCCViewer/OCCViewer_SetRotationPointDlg.cxx
src/OCCViewer/OCCViewer_ViewPort3d.cxx
src/OCCViewer/OCCViewer_ViewWindow.cxx
src/SVTK/SVTK_CubeAxesDlg.cxx
src/SVTK/SVTK_SetRotationPointDlg.cxx

index c102afdb4fe9e7d3ed851b7c8c1b0e52be352b57..db26945f3d0b53ec5b7a2b0de41ebef8ea561bc5 100644 (file)
@@ -55,7 +55,7 @@ OCCViewer_SetRotationPointDlg::OCCViewer_SetRotationPointDlg( OCCViewer_ViewWind
   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);
index 0c54717047ebd6534e4876db0eecbefff1d516f0..487c81d334136496dc3f98a7591d477083961251 100755 (executable)
@@ -256,10 +256,10 @@ void OCCViewer_ViewPort3d::setBackgroundColor( const QColor& color )
 {
        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 );
        }
 }
 
@@ -466,7 +466,7 @@ void OCCViewer_ViewPort3d::resizeEvent( QResizeEvent* e )
 */
 void OCCViewer_ViewPort3d::fitAll( bool keepScale, bool withZ, bool upd )
 {
-       if ( activeView().IsNull() )
+  if ( activeView().IsNull() )
     return;
 
 
index ae7bb38b02331c00ab84fcbdf46e2bc207550014..8ca50a10f34efcc9a05af391578e11e95660bc0d 100755 (executable)
@@ -689,7 +689,7 @@ void OCCViewer_ViewWindow::vpMouseMoveEvent(QMouseEvent* theEvent)
     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;
@@ -703,9 +703,8 @@ void OCCViewer_ViewWindow::vpMouseMoveEvent(QMouseEvent* theEvent)
          }
        }
       } 
-      else {
+      else
        emit mouseMoving( this, theEvent ); 
-      }        
     }  
   }
 }
@@ -739,20 +738,22 @@ void OCCViewer_ViewWindow::vpMouseReleaseEvent(QMouseEvent* 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;
   }
   
@@ -760,7 +761,6 @@ void OCCViewer_ViewWindow::vpMouseReleaseEvent(QMouseEvent* theEvent)
   // so we must emit it BEFORE resetting the selection rectangle
   
   if ( theEvent->button() == Qt::LeftButton && myDrawRect ) {
-    myDrawRect = false;
     drawRect();
     endDrawRect();
     resetState(); 
index a69b9a388ab29db42da9e0c211412e7ce23c469d..1258e98ed2b5f8e37a9b07f082d5d8a81117953e 100644 (file)
@@ -68,7 +68,7 @@ SVTK_AxisWidget::SVTK_AxisWidget (QWidget* theParent)
   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);
@@ -77,7 +77,7 @@ SVTK_AxisWidget::SVTK_AxisWidget (QWidget* theParent)
   aLabels.append(aLabel);
   aVBox->addLayout(aHBox);
 
-  aHBox = new QHBoxLayout(myNameGrp);
+  aHBox = new QHBoxLayout;
   aHBox->setSpacing(5);
   aLabel = new QLabel(tr("FONT"));
   aHBox->addWidget(aLabel);
@@ -96,7 +96,7 @@ SVTK_AxisWidget::SVTK_AxisWidget (QWidget* theParent)
   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);
@@ -106,7 +106,7 @@ SVTK_AxisWidget::SVTK_AxisWidget (QWidget* theParent)
   aLabels.append(aLabel);
   aVBox->addLayout(aHBox);
 
-  aHBox = new QHBoxLayout(myLabelsGrp);
+  aHBox = new QHBoxLayout;
   aHBox->setSpacing(5);
   aLabel = new QLabel(tr("OFFSET"));
   aHBox->addWidget(aLabel);
@@ -116,7 +116,7 @@ SVTK_AxisWidget::SVTK_AxisWidget (QWidget* theParent)
   aLabels.append(aLabel);
   aVBox->addLayout(aHBox);
 
-  aHBox = new QHBoxLayout(myLabelsGrp);
+  aHBox = new QHBoxLayout;
   aHBox->setSpacing(5);
   aLabel = new QLabel(tr("FONT"));
   aHBox->addWidget(aLabel);
@@ -135,7 +135,7 @@ SVTK_AxisWidget::SVTK_AxisWidget (QWidget* theParent)
   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);
index 50f8f69e80e956e0bd3fc0e633fca9b85516c97e..f6202845d87c9945556a4d3236892117baa1b6a1 100755 (executable)
@@ -72,7 +72,7 @@ SVTK_SetRotationPointDlg
   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);
@@ -81,7 +81,7 @@ SVTK_SetRotationPointDlg
 
   // 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);
   
@@ -98,8 +98,6 @@ SVTK_SetRotationPointDlg
   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");