mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4683 clang-format on all files in ApplicationCode
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2016 Statoil ASA
|
||||
//
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -22,63 +22,65 @@
|
||||
#include "cafPdmUiPropertyView.h"
|
||||
|
||||
#include <QBoxLayout>
|
||||
#include <QDebug>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QStringList>
|
||||
#include <QTabWidget>
|
||||
#include <QWidget>
|
||||
#include <QDebug>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuPropertyViewTabWidget::RiuPropertyViewTabWidget(QWidget* parent, caf::PdmObject* object, const QString& windowTitle, const QStringList& uiConfigNameForTabs)
|
||||
: QDialog(parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
|
||||
RiuPropertyViewTabWidget::RiuPropertyViewTabWidget( QWidget* parent,
|
||||
caf::PdmObject* object,
|
||||
const QString& windowTitle,
|
||||
const QStringList& uiConfigNameForTabs )
|
||||
: QDialog( parent, Qt::WindowTitleHint | Qt::WindowSystemMenuHint )
|
||||
{
|
||||
setWindowTitle(windowTitle);
|
||||
setWindowTitle( windowTitle );
|
||||
|
||||
QTabWidget* tabWidget = new QTabWidget;
|
||||
|
||||
for (int i = 0; i < uiConfigNameForTabs.size(); i++)
|
||||
|
||||
for ( int i = 0; i < uiConfigNameForTabs.size(); i++ )
|
||||
{
|
||||
QHBoxLayout* widgetLayout = new QHBoxLayout;
|
||||
widgetLayout->setContentsMargins(0, 0, 0, 0);
|
||||
widgetLayout->setContentsMargins( 0, 0, 0, 0 );
|
||||
|
||||
QWidget* containerWidget = new QWidget;
|
||||
containerWidget->setLayout(widgetLayout);
|
||||
containerWidget->setLayout( widgetLayout );
|
||||
|
||||
caf::PdmUiPropertyView* pdmUiPropertyView = new caf::PdmUiPropertyView();
|
||||
pdmUiPropertyView->setUiConfigurationName(uiConfigNameForTabs[i]);
|
||||
pdmUiPropertyView->setUiConfigurationName( uiConfigNameForTabs[i] );
|
||||
|
||||
widgetLayout->addWidget(pdmUiPropertyView);
|
||||
widgetLayout->addWidget( pdmUiPropertyView );
|
||||
|
||||
tabWidget->addTab(containerWidget, uiConfigNameForTabs[i]);
|
||||
pdmUiPropertyView->showProperties(object);
|
||||
tabWidget->addTab( containerWidget, uiConfigNameForTabs[i] );
|
||||
pdmUiPropertyView->showProperties( object );
|
||||
|
||||
m_pageWidgets.push_back(pdmUiPropertyView);
|
||||
m_pageWidgets.push_back( pdmUiPropertyView );
|
||||
}
|
||||
|
||||
QVBoxLayout* dialogLayout = new QVBoxLayout;
|
||||
setLayout(dialogLayout);
|
||||
setLayout( dialogLayout );
|
||||
|
||||
dialogLayout->addWidget(tabWidget);
|
||||
dialogLayout->addWidget( tabWidget );
|
||||
|
||||
// Buttons
|
||||
m_dialogButtonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
||||
connect(m_dialogButtonBox, SIGNAL(accepted()), this, SLOT(accept()));
|
||||
connect(m_dialogButtonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
||||
|
||||
dialogLayout->addWidget(m_dialogButtonBox);
|
||||
m_dialogButtonBox = new QDialogButtonBox( QDialogButtonBox::Ok | QDialogButtonBox::Cancel );
|
||||
connect( m_dialogButtonBox, SIGNAL( accepted() ), this, SLOT( accept() ) );
|
||||
connect( m_dialogButtonBox, SIGNAL( rejected() ), this, SLOT( reject() ) );
|
||||
|
||||
dialogLayout->addWidget( m_dialogButtonBox );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuPropertyViewTabWidget::~RiuPropertyViewTabWidget()
|
||||
{
|
||||
for (auto w : m_pageWidgets)
|
||||
for ( auto w : m_pageWidgets )
|
||||
{
|
||||
w->showProperties(nullptr);
|
||||
w->showProperties( nullptr );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,35 +89,34 @@ RiuPropertyViewTabWidget::~RiuPropertyViewTabWidget()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QSize RiuPropertyViewTabWidget::minimumSizeHint() const
|
||||
{
|
||||
QSize maxSizeHint(0, 0);
|
||||
QSize maxSizeHint( 0, 0 );
|
||||
|
||||
for (auto w : m_pageWidgets)
|
||||
for ( auto w : m_pageWidgets )
|
||||
{
|
||||
QSize pageSize = w->minimumSizeHint();
|
||||
pageSize += QSize(0, 100);
|
||||
pageSize += QSize( 0, 100 );
|
||||
|
||||
maxSizeHint = maxSizeHint.expandedTo(pageSize);
|
||||
maxSizeHint = maxSizeHint.expandedTo( pageSize );
|
||||
}
|
||||
|
||||
return maxSizeHint;
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QSize RiuPropertyViewTabWidget::sizeHint() const
|
||||
{
|
||||
QSize maxSizeHint(0, 0);
|
||||
QSize maxSizeHint( 0, 0 );
|
||||
|
||||
for (auto w : m_pageWidgets)
|
||||
for ( auto w : m_pageWidgets )
|
||||
{
|
||||
//qDebug() << "tab size hint" << w->sizeHint();
|
||||
// qDebug() << "tab size hint" << w->sizeHint();
|
||||
|
||||
QSize pageSize = w->sizeHint();
|
||||
pageSize += QSize(0, 100);
|
||||
pageSize += QSize( 0, 100 );
|
||||
|
||||
maxSizeHint = maxSizeHint.expandedTo(pageSize);
|
||||
maxSizeHint = maxSizeHint.expandedTo( pageSize );
|
||||
}
|
||||
|
||||
return maxSizeHint;
|
||||
|
||||
Reference in New Issue
Block a user