mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0029310: Coding - multiple compiler warnings in Inspectors
1. Added specific header files to disable and restore compiler warnings: Standard_WarningsDisable.hxx, Standard_WarningsRestore.hxx. (Currently only MSVC compiler is handled.) 2. Inspector: compiler warnings are disabled for all includes of Qt headers. 3. Inspector: minor code correction to avoid warning due to use of floating point values in integer calculations.
This commit is contained in:
@@ -21,9 +21,11 @@
|
||||
#include <OSD_Path.hxx>
|
||||
#include <OSD_Protection.hxx>
|
||||
|
||||
#include <Standard_WarningsDisable.hxx>
|
||||
#include <QApplication>
|
||||
#include <QMainWindow>
|
||||
#include <QDir>
|
||||
#include <Standard_WarningsRestore.hxx>
|
||||
|
||||
// =======================================================================
|
||||
// function : CreateCommunicator
|
||||
|
@@ -31,8 +31,10 @@
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
|
||||
#include <Standard_WarningsDisable.hxx>
|
||||
#include <QObject>
|
||||
#include <QStringList>
|
||||
#include <Standard_WarningsRestore.hxx>
|
||||
|
||||
// =======================================================================
|
||||
// function : ToString
|
||||
|
@@ -21,8 +21,10 @@
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
#include <Standard_WarningsDisable.hxx>
|
||||
#include <QMap>
|
||||
#include <QVariant>
|
||||
#include <Standard_WarningsRestore.hxx>
|
||||
|
||||
class ShapeView_ItemShape;
|
||||
typedef QExplicitlySharedDataPointer<ShapeView_ItemShape> ShapeView_ItemShapePtr;
|
||||
|
@@ -16,6 +16,7 @@
|
||||
#include <inspector/ShapeView_OpenFileDialog.hxx>
|
||||
#include <inspector/ShapeView_OpenFileViewModel.hxx>
|
||||
|
||||
#include <Standard_WarningsDisable.hxx>
|
||||
#include <QGroupBox>
|
||||
#include <QHBoxLayout>
|
||||
#include <QHeaderView>
|
||||
@@ -34,6 +35,7 @@
|
||||
#include <QFileSystemModel>
|
||||
#include <QPushButton>
|
||||
#include <QToolButton>
|
||||
#include <Standard_WarningsRestore.hxx>
|
||||
|
||||
const int FONT_POINT_SIZE = 18;
|
||||
const int ICON_SIZE = 40;
|
||||
|
@@ -20,12 +20,11 @@
|
||||
#include <Standard_Macro.hxx>
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable : 4127) // conditional expression is constant
|
||||
#endif
|
||||
#include <Standard_WarningsDisable.hxx>
|
||||
#include <QDialog>
|
||||
#include <QItemSelection>
|
||||
#include <QStringList>
|
||||
#include <Standard_WarningsRestore.hxx>
|
||||
|
||||
#include <map>
|
||||
|
||||
|
@@ -15,10 +15,12 @@
|
||||
|
||||
#include <inspector/ShapeView_OpenFileViewModel.hxx>
|
||||
|
||||
#include <Standard_WarningsDisable.hxx>
|
||||
#include <QApplication>
|
||||
#include <QFileInfo>
|
||||
#include <QIcon>
|
||||
#include <QPainter>
|
||||
#include <Standard_WarningsRestore.hxx>
|
||||
|
||||
const int ICON_SIZE = 40;
|
||||
// =======================================================================
|
||||
@@ -35,11 +37,9 @@ void ShapeView_OpenFileItemDelegate::paint (QPainter* thePainter, const QStyleOp
|
||||
// action icon for all indices before the last one
|
||||
QIcon anIcon (":/icons/folder_import.png");
|
||||
QSize anIconSize (ICON_SIZE, ICON_SIZE);
|
||||
int aWidth = theOption.rect.width();
|
||||
int aCenter = aWidth / 2.;
|
||||
int aHalf = anIconSize.width() / 2.;
|
||||
int aDX = (theOption.rect.width() - anIconSize.width()) / 2;
|
||||
int aMargin = qApp->style()->pixelMetric (QStyle::PM_HeaderMargin);
|
||||
thePainter->drawPixmap (QRect (theOption.rect.left() + (aCenter - aHalf),
|
||||
thePainter->drawPixmap (QRect (theOption.rect.left() + aDX,
|
||||
theOption.rect.top() + aMargin,
|
||||
anIconSize.width(),
|
||||
anIconSize.height()),
|
||||
|
@@ -19,12 +19,11 @@
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Macro.hxx>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable : 4127) // conditional expression is constant
|
||||
#endif
|
||||
#include <Standard_WarningsDisable.hxx>
|
||||
#include <QAbstractTableModel>
|
||||
#include <QStringList>
|
||||
#include <QItemDelegate>
|
||||
#include <Standard_WarningsRestore.hxx>
|
||||
|
||||
class QObject;
|
||||
class QPainter;
|
||||
|
@@ -21,8 +21,10 @@
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <inspector/TreeModel_ModelBase.hxx>
|
||||
|
||||
#include <Standard_WarningsDisable.hxx>
|
||||
#include <QMap>
|
||||
#include <QObject>
|
||||
#include <Standard_WarningsRestore.hxx>
|
||||
|
||||
class ShapeView_TreeModel;
|
||||
|
||||
|
@@ -33,6 +33,7 @@
|
||||
#include <BRep_Builder.hxx>
|
||||
#include <BRepTools.hxx>
|
||||
|
||||
#include <Standard_WarningsDisable.hxx>
|
||||
#include <QApplication>
|
||||
#include <QAction>
|
||||
#include <QComboBox>
|
||||
@@ -51,6 +52,7 @@
|
||||
#include <QTreeView>
|
||||
#include <QWidget>
|
||||
#include <QVBoxLayout>
|
||||
#include <Standard_WarningsRestore.hxx>
|
||||
|
||||
const int FIRST_COLUMN_WIDTH = 190;
|
||||
const int SIZE_COLUMN_WIDTH = 30;
|
||||
|
@@ -21,9 +21,7 @@
|
||||
#include <inspector/TInspectorAPI_PluginParameters.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable : 4127) // conditional expression is constant
|
||||
#endif
|
||||
#include <Standard_WarningsDisable.hxx>
|
||||
#include <QItemSelection>
|
||||
#include <QList>
|
||||
#include <QModelIndexList>
|
||||
@@ -31,6 +29,7 @@
|
||||
#include <QPoint>
|
||||
#include <QString>
|
||||
#include <QTreeView>
|
||||
#include <Standard_WarningsRestore.hxx>
|
||||
|
||||
class View_Displayer;
|
||||
class View_Window;
|
||||
|
Reference in New Issue
Block a user