1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-04 13:13:25 +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:
nds
2018-03-04 19:10:56 +03:00
committed by bugmaster
parent 50c4757387
commit 130eb11405
159 changed files with 396 additions and 123 deletions

View File

@@ -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()),