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/DFBrowserPane_ItemDelegateButton.hxx>
@@ -27,38 +27,43 @@ const int ICON_SIZE = 20;
// function : Constructor
// purpose :
// =======================================================================
DFBrowserPane_ItemDelegateButton::DFBrowserPane_ItemDelegateButton (QObject* theParent, const QString& theIcon)
: QStyledItemDelegate (theParent)
DFBrowserPane_ItemDelegateButton::DFBrowserPane_ItemDelegateButton(QObject* theParent,
const QString& theIcon)
: QStyledItemDelegate(theParent)
{
myIcon = QIcon (theIcon);
myIcon = QIcon(theIcon);
}
// =======================================================================
// function : paint
// purpose :
// =======================================================================
void DFBrowserPane_ItemDelegateButton::paint (QPainter* thePainter, const QStyleOptionViewItem& theOption,
const QModelIndex& theIndex) const
void DFBrowserPane_ItemDelegateButton::paint(QPainter* thePainter,
const QStyleOptionViewItem& theOption,
const QModelIndex& theIndex) const
{
if (myFreeRows.contains (theIndex.row()))
if (myFreeRows.contains(theIndex.row()))
return;
int aWidth = std::min (theOption.rect.width(), ICON_SIZE);
int aHeight = std::min (theOption.rect.height(), ICON_SIZE);
int aWidth = std::min(theOption.rect.width(), ICON_SIZE);
int aHeight = std::min(theOption.rect.height(), ICON_SIZE);
QPoint aTopLeft = theOption.rect.topLeft();
thePainter->drawPixmap (QRect (theOption.rect.topLeft(), QPoint (aTopLeft.x() + aWidth, aTopLeft.y() + aHeight)),
myIcon.pixmap (ICON_SIZE, ICON_SIZE));
thePainter->drawPixmap(
QRect(theOption.rect.topLeft(), QPoint(aTopLeft.x() + aWidth, aTopLeft.y() + aHeight)),
myIcon.pixmap(ICON_SIZE, ICON_SIZE));
}
// =======================================================================
// function : editorEvent
// purpose :
// =======================================================================
bool DFBrowserPane_ItemDelegateButton::editorEvent (QEvent* theEvent, QAbstractItemModel* theModel,
const QStyleOptionViewItem& theOption, const QModelIndex& theIndex)
bool DFBrowserPane_ItemDelegateButton::editorEvent(QEvent* theEvent,
QAbstractItemModel* theModel,
const QStyleOptionViewItem& theOption,
const QModelIndex& theIndex)
{
if (theEvent->type() == QEvent::MouseButtonPress && !myFreeRows.contains (theIndex.row()))
emit buttonPressed (theIndex);
if (theEvent->type() == QEvent::MouseButtonPress && !myFreeRows.contains(theIndex.row()))
emit buttonPressed(theIndex);
return QStyledItemDelegate::editorEvent (theEvent, theModel, theOption, theIndex);
return QStyledItemDelegate::editorEvent(theEvent, theModel, theOption, theIndex);
}