Skip to content

Commit

Permalink
Manually fixes for clang-tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
magnesj committed Oct 2, 2023
1 parent e15f4a6 commit 30bf234
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 22 deletions.
4 changes: 2 additions & 2 deletions ApplicationLibCode/Application/RiaGuiApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ RiaApplication::ApplicationStatus RiaGuiApplication::handleArguments( gsl::not_n
{
CVF_ASSERT( o.valueCount() == 1 );
QString regressionTestPath = cvfqt::Utils::toQString( o.value( 0 ) );
RiaRegressionTestRunner::instance()->updateRegressionTest( regressionTestPath );
RiaRegressionTestRunner::updateRegressionTest( regressionTestPath );
return ApplicationStatus::EXIT_COMPLETED;
}

Expand Down Expand Up @@ -1544,7 +1544,7 @@ void RiaGuiApplication::applyGuiPreferences( const RiaPreferences*
//--------------------------------------------------------------------------------------------------
int RiaGuiApplication::applicationResolution()
{
return RiaGuiApplication::instance()->desktop()->logicalDpiX();
return QApplication::desktop()->logicalDpiX();
}

//--------------------------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion ApplicationLibCode/Application/RiaPreferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ void RiaPreferences::defineEditorAttribute( const caf::PdmFieldHandle* field, QS
caf::PdmUiLineEditorAttribute* myAttr = dynamic_cast<caf::PdmUiLineEditorAttribute*>( attribute );
if ( myAttr )
{
myAttr->validator = new RiaValidRegExpValidator( RiaPreferences::current()->defaultMultiLateralWellNamePattern() );
myAttr->validator = new RiaValidRegExpValidator( RiaPreferences::defaultMultiLateralWellNamePattern() );
}
}
else if ( field == &m_defaultScaleFactorZ )
Expand Down
4 changes: 2 additions & 2 deletions ApplicationLibCode/Application/RiaPreferencesSummary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ void RiaPreferencesSummary::defineUiOrdering( QString uiConfigName, caf::PdmUiOr

if ( m_summaryReader == SummaryReaderMode::OPM_COMMON )
{
if ( RiaApplication::instance()->enableDevelopmentFeatures() )
if ( RiaApplication::enableDevelopmentFeatures() )
{
uiOrdering.add( &m_useEnhancedSummaryDataFile );
}
Expand All @@ -397,7 +397,7 @@ void RiaPreferencesSummary::defineUiOrdering( QString uiConfigName, caf::PdmUiOr
{
uiOrdering.add( &m_createH5SummaryDataFile );

if ( RiaApplication::instance()->enableDevelopmentFeatures() )
if ( RiaApplication::enableDevelopmentFeatures() )
{
uiOrdering.add( &m_createH5SummaryFileThreadCount );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void RiaFieldHandleTools::disableWriteAndSetFieldHidden( caf::PdmFieldHandle* fi
void RiaFieldHandleTools::updateOverrideStateAndLabel( caf::PdmFieldHandle* fieldHandle, bool isOverridden, const QString& toolTip )
{
// Get the label text as given by the init_field macro
QString labelText = fieldHandle->uiCapability()->uiName( fieldHandle->uiCapability()->uiConfigNameForStaticData() );
QString labelText = fieldHandle->uiCapability()->uiName( caf::PdmUiItem::uiConfigNameForStaticData() );

if ( isOverridden ) labelText += " (overridden)";
fieldHandle->uiCapability()->setUiToolTip( toolTip );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ caf::PdmScriptResponse RicfExportSnapshots::execute()
QByteArray curState = mainWnd->dockManager()->saveState( 0 );
mainWnd->dockManager()->restoreState( RiuDockWidgetTools::defaultDockState( RiuDockWidgetTools::dockStateHideAll3DWindowName() ) );

RiaGuiApplication::instance()->processEvents();
QApplication::processEvents();

QString absolutePathToSnapshotDir = RicfCommandFileExecutor::instance()->getExportPath( RicfCommandFileExecutor::ExportType::SNAPSHOTS );

Expand Down Expand Up @@ -131,7 +131,7 @@ caf::PdmScriptResponse RicfExportSnapshots::execute()
RicSnapshotAllPlotsToFileFeature::exportSnapshotOfPlotsIntoFolder( absolutePathToSnapshotDir, activateWidget, m_prefix, m_viewId(), fileSuffix );
}

RiaGuiApplication::instance()->processEvents();
QApplication::processEvents();

mainWnd->dockManager()->restoreState( curState );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ void RicRecursiveFileSearchDialog::slotCopyFileItemText()
if ( m_fileListWidget->currentItem() )
{
QString relativePathText = m_fileListWidget->currentItem()->text();
RiaGuiApplication::instance()->clipboard()->setText( relativePathText );
QApplication::clipboard()->setText( relativePathText );
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ RicCreateWellTargetsPickEventHandler::~RicCreateWellTargetsPickEventHandler()
//--------------------------------------------------------------------------------------------------
void RicCreateWellTargetsPickEventHandler::registerAsPickEventHandler()
{
RiaGuiApplication::instance()->setOverrideCursor( Qt::CrossCursor );
QApplication::setOverrideCursor( Qt::CrossCursor );
Ric3dViewPickEventHandler::registerAsPickEventHandler();
}

Expand All @@ -82,7 +82,7 @@ void RicCreateWellTargetsPickEventHandler::registerAsPickEventHandler()
//--------------------------------------------------------------------------------------------------
void RicCreateWellTargetsPickEventHandler::notifyUnregistered()
{
RiaGuiApplication::instance()->restoreOverrideCursor();
QApplication::restoreOverrideCursor();
}

//--------------------------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ void RimGeoMechView::updateTensorLegendTextAndRanges( RimRegularLegendConfig* le
RigGeoMechCaseData* gmCase = m_geomechCase->geoMechData();
CVF_ASSERT( gmCase );

RigFemResultPosEnum resPos = tensorResults()->resultPositionType();
RigFemResultPosEnum resPos = RimTensorResults::resultPositionType();
QString resFieldName = tensorResults()->resultFieldName();

RigFemResultAddress resVarAddress( resPos, resFieldName.toStdString(), "" );
Expand Down
18 changes: 9 additions & 9 deletions ApplicationLibCode/UserInterface/RiuGuiTheme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ QMap<QString, CustomStyleSheetApplicator> RiuGuiTheme:
}
if ( lineColor.isEmpty() && symbolColor.isEmpty() ) return;

const QWidgetList topLevelWidgets = RiaGuiApplication::instance()->topLevelWidgets();
const QWidgetList topLevelWidgets = QApplication::topLevelWidgets();
for ( QWidget* widget : topLevelWidgets )
{
for ( QwtPlot* plotWidget : widget->findChildren<QwtPlot*>() )
Expand Down Expand Up @@ -121,7 +121,7 @@ QMap<QString, CustomStyleSheetApplicator> RiuGuiTheme:
QRegExp itemNameRegExp( match.captured( "itemName" ) );
QRegularExpression colorRegExp( "color:\\s*([#0-9a-zA-Z]+)" );
QString color = colorRegExp.match( match.captured( "properties" ) ).captured( 1 );
const QWidgetList topLevelWidgets = RiaGuiApplication::instance()->topLevelWidgets();
const QWidgetList topLevelWidgets = QApplication::topLevelWidgets();

if ( !color.isEmpty() )
{
Expand Down Expand Up @@ -159,7 +159,7 @@ QMap<QString, CustomStyleSheetApplicator> RiuGuiTheme:
QRegExp itemNameRegExp( match.captured( "itemName" ) );
QRegularExpression colorRegExp( "text-color:\\s*([#0-9a-zA-Z]+)" );
QString color = colorRegExp.match( match.captured( "properties" ) ).captured( 1 );
const QWidgetList topLevelWidgets = RiaGuiApplication::instance()->topLevelWidgets();
const QWidgetList topLevelWidgets = QApplication::topLevelWidgets();

if ( !color.isEmpty() )
{
Expand Down Expand Up @@ -196,7 +196,7 @@ QMap<QString, CustomStyleSheetApplicator> RiuGuiTheme:
QRegularExpression textColorRegExp( "text-color:\\s*([#0-9a-zA-Z]+)" );
QString textColor = textColorRegExp.match( match.captured( "properties" ) ).captured( 1 );

const QWidgetList topLevelWidgets = RiaGuiApplication::instance()->topLevelWidgets();
const QWidgetList topLevelWidgets = QApplication::topLevelWidgets();

if ( !color.isEmpty() )
{
Expand Down Expand Up @@ -250,7 +250,7 @@ QMap<QString, CustomStyleSheetApplicator> RiuGuiTheme:
QRegularExpression textColorRegExp( "text-color:\\s*([#0-9a-zA-Z]+)" );
QString textColor = textColorRegExp.match( match.captured( "properties" ) ).captured( 1 );

const QWidgetList topLevelWidgets = RiaGuiApplication::instance()->topLevelWidgets();
const QWidgetList topLevelWidgets = QApplication::topLevelWidgets();

if ( !color.isEmpty() )
{
Expand Down Expand Up @@ -304,7 +304,7 @@ QMap<QString, CustomStyleSheetApplicator> RiuGuiTheme:
QRegularExpression textColorRegExp( "text-color:\\s*([#a-zA-Z0-9]+)" );
QString textColor = textColorRegExp.match( match.captured( "properties" ) ).captured( 1 );

const QWidgetList topLevelWidgets = RiaGuiApplication::instance()->topLevelWidgets();
const QWidgetList topLevelWidgets = QApplication::topLevelWidgets();

if ( !textColor.isEmpty() )
{
Expand Down Expand Up @@ -349,7 +349,7 @@ void RiuGuiTheme::updateGuiTheme( RiaDefines::ThemeEnum theme )
s_qwtPlotItemPropertiesMap.clear();

applyStyleSheet( theme );
const QWidgetList allWidgets = RiaGuiApplication::instance()->allWidgets();
const QWidgetList allWidgets = QApplication::allWidgets();
for ( QWidget* widget : allWidgets )
{
widget->style()->unpolish( widget );
Expand Down Expand Up @@ -503,7 +503,7 @@ bool RiuGuiTheme::writeStyleSheetToFile( RiaDefines::ThemeEnum theme, const QStr
preparseStyleSheet( theme, modifiedStyleSheet );
RiaGuiApplication* app = RiaGuiApplication::instance();
app->setStyleSheet( modifiedStyleSheet );
const QWidgetList topLevelWidgets = RiaGuiApplication::instance()->allWidgets();
const QWidgetList topLevelWidgets = QApplication::allWidgets();
for ( QWidget* widget : topLevelWidgets )
{
widget->style()->unpolish( widget );
Expand Down Expand Up @@ -768,7 +768,7 @@ void RiuGuiTheme::preparseStyleSheet( RiaDefines::ThemeEnum theme, QString& styl

QRegularExpression paletteRegExp( regExp );
QRegularExpressionMatchIterator matchIterator = paletteRegExp.globalMatch( styleSheet );
QPalette palette = RiaGuiApplication::instance()->palette();
QPalette palette = QApplication::palette();

while ( matchIterator.hasNext() )
{
Expand Down
2 changes: 1 addition & 1 deletion ApplicationLibCode/UserInterface/RiuViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ RiuViewer::RiuViewer( const QGLFormat& format, QWidget* parent )
, m_zScale( 1.0 )
{
cvf::Font* standardFont = RiaGuiApplication::instance()->defaultSceneFont();
QFont font = RiaGuiApplication::instance()->font();
QFont font = QApplication::font();

auto viewFontSize = RiaPreferences::current()->defaultSceneFontSize();
font.setPointSize( caf::FontTools::absolutePointSize( viewFontSize ) );
Expand Down

0 comments on commit 30bf234

Please sign in to comment.