]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Porting on new SALOME
authorvsv <vitaly.smetannikov@opencascade.com>
Wed, 21 Dec 2016 16:11:30 +0000 (19:11 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Wed, 21 Dec 2016 16:11:30 +0000 (19:11 +0300)
src/XGUI/XGUI_ObjectsBrowser.cpp
src/XGUI/XGUI_ObjectsBrowser.h
src/XGUI/XGUI_Workshop.cpp

index 5fb0e655b623e63ed9512a24b8f503e18616b252..077f9724befa7d6714d03068e42c3fa6513e095c 100644 (file)
 #include <QStyledItemDelegate>
 #include <QMessageBox>
 
-#ifdef WIN32
-#ifdef HAVE_SALOME
-// PORTING_TO_SALOME_8
-//#include <QWindowsStyle>
-#include <QCommonStyle>
-#endif
-#endif
-
 
 /// Width of second column (minimum acceptable = 27)
 #define SECOND_COL_WIDTH 30
@@ -70,15 +62,6 @@ private:
 XGUI_DataTree::XGUI_DataTree(QWidget* theParent)
     : QTreeView(theParent)
 {
-//#ifdef WIN32
-//#ifdef HAVE_SALOME
-//  setStyle(new QCommonStyle());
-//#else
-//  myStyle = new XGUI_TreeViewStyle();
-//  setStyle(myStyle);
-//#endif
-//#endif
-
   setHeaderHidden(true);
   setEditTriggers(QAbstractItemView::NoEditTriggers);
   setSelectionBehavior(QAbstractItemView::SelectRows);
@@ -140,7 +123,7 @@ void XGUI_DataTree::resizeEvent(QResizeEvent* theEvent)
   QTreeView::resizeEvent(theEvent);
   QSize aSize = theEvent->size();
   if (aSize.isValid()) {
-    setColumnWidth(0, aSize.width() - SECOND_COL_WIDTH - 6);
+    setColumnWidth(0, aSize.width() - SECOND_COL_WIDTH - 7);
     setColumnWidth(1, SECOND_COL_WIDTH);
   }
 }
@@ -189,39 +172,6 @@ void XGUI_DataTree::onDoubleClick(const QModelIndex& theIndex)
   }
 }
 
-//#if (!defined HAVE_SALOME) && (defined WIN32)
-//void XGUI_DataTree::drawRow(QPainter* thePainter,
-//                            const QStyleOptionViewItem& theOptions,
-//                            const QModelIndex& theIndex) const
-//{
-//  QStyleOptionViewItemV4 aOptions = theOptions;
-//  myStyle->setIndex(theIndex);
-//  QTreeView::drawRow(thePainter, aOptions, theIndex);
-//}
-//
-////********************************************************************
-////********************************************************************
-////********************************************************************
-//void XGUI_TreeViewStyle::drawPrimitive(PrimitiveElement theElement,
-//                                       const QStyleOption* theOption,
-//                                       QPainter* thePainter, const QWidget* theWidget) const
-//{
-//  if ((theElement == QStyle::PE_PanelItemViewRow) || (theElement == QStyle::PE_PanelItemViewItem)) {
-//    const QStyleOptionViewItemV4* aOptions =
-//      qstyleoption_cast<const QStyleOptionViewItemV4 *>(theOption);
-//    if (myIndex.isValid() && ((myIndex.flags() & Qt::ItemIsSelectable) == 0)) {
-//      QStyle::State aState = aOptions->state;
-//      if ((aState & QStyle::State_MouseOver) != 0)
-//        aState &= ~QStyle::State_MouseOver;
-//      QStyleOptionViewItemV4* aOpt = (QStyleOptionViewItemV4*) aOptions;
-//      aOpt->state = aState;
-//      QCommonStyle::drawPrimitive(theElement, aOpt, thePainter, theWidget);
-//    }
-//  }
-//  QCommonStyle::drawPrimitive(theElement, theOption, thePainter, theWidget);
-//}
-//#endif
-
 
 //********************************************************************
 //********************************************************************
index 28a01ca2fe3c96c0545311109f80710edc4df3cd..129a7b2df1c31f00c0a120f608a4f466fc86fe60 100644 (file)
@@ -62,29 +62,6 @@ private:
 };
 
 
-//#if (!defined HAVE_SALOME) && (defined WIN32)
-//#include <QCommonStyle>
-//  /**
-//* \ingroup GUI
-//* Implementation of XGUI_DataTree custom style
-//*/
-//class XGUI_TreeViewStyle : public QCommonStyle // PORTING_TO_SALOME_8 QWindowsVistaStyle
-//{
-//  Q_OBJECT
-//public:
-//  XGUI_TreeViewStyle() : QCommonStyle/*QWindowsVistaStyle*/() {}
-//
-//  void drawPrimitive(PrimitiveElement theElement, const QStyleOption* theOption,
-//                     QPainter* thePainter, const QWidget* theWidget = 0) const;
-//
-//  void setIndex(const QModelIndex& theIndex) { myIndex = theIndex; }
-//  QModelIndex index() const { return myIndex; }
-//
-//private:
-//  QModelIndex myIndex;
-//};
-//#endif
-
 /**
 * \ingroup GUI
 * Implementation of Data Tree object for Object Browser
@@ -123,14 +100,6 @@ public slots:
 
    /// Redefinition of virtual method
   virtual void resizeEvent(QResizeEvent* theEvent);
-
-//#if (!defined HAVE_SALOME) && (defined WIN32)
-//  virtual void drawRow(QPainter* thePainter,
-//                        const QStyleOptionViewItem& theOptions,
-//                        const QModelIndex& theIndex) const;
-//private:
-//  XGUI_TreeViewStyle* myStyle;
-//#endif
 };
 
 /**\class XGUI_ObjectsBrowser
index 0cfa51c9acaa68c4f28de734d3d6ccc0cbc7a5d3..aff1c707a70c6907a297cabbcca8426b99e8a549 100755 (executable)
@@ -905,9 +905,7 @@ bool XGUI_Workshop::onSaveAs()
   QFileDialog dialog(desktop());
   dialog.setWindowTitle(tr("Select directory to save files..."));
   dialog.setFileMode(QFileDialog::Directory);
-  // PORTING_TO_SALOME_8
-  dialog.selectNameFilter(tr("Directories (*)"));
-  //dialog.setFilter(tr("Directories (*)");
+  dialog.setFilter(QDir::AllDirs);
   dialog.setOptions(QFileDialog::HideNameFilterDetails | QFileDialog::ShowDirsOnly);
   dialog.setViewMode(QFileDialog::Detail);