1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

Coding - Apply .clang-format formatting #286

Update empty method guards to new style with regex (see PR).
Used clang-format 18.1.8.
New actions to validate code formatting is added.
Update .clang-format with disabling of include sorting.
  It is temporary changes, then include will be sorted.
Apply formatting for /src and /tools folder.
The files with .hxx,.cxx,.lxx,.h,.pxx,.hpp,*.cpp extensions.
This commit is contained in:
dpasukhi
2025-01-25 20:15:22 +00:00
parent dbba6f1289
commit a5a7b3185b
14005 changed files with 1273539 additions and 1195567 deletions

View File

@@ -11,7 +11,7 @@
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
// commercial license or contractual agreement.
#include <inspector/TInspector_OpenFileViewModel.hxx>
@@ -28,32 +28,33 @@ const int ICON_SIZE = 40;
// function : paint
// purpose :
// =======================================================================
void TInspectorEXE_OpenFileItemDelegate::paint (QPainter* thePainter, const QStyleOptionViewItem& theOption,
const QModelIndex& theIndex) const
void TInspectorEXE_OpenFileItemDelegate::paint(QPainter* thePainter,
const QStyleOptionViewItem& theOption,
const QModelIndex& theIndex) const
{
// highlight cell
if (theOption.state & QStyle::State_MouseOver)
thePainter->fillRect (theOption.rect, myColor);
thePainter->fillRect(theOption.rect, myColor);
// action icon for all indices before the last one
QIcon anIcon (":folder_import.png");
QSize anIconSize (ICON_SIZE, ICON_SIZE);
int aDX = (theOption.rect.width() - anIconSize.width()) / 2;
int aMargin = qApp->style()->pixelMetric (QStyle::PM_HeaderMargin);
thePainter->drawPixmap (QRect (theOption.rect.left() + aDX,
theOption.rect.top() + aMargin,
anIconSize.width(),
anIconSize.height()),
anIcon.pixmap(anIconSize.width(), anIconSize.height()));
QIcon anIcon(":folder_import.png");
QSize anIconSize(ICON_SIZE, ICON_SIZE);
int aDX = (theOption.rect.width() - anIconSize.width()) / 2;
int aMargin = qApp->style()->pixelMetric(QStyle::PM_HeaderMargin);
thePainter->drawPixmap(QRect(theOption.rect.left() + aDX,
theOption.rect.top() + aMargin,
anIconSize.width(),
anIconSize.height()),
anIcon.pixmap(anIconSize.width(), anIconSize.height()));
// default paint
QItemDelegate::paint (thePainter, theOption, theIndex);
QItemDelegate::paint(thePainter, theOption, theIndex);
}
// =======================================================================
// function : Init
// purpose :
// =======================================================================
void TInspector_OpenFileViewModel::Init (const QStringList& theValues)
void TInspector_OpenFileViewModel::Init(const QStringList& theValues)
{
myValues = theValues;
}
@@ -62,14 +63,18 @@ void TInspector_OpenFileViewModel::Init (const QStringList& theValues)
// function : data
// purpose :
// =======================================================================
QVariant TInspector_OpenFileViewModel::data (const QModelIndex& theIndex, int theRole) const
QVariant TInspector_OpenFileViewModel::data(const QModelIndex& theIndex, int theRole) const
{
switch (theRole)
{
case Qt::DisplayRole: return QFileInfo (myValues[theIndex.column()]).fileName();
case Qt::ToolTipRole: return myValues[theIndex.column()];
case Qt::TextAlignmentRole: return QVariant (Qt::AlignBottom | Qt::AlignHCenter);
default: break;
case Qt::DisplayRole:
return QFileInfo(myValues[theIndex.column()]).fileName();
case Qt::ToolTipRole:
return myValues[theIndex.column()];
case Qt::TextAlignmentRole:
return QVariant(Qt::AlignBottom | Qt::AlignHCenter);
default:
break;
}
return QVariant();
}