From 4135cf44de6fa00628c5e18559cebbc9c3e87b54 Mon Sep 17 00:00:00 2001 From: Hugues Delorme Date: Thu, 13 Jun 2024 09:58:57 +0200 Subject: [PATCH] App: fix code indentation issues --- src/app/app_module_properties.cpp | 65 +++++++++++++------------ src/app/button_flat.cpp | 8 +-- src/app/command_system_information.cpp | 33 ++++++++----- src/app/commands_display.cpp | 15 +++--- src/app/commands_file.cpp | 4 +- src/app/commands_tools.cpp | 3 +- src/app/commands_window.cpp | 6 ++- src/app/dialog_about.cpp | 2 +- src/app/dialog_options.cpp | 6 ++- src/app/dialog_save_image_view.cpp | 42 +++++++--------- src/app/dialog_task_manager.cpp | 5 +- src/app/property_editor_factory.cpp | 3 +- src/app/property_item_delegate.cpp | 39 ++++++++------- src/app/property_item_delegate.h | 16 ++---- src/app/proxy_styled_item_delegate.cpp | 15 +++--- src/app/proxy_styled_item_delegate.h | 24 +++------ src/app/qstring_utils.cpp | 6 +-- src/app/qtwidgets_utils.cpp | 9 ++-- src/app/qtwidgets_utils.h | 24 ++++----- src/app/widget_clip_planes.cpp | 8 +-- src/app/widget_file_system.cpp | 12 +++-- src/app/widget_grid.cpp | 43 ++++++++-------- src/app/widget_home_files.cpp | 1 - src/app/widget_model_tree.h | 12 +++-- src/app/widget_model_tree_builder_xde.h | 2 +- src/app/widget_properties_editor.cpp | 10 ++-- src/qtcommon/qtcore_utils.h | 15 ++++-- 27 files changed, 220 insertions(+), 208 deletions(-) diff --git a/src/app/app_module_properties.cpp b/src/app/app_module_properties.cpp index ade11d58..949be85b 100644 --- a/src/app/app_module_properties.cpp +++ b/src/app/app_module_properties.cpp @@ -161,76 +161,77 @@ void AppModuleProperties::retranslate() // Application this->language.setDescription( - textIdTr("Language used for the application. Change will take effect after application restart") + textIdTr("Language used for the application. Change will take effect after application restart") ); this->reloadDocumentOnFileChange.setDescription( textIdTr("Monitors the file system for changes to documents opened in the application\n\n" "When such a file change is detected then the application proposes to reload(open again) the document") ); this->linkWithDocumentSelector.setDescription( - textIdTr("In case where multiple documents are opened, make sure the document displayed in " - "the 3D view corresponds to what is selected in the model tree") + textIdTr("In case where multiple documents are opened, make sure the document displayed in " + "the 3D view corresponds to what is selected in the model tree") ); this->forceOpenGlFallbackWidget.setDescription( - textIdTr("Force usage of the fallback Qt widget to display OpenGL graphics.\n\n" - "When `OFF` the application will try to use OpenGL framebuffer for rendering, " - "this allows to display overlay widgets(eg measure tools panel) with translucid " - "background. " - "However using OpenGL framebuffer might cause troubles for some users(eg empty " - "3D window) especially on macOS.\n\n" - "When `ON` the application will use a regular Qt widget for rendering which " - "proved to be more supported.\n\n" - "This option is applicable when OpenCascade ≥ 7.6 version. " - "Change will take effect after application restart") + textIdTr("Force usage of the fallback Qt widget to display OpenGL graphics.\n\n" + "When `OFF` the application will try to use OpenGL framebuffer for rendering, " + "this allows to display overlay widgets(eg measure tools panel) with translucid " + "background. " + "However using OpenGL framebuffer might cause troubles for some users(eg empty " + "3D window) especially on macOS.\n\n" + "When `ON` the application will use a regular Qt widget for rendering which " + "proved to be more supported.\n\n" + "This option is applicable when OpenCascade ≥ 7.6 version. " + "Change will take effect after application restart") ); // Meshing this->meshingQuality.setDescription( - textIdTr("Controls precision of the mesh to be computed from the BRep shape") + textIdTr("Controls precision of the mesh to be computed from the BRep shape") ); this->meshingChordalDeflection.setDescription( - textIdTr("For the tessellation of faces the chordal deflection limits the distance between " - "a curve and its tessellation") + textIdTr("For the tessellation of faces the chordal deflection limits the distance between " + "a curve and its tessellation") ); this->meshingAngularDeflection.setDescription( - textIdTr("For the tessellation of faces the angular deflection limits the angle between " - "subsequent segments in a polyline") + textIdTr("For the tessellation of faces the angular deflection limits the angle between " + "subsequent segments in a polyline") ); this->meshingRelative.setDescription( - textIdTr("Relative computation of edge tolerance\n\n" - "If activated, deflection used for the polygonalisation of each edge will be " - "`ChordalDeflection` × `SizeOfEdge`. The deflection used for the faces will be " - "the maximum deflection of their edges.") + textIdTr("Relative computation of edge tolerance\n\n" + "If activated, deflection used for the polygonalisation of each edge will be " + "`ChordalDeflection` × `SizeOfEdge`. The deflection used for the faces will be " + "the maximum deflection of their edges.") ); // Graphics this->navigationStyle.setDescription( - textIdTr("3D view manipulation shortcuts configuration to mimic other common CAD applications") + textIdTr("3D view manipulation shortcuts configuration to mimic other common CAD applications") ); this->turnViewAngleIncrement.setDescription( - textIdTr("Angle increment used to turn(rotate) the 3D view around the normal of the view plane(Z axis frame reference)") + textIdTr("Angle increment used to turn(rotate) the 3D view around the normal of the view plane(Z axis frame reference)") ); // -- Graphics/ClipPlanes this->defaultShowOriginTrihedron.setDescription( - textIdTr("Show or hide by default the trihedron centered at world origin. " - "This doesn't affect 3D view of currently opened documents") + textIdTr("Show or hide by default the trihedron centered at world origin. " + "This doesn't affect 3D view of currently opened documents") ); this->clipPlanesCappingOn.setDescription( - textIdTr("Enable capping of currently clipped graphics") + textIdTr("Enable capping of currently clipped graphics") ); this->clipPlanesCappingHatchOn.setDescription( - textIdTr("Enable capping hatch texture of currently clipped graphics") + textIdTr("Enable capping hatch texture of currently clipped graphics") ); } void AppModuleProperties::onPropertyChanged(Property* prop) { if (prop == &this->meshDefaultsColor - || prop == &this->meshDefaultsEdgeColor - || prop == &this->meshDefaultsMaterial - || prop == &this->meshDefaultsShowEdges - || prop == &this->meshDefaultsShowNodes) + || prop == &this->meshDefaultsEdgeColor + || prop == &this->meshDefaultsMaterial + || prop == &this->meshDefaultsShowEdges + || prop == &this->meshDefaultsShowNodes + ) { auto values = GraphicsMeshObjectDriver::defaultValues(); values.color = this->meshDefaultsColor.value(); diff --git a/src/app/button_flat.cpp b/src/app/button_flat.cpp index cf645cd9..0f2088d3 100644 --- a/src/app/button_flat.cpp +++ b/src/app/button_flat.cpp @@ -138,10 +138,10 @@ void ButtonFlat::paintEvent(QPaintEvent*) painter.fillRect(surface, this->backgroundBrush()); const QRect iconRect( - (surface.width() - m_iconSize.width()) / 2, - (surface.height() - m_iconSize.height()) / 2, - m_iconSize.width(), - m_iconSize.height() + (surface.width() - m_iconSize.width()) / 2, + (surface.height() - m_iconSize.height()) / 2, + m_iconSize.width(), + m_iconSize.height() ); const QIcon::Mode iconMode = isEnabled ? QIcon::Normal : QIcon::Disabled; m_icon.paint(&painter, iconRect, Qt::AlignCenter, iconMode); diff --git a/src/app/command_system_information.cpp b/src/app/command_system_information.cpp index c2ed221e..47388f25 100644 --- a/src/app/command_system_information.cpp +++ b/src/app/command_system_information.cpp @@ -188,27 +188,28 @@ QString CommandSystemInformation::data() << " commit:" << strVersionCommitId << " revnum:" << versionRevisionNumber << " " << QT_POINTER_SIZE * 8 << "bit" - << '\n'; + << '\n' + ; // OS version ostr << '\n' << "OS: " << QSysInfo::prettyProductName() << " [" << QSysInfo::kernelType() << " version " << QSysInfo::kernelVersion() << "]" << '\n' - << "Current CPU Architecture: " << QSysInfo::currentCpuArchitecture() << '\n'; + << "Current CPU Architecture: " << QSysInfo::currentCpuArchitecture() << '\n' + ; // Qt version ostr << '\n' << QLibraryInfo::build() << " on \"" << QGuiApplication::platformName() << "\" " << '\n' << indent << "QStyle keys: " << QStyleFactory::keys().join("; ") << '\n' << indent << "Image formats(read): " << QImageReader::supportedImageFormats().join(' ') << '\n' - << indent << "Image formats(write): " << QImageWriter::supportedImageFormats().join(' ') << '\n'; + << indent << "Image formats(write): " << QImageWriter::supportedImageFormats().join(' ') << '\n' + ; // OpenCascade version ostr << '\n' << "OpenCascade: " << OCC_VERSION_STRING_EXT << " (build)" << '\n'; // Other registered libraries for (const auto& libInfo : LibraryInfoArray::get()) { - ostr << '\n' << libInfo.name << ": " << libInfo.version - << " " << libInfo.versionDetails - << '\n'; + ostr << '\n' << libInfo.name << ": " << libInfo.version << " " << libInfo.versionDetails << '\n'; } // I/O supported formats @@ -242,7 +243,8 @@ QString CommandSystemInformation::data() << indentx2 << "numpunct.thousands_sep: " << char1000Sep << " " << toUnicodeHexa(char1000Sep) << '\n' << indentx2 << "numpunct.grouping: " << to_QString(strGrouping) << '\n' << indentx2 << "numpunct.truename: " << to_QString(numFacet.truename()) << '\n' - << indentx2 << "numpunct.falsename: " << to_QString(numFacet.falsename()) << '\n'; + << indentx2 << "numpunct.falsename: " << to_QString(numFacet.falsename()) << '\n' + ; const QLocale& qtLoc = AppModule::get()->qtLocale(); ostr << indent << "QLocale:" << '\n' << indentx2 << "name: " << qtLoc.name() << '\n' @@ -250,7 +252,8 @@ QString CommandSystemInformation::data() << indentx2 << "measurementSytem: " << MetaEnum::name(qtLoc.measurementSystem()) << '\n' << indentx2 << "textDirection: " << MetaEnum::name(qtLoc.textDirection()) << '\n' << indentx2 << "decimalPoint: " << qtLoc.decimalPoint() << " " << toUnicodeHexa(qtLoc.decimalPoint()) << '\n' - << indentx2 << "groupSeparator: " << qtLoc.groupSeparator() << " " << toUnicodeHexa(qtLoc.groupSeparator()) << '\n'; + << indentx2 << "groupSeparator: " << qtLoc.groupSeparator() << " " << toUnicodeHexa(qtLoc.groupSeparator()) << '\n' + ; } // C++ StdLib @@ -258,7 +261,8 @@ QString CommandSystemInformation::data() { const QChar dirSeparator(FilePath::preferred_separator); ostr << indent << "std::thread::hardware_concurrency: " << std::thread::hardware_concurrency() << '\n' - << indent << "std::filepath::path::preferred_separator: " << dirSeparator << " " << toUnicodeHexa(dirSeparator) << '\n'; + << indent << "std::filepath::path::preferred_separator: " << dirSeparator << " " << toUnicodeHexa(dirSeparator) << '\n' + ; } // OpenGL @@ -277,7 +281,8 @@ QString CommandSystemInformation::data() ostr << indent << "General font: " << QFontDatabase::systemFont(QFontDatabase::GeneralFont) << '\n' << indent << "Fixed font: " << QFontDatabase::systemFont(QFontDatabase::FixedFont) << '\n' << indent << "Title font: " << QFontDatabase::systemFont(QFontDatabase::TitleFont) << '\n' - << indent << "Smallest font: " << QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont) << '\n'; + << indent << "Smallest font: " << QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont) << '\n' + ; // Screens ostr << '\n' << "Screens:\n"; @@ -312,7 +317,8 @@ QString CommandSystemInformation::data() << indentx2 << "primaryOrientation: " << MetaEnum::name(screen->primaryOrientation()) << '\n' << indentx2 << "orientation: " << MetaEnum::name(screen->orientation()) << '\n' << indentx2 << "nativeOrientation: " << MetaEnum::name(screen->nativeOrientation()) << '\n' - << indentx2 << "refreshRate: " << screen->refreshRate() << "Hz" << '\n'; + << indentx2 << "refreshRate: " << screen->refreshRate() << "Hz" << '\n' + ; } } @@ -321,7 +327,8 @@ QString CommandSystemInformation::data() ostr << indent << "platformName: " << QGuiApplication::platformName() << '\n' << indent << "desktopFileName: " << QGuiApplication::desktopFileName() << '\n' << indent << "desktopSettingsAware: " << QGuiApplication::desktopSettingsAware() << '\n' - << indent << "layoutDirection: " << MetaEnum::name(QGuiApplication::layoutDirection()) << '\n'; + << indent << "layoutDirection: " << MetaEnum::name(QGuiApplication::layoutDirection()) << '\n' + ; const QStyleHints* sh = QGuiApplication::styleHints(); if (sh) { const auto pwdChar = sh->passwordMaskCharacter(); @@ -349,7 +356,7 @@ QString CommandSystemInformation::data() << indentx2 << "mouseDoubleClickDistance: " << sh->mouseDoubleClickDistance() << '\n' << indentx2 << "touchDoubleTapDistance: " << sh->touchDoubleTapDistance() << '\n' #endif - ; + ; } // Library info diff --git a/src/app/commands_display.cpp b/src/app/commands_display.cpp index 04e99a7b..f594da2f 100644 --- a/src/app/commands_display.cpp +++ b/src/app/commands_display.cpp @@ -31,7 +31,8 @@ BaseCommandDisplay::BaseCommandDisplay(IAppContext* context) bool BaseCommandDisplay::getEnabledStatus() const { return this->app()->documentCount() != 0 - && this->context()->currentPage() == IAppContext::Page::Documents; + && this->context()->currentPage() == IAppContext::Page::Documents + ; } CommandChangeProjection::CommandChangeProjection(IAppContext* context) @@ -106,8 +107,8 @@ CommandChangeDisplayMode::CommandChangeDisplayMode(IAppContext* context, QMenu* : CommandChangeDisplayMode(context) { QObject::connect( - containerMenu, &QMenu::aboutToShow, - this, &CommandChangeDisplayMode::recreateMenuDisplayMode + containerMenu, &QMenu::aboutToShow, + this, &CommandChangeDisplayMode::recreateMenuDisplayMode ); } @@ -167,8 +168,8 @@ CommandToggleOriginTrihedron::CommandToggleOriginTrihedron(IAppContext* context) this->setAction(action); QObject::connect( - context, &IAppContext::currentDocumentChanged, - this, &CommandToggleOriginTrihedron::onCurrentDocumentChanged + context, &IAppContext::currentDocumentChanged, + this, &CommandToggleOriginTrihedron::onCurrentDocumentChanged ); } @@ -205,8 +206,8 @@ CommandTogglePerformanceStats::CommandTogglePerformanceStats(IAppContext* contex this->setAction(action); QObject::connect( - context, &IAppContext::currentDocumentChanged, - this, &CommandTogglePerformanceStats::onCurrentDocumentChanged + context, &IAppContext::currentDocumentChanged, + this, &CommandTogglePerformanceStats::onCurrentDocumentChanged ); } diff --git a/src/app/commands_file.cpp b/src/app/commands_file.cpp index e382774c..013c035b 100644 --- a/src/app/commands_file.cpp +++ b/src/app/commands_file.cpp @@ -547,8 +547,8 @@ CommandCloseAllDocumentsExceptCurrent::CommandCloseAllDocumentsExceptCurrent(IAp this->setAction(action); QObject::connect( - context, &IAppContext::currentDocumentChanged, - this, &CommandCloseAllDocumentsExceptCurrent::updateActionText + context, &IAppContext::currentDocumentChanged, + this, &CommandCloseAllDocumentsExceptCurrent::updateActionText ); this->app()->signalDocumentNameChanged.connectSlot([=](const DocumentPtr& doc) { if (this->currentDocument() == doc->identifier()) diff --git a/src/app/commands_tools.cpp b/src/app/commands_tools.cpp index fd8af3c3..48f0c74d 100644 --- a/src/app/commands_tools.cpp +++ b/src/app/commands_tools.cpp @@ -79,7 +79,8 @@ bool CommandInspectXde::getEnabledStatus() const return spanSelectedAppItem.size() == 1 && firstAppItem.isValid() && firstAppItem.document()->isXCafDocument() - && this->context()->currentPage() == IAppContext::Page::Documents; + && this->context()->currentPage() == IAppContext::Page::Documents + ; } CommandEditOptions::CommandEditOptions(IAppContext* context) diff --git a/src/app/commands_window.cpp b/src/app/commands_window.cpp index ad939fbf..0398a68b 100644 --- a/src/app/commands_window.cpp +++ b/src/app/commands_window.cpp @@ -175,7 +175,8 @@ bool CommandPreviousDocument::getEnabledStatus() const { return this->app()->documentCount() != 0 && this->context()->currentPage() == IAppContext::Page::Documents - && this->currentDocumentIndex() > 0; + && this->currentDocumentIndex() > 0 + ; } CommandNextDocument::CommandNextDocument(IAppContext* context) @@ -200,7 +201,8 @@ bool CommandNextDocument::getEnabledStatus() const const int appDocumentCount = this->app()->documentCount(); return appDocumentCount != 0 && this->context()->currentPage() == IAppContext::Page::Documents - && this->currentDocumentIndex() < appDocumentCount - 1; + && this->currentDocumentIndex() < appDocumentCount - 1 + ; } } // namespace Mayo diff --git a/src/app/dialog_about.cpp b/src/app/dialog_about.cpp index 3c474d6a..966b1a87 100644 --- a/src/app/dialog_about.cpp +++ b/src/app/dialog_about.cpp @@ -20,7 +20,7 @@ DialogAbout::DialogAbout(QWidget* parent) { m_ui->setupUi(this); m_ui->label_AppByOrg->setText( - tr("%1 By %2").arg(QApplication::applicationName(), QApplication::organizationName()) + tr("%1 By %2").arg(QApplication::applicationName(), QApplication::organizationName()) ); const QString strVersionFull = diff --git a/src/app/dialog_options.cpp b/src/app/dialog_options.cpp index 1c27c758..851ac36a 100644 --- a/src/app/dialog_options.cpp +++ b/src/app/dialog_options.cpp @@ -112,7 +112,8 @@ class CustomStyle : public QProxyStyle { StyleHint hint, const QStyleOption* option, const QWidget* widget, - QStyleHintReturn* returnData) const override + QStyleHintReturn* returnData + ) const override { if (hint == QStyle::SH_ComboBox_AllowWheelScrolling) return 0; @@ -238,7 +239,8 @@ DialogOptions::DialogOptions(Settings* settings, QWidget* parent) m_ui->treeView_GroupSections->scrollTo(indexList.front(), QAbstractItemView::PositionAtTop); QSignalBlocker _(m_ui->treeView_GroupSections); m_ui->treeView_GroupSections->selectionModel()->select( - indexList.front(), QItemSelectionModel::SelectCurrent); + indexList.front(), QItemSelectionModel::SelectCurrent + ); } }); diff --git a/src/app/dialog_save_image_view.cpp b/src/app/dialog_save_image_view.cpp index 4413ffa4..20abedcd 100644 --- a/src/app/dialog_save_image_view.cpp +++ b/src/app/dialog_save_image_view.cpp @@ -46,15 +46,9 @@ DialogSaveImageView::DialogSaveImageView(const OccHandle& view, QWidge m_ui->buttonBox->addButton(saveBtn, QDialogButtonBox::ActionRole); m_ui->buttonBox->addButton(copyBtn, QDialogButtonBox::ActionRole); m_ui->buttonBox->addButton(previewBtn, QDialogButtonBox::ActionRole); - QObject::connect( - saveBtn, &QAbstractButton::clicked, - this, &DialogSaveImageView::saveFile); - QObject::connect( - copyBtn, &QAbstractButton::clicked, - this, &DialogSaveImageView::clipboardCopy); - QObject::connect( - previewBtn, &QAbstractButton::clicked, - this, &DialogSaveImageView::preview); + QObject::connect(saveBtn, &QAbstractButton::clicked, this, &DialogSaveImageView::saveFile); + QObject::connect(copyBtn, &QAbstractButton::clicked, this, &DialogSaveImageView::clipboardCopy); + QObject::connect(previewBtn, &QAbstractButton::clicked, this, &DialogSaveImageView::preview); m_ui->edit_Width->setValue(GraphicsUtils::AspectWindow_width(view->Window())); m_ui->edit_Height->setValue(GraphicsUtils::AspectWindow_height(view->Window())); @@ -71,18 +65,18 @@ void DialogSaveImageView::saveFile() QStringList listFormat; foreach (const QByteArray& name, QImageWriter::supportedImageFormats()) { const QString strName = QString::fromLatin1(name); - listFormat.append(tr("%1 files(*.%2)") - .arg(strName.toUpper(), strName.toLower())); + listFormat.append(tr("%1 files(*.%2)").arg(strName.toUpper(), strName.toLower())); mapFilterFormat.insert(listFormat.back(), name); } QString selectedFormat; const QString fileName = QFileDialog::getSaveFileName( - this, - tr("Select image file"), - QString(), - listFormat.join(QLatin1String(";;")), - &selectedFormat); + this, + tr("Select image file"), + QString(), + listFormat.join(QLatin1String(";;")), + &selectedFormat + ); if (!fileName.isEmpty()) { auto itFound = mapFilterFormat.find(selectedFormat); const char* format = @@ -97,8 +91,7 @@ void DialogSaveImageView::saveFile() saveOk = img.save(fileName, format); } if (!saveOk) { - QtWidgetsUtils::asyncMsgBoxCritical( - this, tr("Error"), tr("Failed to save image '%1'").arg(fileName)); + QtWidgetsUtils::asyncMsgBoxCritical(this, tr("Error"), tr("Failed to save image '%1'").arg(fileName)); } } } @@ -120,11 +113,11 @@ void DialogSaveImageView::preview() auto label = new QLabel(this, Qt::Dialog); label->setPixmap(QPixmap::fromImage(img)); label->setWindowTitle( - tr("%1x%2 %3") - .arg(img.width()) - .arg(img.height()) - .arg(m_ui->checkBox_KeepRatio->isChecked() ? - tr("Keep ratio") : tr("Free ratio"))); + tr("%1x%2 %3") + .arg(img.width()) + .arg(img.height()) + .arg(m_ui->checkBox_KeepRatio->isChecked() ? tr("Keep ratio") : tr("Free ratio")) + ); label->setAttribute(Qt::WA_DeleteOnClose, true); label->show(); } @@ -139,7 +132,8 @@ bool DialogSaveImageView::createImageView(Image_PixMap* img) const m_ui->edit_Width->value(), m_ui->edit_Height->value(), Graphic3d_BT_RGBA, - m_ui->checkBox_KeepRatio->isChecked()); + m_ui->checkBox_KeepRatio->isChecked() + ); return ok; } diff --git a/src/app/dialog_task_manager.cpp b/src/app/dialog_task_manager.cpp index 6ea2d201..fc55cd72 100644 --- a/src/app/dialog_task_manager.cpp +++ b/src/app/dialog_task_manager.cpp @@ -135,8 +135,9 @@ void DialogTaskManager::onTaskStarted(TaskId taskId) auto widget = new TaskWidget(m_ui->scrollAreaContents); widget->m_interruptBtn->setProperty(TaskWidget::TaskIdProp, quint64(taskId)); QObject::connect( - widget->m_interruptBtn, &QToolButton::clicked, - this, &DialogTaskManager::interruptTask); + widget->m_interruptBtn, &QToolButton::clicked, + this, &DialogTaskManager::interruptTask + ); m_ui->contentsLayout->insertWidget(0, widget); m_taskIdToWidget.insert({ taskId, widget }); ++m_taskCount; diff --git a/src/app/property_editor_factory.cpp b/src/app/property_editor_factory.cpp index ec48e18a..dd511885 100644 --- a/src/app/property_editor_factory.cpp +++ b/src/app/property_editor_factory.cpp @@ -405,7 +405,8 @@ UnitSystem::TranslateResult IPropertyEditorFactory::unitTranslate(const BaseProp return UnitSystem::translate( AppModule::get()->properties()->unitSystemSchema, property->quantityValue(), - property->quantityUnit()); + property->quantityUnit() + ); } QPixmap IPropertyEditorFactory::colorSquarePixmap(const QColor& c, int sideLen) diff --git a/src/app/property_item_delegate.cpp b/src/app/property_item_delegate.cpp index ad1a9c9b..4a2ce931 100644 --- a/src/app/property_item_delegate.cpp +++ b/src/app/property_item_delegate.cpp @@ -193,10 +193,11 @@ void PropertyItemDelegate::paint( painter->save(); QApplication::style()->drawPrimitive( - QStyle::PE_PanelItemViewItem, - &option, - painter, - option.widget); + QStyle::PE_PanelItemViewItem, + &option, + painter, + option.widget + ); const QColor color = QtGuiUtils::toQColor(propColor->value()); const QPixmap pixColor = IPropertyEditorFactory::colorSquarePixmap(color, option.rect.height()); @@ -206,12 +207,13 @@ void PropertyItemDelegate::paint( QRect labelRect = option.rect; labelRect.setX(option.rect.x() + pixColor.width() + 6); QApplication::style()->drawItemText( - painter, - labelRect, - Qt::AlignLeft | Qt::AlignVCenter, - option.palette, - option.state.testFlag(QStyle::State_Enabled), - strColor); + painter, + labelRect, + Qt::AlignLeft | Qt::AlignVCenter, + option.palette, + option.state.testFlag(QStyle::State_Enabled), + strColor + ); painter->restore(); cellPainted = true; @@ -224,16 +226,18 @@ void PropertyItemDelegate::paint( if (index.column() == 1 && !index.data().isNull()) { const Property* prop = qvariant_cast(index.data()); if (!prop->isUserReadOnly() - && option.state.testFlag(QStyle::State_Enabled) - && option.state.testFlag(QStyle::State_MouseOver)) + && option.state.testFlag(QStyle::State_Enabled) + && option.state.testFlag(QStyle::State_MouseOver) + ) { const QSize itemSize = this->sizeHint(option, index); const QSize pixItemSize = option.decorationSize * 0.75; const QPixmap pixEdit = mayoTheme()->icon(Theme::Icon::Edit).pixmap(pixItemSize); painter->drawPixmap( - option.rect.x() + itemSize.width() + 4, - option.rect.y() + (itemSize.height() - pixItemSize.height()) / 2., - pixEdit); + option.rect.x() + itemSize.width() + 4, + option.rect.y() + (itemSize.height() - pixItemSize.height()) / 2., + pixEdit + ); } } } @@ -304,8 +308,9 @@ QWidget* PropertyItemDelegate::createEditor( if (this->editorFactory()) { if (property->dynTypeName() == PropertyBool::TypeName - || property->dynTypeName() == PropertyCheckState::TypeName - || property->dynTypeName() == PropertyOccColor::TypeName) + || property->dynTypeName() == PropertyCheckState::TypeName + || property->dynTypeName() == PropertyOccColor::TypeName + ) { auto panel = PanelEditor::create(parent); auto editor = this->editorFactory()->createEditor(property, panel); diff --git a/src/app/property_item_delegate.h b/src/app/property_item_delegate.h index e47e3918..f89b1043 100644 --- a/src/app/property_item_delegate.h +++ b/src/app/property_item_delegate.h @@ -29,23 +29,17 @@ class PropertyItemDelegate : public QStyledItemDelegate { void setPropertyEditorFactory(std::unique_ptr editorFactory); struct UnitTranslation { - Unit unit; - const char* strUnit; // UTF8 - double factor; + Unit unit; + const char* strUnit; // UTF8 + double factor; }; bool overridePropertyUnitTranslation(const BasePropertyQuantity* prop, UnitTranslation unitTr); - void paint( - QPainter* painter, - const QStyleOptionViewItem& option, - const QModelIndex& index - ) const override; + void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const override; QString displayText(const QVariant& value, const QLocale&) const override; - QWidget* createEditor( - QWidget* parent, const QStyleOptionViewItem&, const QModelIndex& index - ) const override; + QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem&, const QModelIndex& index) const override; void setModelData(QWidget*, QAbstractItemModel*, const QModelIndex&) const override; diff --git a/src/app/proxy_styled_item_delegate.cpp b/src/app/proxy_styled_item_delegate.cpp index 7f83a5af..0395f8f7 100644 --- a/src/app/proxy_styled_item_delegate.cpp +++ b/src/app/proxy_styled_item_delegate.cpp @@ -33,7 +33,8 @@ void ProxyStyledItemDelegate::setSourceDelegate(QStyledItemDelegate* srcDelegate void ProxyStyledItemDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, - const QModelIndex& index) const + const QModelIndex& index + ) const { if (m_sourceDelegate) m_sourceDelegate->paint(painter, option, index); @@ -41,8 +42,7 @@ void ProxyStyledItemDelegate::paint( QStyledItemDelegate::paint(painter, option, index); } -QSize ProxyStyledItemDelegate::sizeHint( - const QStyleOptionViewItem& option, const QModelIndex& index) const +QSize ProxyStyledItemDelegate::sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const { if (m_sourceDelegate) return m_sourceDelegate->sizeHint(option, index); @@ -61,7 +61,8 @@ QString ProxyStyledItemDelegate::displayText(const QVariant& value, const QLocal QWidget* ProxyStyledItemDelegate::createEditor( QWidget* parent, const QStyleOptionViewItem& option, - const QModelIndex& index) const + const QModelIndex& index + ) const { if (m_sourceDelegate) return m_sourceDelegate->createEditor(parent, option, index); @@ -80,7 +81,8 @@ void ProxyStyledItemDelegate::setEditorData(QWidget* editor, const QModelIndex& void ProxyStyledItemDelegate::setModelData( QWidget* editor, QAbstractItemModel* model, - const QModelIndex& index) const + const QModelIndex& index + ) const { if (m_sourceDelegate) m_sourceDelegate->setModelData(editor, model, index); @@ -91,7 +93,8 @@ void ProxyStyledItemDelegate::setModelData( void ProxyStyledItemDelegate::updateEditorGeometry( QWidget* editor, const QStyleOptionViewItem& option, - const QModelIndex& index) const + const QModelIndex& index + ) const { if (m_sourceDelegate) m_sourceDelegate->updateEditorGeometry(editor, option, index); diff --git a/src/app/proxy_styled_item_delegate.h b/src/app/proxy_styled_item_delegate.h index 79635ebb..86c381b3 100644 --- a/src/app/proxy_styled_item_delegate.h +++ b/src/app/proxy_styled_item_delegate.h @@ -25,34 +25,26 @@ class ProxyStyledItemDelegate : public QStyledItemDelegate { void setSourceDelegate(QStyledItemDelegate* srcDelegate); void paint( - QPainter* painter, - const QStyleOptionViewItem& option, - const QModelIndex& index - ) const override; + QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index + ) const override; QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const override; QString displayText(const QVariant& value, const QLocale& locale) const override; QWidget* createEditor( - QWidget* parent, - const QStyleOptionViewItem& option, - const QModelIndex& index - ) const override; + QWidget* parent,const QStyleOptionViewItem& option,const QModelIndex& index + ) const override; void setEditorData(QWidget* editor, const QModelIndex& index) const override; void setModelData( - QWidget* editor, - QAbstractItemModel* model, - const QModelIndex& index - ) const override; + QWidget* editor,QAbstractItemModel* model, const QModelIndex& index + ) const override; void updateEditorGeometry( - QWidget* editor, - const QStyleOptionViewItem& option, - const QModelIndex& index - ) const override; + QWidget* editor, const QStyleOptionViewItem& option, const QModelIndex& index + ) const override; private: QStyledItemDelegate* m_sourceDelegate; diff --git a/src/app/qstring_utils.cpp b/src/app/qstring_utils.cpp index 10223e2e..b79aebe3 100644 --- a/src/app/qstring_utils.cpp +++ b/src/app/qstring_utils.cpp @@ -77,13 +77,13 @@ QString QStringUtils::text(const gp_Trsf& trsf, const TextOptions& opt) gp_XYZ axisRotation; double angleRotation; trsf.GetRotation(axisRotation, angleRotation); - const UnitSystem::TranslateResult trAngleRotation = - UnitSystem::degrees(angleRotation * Quantity_Radian); + const auto trAngleRotation = UnitSystem::degrees(angleRotation * Quantity_Radian); return tr("[%1; %2%3; %4]").arg( coordsText(axisRotation, opt), valueText(trAngleRotation.value, opt), QString::fromUtf8(trAngleRotation.strUnit), - QStringUtils::text(gp_Pnt(trsf.TranslationPart()), opt)); + QStringUtils::text(gp_Pnt(trsf.TranslationPart()), opt) + ); } QString QStringUtils::text(const Quantity_Color& color, const QString& format) diff --git a/src/app/qtwidgets_utils.cpp b/src/app/qtwidgets_utils.cpp index 69227a44..2cc334a1 100644 --- a/src/app/qtwidgets_utils.cpp +++ b/src/app/qtwidgets_utils.cpp @@ -71,7 +71,8 @@ QMessageBox* QtWidgetsUtils::asyncMsgBoxInfo( QWidget* parent, const QString& title, const QString& text, - QMessageBox::StandardButtons buttons) + QMessageBox::StandardButtons buttons + ) { auto msgBox = new QMessageBox(QMessageBox::Information, title, text, buttons, parent); QtWidgetsUtils::asyncDialogExec(msgBox); @@ -82,7 +83,8 @@ QMessageBox* QtWidgetsUtils::asyncMsgBoxWarning( QWidget* parent, const QString& title, const QString& text, - QMessageBox::StandardButtons buttons) + QMessageBox::StandardButtons buttons + ) { auto msgBox = new QMessageBox(QMessageBox::Warning, title, text, buttons, parent); QtWidgetsUtils::asyncDialogExec(msgBox); @@ -93,7 +95,8 @@ QMessageBox* QtWidgetsUtils::asyncMsgBoxCritical( QWidget* parent, const QString& title, const QString& text, - QMessageBox::StandardButtons buttons) + QMessageBox::StandardButtons buttons + ) { auto msgBox = new QMessageBox(QMessageBox::Critical, title, text, buttons, parent); QtWidgetsUtils::asyncDialogExec(msgBox); diff --git a/src/app/qtwidgets_utils.h b/src/app/qtwidgets_utils.h index 0760943f..b9538752 100644 --- a/src/app/qtwidgets_utils.h +++ b/src/app/qtwidgets_utils.h @@ -35,22 +35,22 @@ class QtWidgetsUtils { static void asyncMenuExec(QMenu* menu, const QPoint& pos = QCursor::pos()); static QMessageBox* asyncMsgBoxInfo( - QWidget* parent, - const QString& title, - const QString& text, - QMessageBox::StandardButtons buttons = QMessageBox::Ok + QWidget* parent, + const QString& title, + const QString& text, + QMessageBox::StandardButtons buttons = QMessageBox::Ok ); static QMessageBox* asyncMsgBoxWarning( - QWidget* parent, - const QString& title, - const QString& text, - QMessageBox::StandardButtons buttons = QMessageBox::Ok + QWidget* parent, + const QString& title, + const QString& text, + QMessageBox::StandardButtons buttons = QMessageBox::Ok ); static QMessageBox* asyncMsgBoxCritical( - QWidget* parent, - const QString& title, - const QString& text, - QMessageBox::StandardButtons buttons = QMessageBox::Ok + QWidget* parent, + const QString& title, + const QString& text, + QMessageBox::StandardButtons buttons = QMessageBox::Ok ); // Move position of 'widget' so it's displayed stuck to the right of 'nextTo' diff --git a/src/app/widget_clip_planes.cpp b/src/app/widget_clip_planes.cpp index 14b9311c..ea9c3e76 100644 --- a/src/app/widget_clip_planes.cpp +++ b/src/app/widget_clip_planes.cpp @@ -173,9 +173,8 @@ void WidgetClipPlanes::connectUi(ClipPlaneData* data) auto funcConnectDirSpin = [=](QDoubleSpinBox* dirSpin) { QObject::connect(dirSpin, signalSpinValueChanged, this, [=]{ const gp_Vec vecNormal( - customXDirSpin->value(), - customYDirSpin->value(), - customZDirSpin->value()); + customXDirSpin->value(), customYDirSpin->value(), customZDirSpin->value() + ); if (vecNormal.Magnitude() > Precision::Confusion()) { const gp_Dir normal(vecNormal); const auto bbc = BndBoxCoords::get(m_bndBox); @@ -296,7 +295,8 @@ double WidgetClipPlanes::UiClipPlane::sliderValueToSpinValue(double val) const { QDoubleSpinBox* spin = this->posSpin(); QAbstractSlider* slider = this->posSlider(); return MathUtils::mappedValue( - val, slider->minimum(), slider->maximum(), spin->minimum(), spin->maximum()); + val, slider->minimum(), slider->maximum(), spin->minimum(), spin->maximum() + ); } } // namespace Mayo diff --git a/src/app/widget_file_system.cpp b/src/app/widget_file_system.cpp index 7ee64185..5219d6a0 100644 --- a/src/app/widget_file_system.cpp +++ b/src/app/widget_file_system.cpp @@ -38,8 +38,8 @@ WidgetFileSystem::WidgetFileSystem(QWidget* parent) m_treeWidget->setIndentation(0); QObject::connect( - m_treeWidget, &QTreeWidget::itemActivated, - this, &WidgetFileSystem::onTreeItemActivated + m_treeWidget, &QTreeWidget::itemActivated, + this, &WidgetFileSystem::onTreeItemActivated ); } @@ -92,9 +92,10 @@ void WidgetFileSystem::setCurrentFolder(const QDir& dir) QList listItem; if (dir.exists()) { const QFileInfoList listEntryFileInfo = - dir.entryInfoList( + dir.entryInfoList( QDir::Files | QDir::AllDirs | QDir::NoDot, - QDir::DirsFirst); + QDir::DirsFirst + ); for (const QFileInfo& fi : listEntryFileInfo) { auto item = new QTreeWidgetItem; if (fi.fileName() != QLatin1String(".")) { @@ -104,7 +105,8 @@ void WidgetFileSystem::setCurrentFolder(const QDir& dir) tr("%1\nSize: %2\nLast modified: %3") .arg(QDir::toNativeSeparators(fi.absoluteFilePath())) .arg(QStringUtils::bytesText(fi.size())) - .arg(QLocale::system().toString(fi.lastModified(), QLocale::LongFormat)); + .arg(QLocale::system().toString(fi.lastModified(), QLocale::LongFormat)) + ; item->setToolTip(0, itemTooltip); } diff --git a/src/app/widget_grid.cpp b/src/app/widget_grid.cpp index 5501ea1f..91b6d740 100644 --- a/src/app/widget_grid.cpp +++ b/src/app/widget_grid.cpp @@ -154,14 +154,14 @@ WidgetGrid::WidgetGrid(GraphicsViewPtr viewPtr, QWidget* parent) // Signal/slot connections auto sigComboBoxActivated_int = qOverload(&QComboBox::activated); QObject::connect( - m_ui->check_ShowGrid, &QCheckBox::clicked, this, &WidgetGrid::activateGrid + m_ui->check_ShowGrid, &QCheckBox::clicked, this, &WidgetGrid::activateGrid ); QObject::connect(m_ui->combo_Type, sigComboBoxActivated_int, this, [=](int typeIndex) { m_ui->stack_Config->setCurrentIndex(typeIndex); auto gridColors = GraphicsUtils::V3dViewer_gridColors(viewer); viewer->ActivateGrid( - toGridType(m_ui->combo_Type->currentIndex()), - toGridDrawMode(m_ui->combo_DrawMode->currentIndex()) + toGridType(m_ui->combo_Type->currentIndex()), + toGridDrawMode(m_ui->combo_DrawMode->currentIndex()) ); GraphicsUtils::V3dViewer_setGridColors(viewer, gridColors); m_viewPtr.redraw(); @@ -188,13 +188,13 @@ WidgetGrid::WidgetGrid(GraphicsViewPtr viewPtr, QWidget* parent) emit this->sizeAdjustmentRequested(); }); QObject::connect( - m_ui->btn_Color, &QToolButton::clicked, this, [=]{ this->chooseGridColor(GridColorType::Base); } + m_ui->btn_Color, &QToolButton::clicked, this, [=]{ this->chooseGridColor(GridColorType::Base); } ); QObject::connect( - m_ui->btn_ColorTenth, &QToolButton::clicked, this, [=]{ this->chooseGridColor(GridColorType::Tenth); } + m_ui->btn_ColorTenth, &QToolButton::clicked, this, [=]{ this->chooseGridColor(GridColorType::Tenth); } ); QObject::connect( - m_ui->check_ColorTenth, &QAbstractButton::toggled, this, &WidgetGrid::enableGridColorTenth + m_ui->check_ColorTenth, &QAbstractButton::toggled, this, &WidgetGrid::enableGridColorTenth ); auto sigGridParamChanged_double = qOverload(&QDoubleSpinBox::valueChanged); @@ -251,8 +251,8 @@ void WidgetGrid::activateGrid(bool on) const OccHandle& viewer = m_viewPtr->Viewer(); if (on) { viewer->ActivateGrid( - toGridType(m_ui->combo_Type->currentIndex()), - toGridDrawMode(m_ui->combo_DrawMode->currentIndex()) + toGridType(m_ui->combo_Type->currentIndex()), + toGridDrawMode(m_ui->combo_DrawMode->currentIndex()) ); } else { @@ -273,20 +273,20 @@ void WidgetGrid::applyGridParams() auto gridType = toGridType(m_ui->combo_Type->currentIndex()); if (gridType == Aspect_GT_Rectangular) { viewer->SetRectangularGridValues( - m_ui->edit_RectOriginX->value(), - m_ui->edit_RectOriginY->value(), - fnCorrectedGridStep(m_ui->edit_RectStepX->value()), - fnCorrectedGridStep(m_ui->edit_RectStepY->value()), - UnitSystem::radians(m_ui->edit_RectRotation->value() * Quantity_Degree) + m_ui->edit_RectOriginX->value(), + m_ui->edit_RectOriginY->value(), + fnCorrectedGridStep(m_ui->edit_RectStepX->value()), + fnCorrectedGridStep(m_ui->edit_RectStepY->value()), + UnitSystem::radians(m_ui->edit_RectRotation->value() * Quantity_Degree) ); } else if (gridType == Aspect_GT_Circular) { viewer->SetCircularGridValues( - m_ui->edit_CircOriginX->value(), - m_ui->edit_CircOriginY->value(), - fnCorrectedGridStep(m_ui->edit_CircRadiusStep->value()), - m_ui->edit_CircDivision->value(), - UnitSystem::radians(m_ui->edit_CircRotation->value() * Quantity_Degree) + m_ui->edit_CircOriginX->value(), + m_ui->edit_CircOriginY->value(), + fnCorrectedGridStep(m_ui->edit_CircRadiusStep->value()), + m_ui->edit_CircDivision->value(), + UnitSystem::radians(m_ui->edit_CircRotation->value() * Quantity_Degree) ); } @@ -299,15 +299,12 @@ void WidgetGrid::applyGridGraphicsParams() auto gridType = toGridType(m_ui->combo_Type->currentIndex()); if (gridType == Aspect_GT_Rectangular) { viewer->SetRectangularGridGraphicValues( - m_ui->edit_RectSizeX->value(), - m_ui->edit_RectSizeY->value(), - m_ui->edit_RectOffset->value() + m_ui->edit_RectSizeX->value(), m_ui->edit_RectSizeY->value(), m_ui->edit_RectOffset->value() ); } else if (gridType == Aspect_GT_Circular) { viewer->SetCircularGridGraphicValues( - m_ui->edit_CircRadius->value(), - m_ui->edit_RectOffset->value() + m_ui->edit_CircRadius->value(), m_ui->edit_RectOffset->value() ); } diff --git a/src/app/widget_home_files.cpp b/src/app/widget_home_files.cpp index 1dd05adb..4cf3f424 100644 --- a/src/app/widget_home_files.cpp +++ b/src/app/widget_home_files.cpp @@ -95,7 +95,6 @@ class HomeFilesModel : public ListHelper::Model { const QIcon icon = m_fileIconProvider.icon(QFileInfo(url)); pixmap = fnPixmap(icon, 64, 64); cachePixmap = false; - } } diff --git a/src/app/widget_model_tree.h b/src/app/widget_model_tree.h index ff339661..bd0a9a03 100644 --- a/src/app/widget_model_tree.h +++ b/src/app/widget_model_tree.h @@ -62,17 +62,21 @@ class WidgetModelTree : public QWidget { void onDocumentEntityAboutToBeDestroyed(const DocumentPtr& doc, TreeNodeId entityId); void onTreeWidgetDocumentSelectionChanged( - const QItemSelection& selected, const QItemSelection& deselected); + const QItemSelection& selected, const QItemSelection& deselected + ); void onApplicationItemSelectionModelChanged( - Span selected, Span deselected); + Span selected, Span deselected + ); void connectTreeModelDataChanged(bool on); void connectTreeWidgetDocumentSelectionChanged(bool on); void onTreeModelDataChanged( - const QModelIndex& topLeft, const QModelIndex& bottomRight, const QVector& roles); + const QModelIndex& topLeft, const QModelIndex& bottomRight, const QVector& roles + ); void onNodesVisibilityChanged( - const GuiDocument* guiDoc, const std::unordered_map& mapNodeId); + const GuiDocument* guiDoc, const std::unordered_map& mapNodeId + ); QTreeWidgetItem* loadDocumentEntity(const DocumentTreeNode& entityNode); diff --git a/src/app/widget_model_tree_builder_xde.h b/src/app/widget_model_tree_builder_xde.h index 917b564a..623ca475 100644 --- a/src/app/widget_model_tree_builder_xde.h +++ b/src/app/widget_model_tree_builder_xde.h @@ -28,7 +28,7 @@ class WidgetModelTreeBuilder_Xde : public WidgetModelTreeBuilder { using ThisType = WidgetModelTreeBuilder_Xde; static QTreeWidgetItem* guiCreateXdeTreeNode( - QTreeWidgetItem* guiParentNode, const DocumentTreeNode& node + QTreeWidgetItem* guiParentNode, const DocumentTreeNode& node ); QTreeWidgetItem* buildXdeTree(QTreeWidgetItem* treeItem, const DocumentTreeNode& node); diff --git a/src/app/widget_properties_editor.cpp b/src/app/widget_properties_editor.cpp index 3c43c921..28a58860 100644 --- a/src/app/widget_properties_editor.cpp +++ b/src/app/widget_properties_editor.cpp @@ -190,11 +190,8 @@ QTreeWidgetItem* WidgetPropertiesEditor::Private::findTreeItem(const Property* p for (QTreeWidgetItemIterator it(this->ui->treeWidget_Browser); *it; ++it) { QTreeWidgetItem* treeItem = *it; const QVariant value = treeItem->data(1, Qt::DisplayRole); - if (value.canConvert() - && qvariant_cast(value) == property) - { + if (value.canConvert() && qvariant_cast(value) == property) return treeItem; - } } return nullptr; } @@ -202,8 +199,9 @@ QTreeWidgetItem* WidgetPropertiesEditor::Private::findTreeItem(const Property* p bool WidgetPropertiesEditor::Private::hasGroup(const Group *group) const { return group - && group->treeItem - && group->treeItem->treeWidget() == ui->treeWidget_Browser; + && group->treeItem + && group->treeItem->treeWidget() == ui->treeWidget_Browser + ; } } // namespace Mayo diff --git a/src/qtcommon/qtcore_utils.h b/src/qtcommon/qtcore_utils.h index c854b44a..524f92ec 100644 --- a/src/qtcommon/qtcore_utils.h +++ b/src/qtcommon/qtcore_utils.h @@ -16,23 +16,27 @@ namespace Mayo { namespace QtCoreUtils { // Convenience function over QByteArray::fromRawData() taking a QByteArray object -inline QByteArray QByteArray_frowRawData(const QByteArray& bytes) { +inline QByteArray QByteArray_frowRawData(const QByteArray& bytes) +{ return QByteArray::fromRawData(bytes.data(), bytes.size()); } // Convenience function over QByteArray::fromRawData() taking a std::string_view object -inline QByteArray QByteArray_frowRawData(std::string_view str) { +inline QByteArray QByteArray_frowRawData(std::string_view str) +{ return QByteArray::fromRawData(str.data(), int(str.size())); } // Convenience function over QByteArray::fromRawData() taking a C array of characters template -QByteArray QByteArray_frowRawData(const char (&str)[N]) { +QByteArray QByteArray_frowRawData(const char (&str)[N]) +{ return QByteArray::fromRawData(str, N); } // Converts Mayo::CheckState -> Qt::CheckState -inline Qt::CheckState toQtCheckState(Mayo::CheckState state) { +inline Qt::CheckState toQtCheckState(Mayo::CheckState state) +{ switch (state) { case CheckState::Off: return Qt::Unchecked; case CheckState::Partially: return Qt::PartiallyChecked; @@ -43,7 +47,8 @@ inline Qt::CheckState toQtCheckState(Mayo::CheckState state) { } // Converts Qt::CheckState -> Mayo::CheckState -inline Mayo::CheckState toCheckState(Qt::CheckState state) { +inline Mayo::CheckState toCheckState(Qt::CheckState state) +{ switch (state) { case Qt::Unchecked: return CheckState::Off; case Qt::PartiallyChecked: return CheckState::Partially;