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:
@@ -2,17 +2,17 @@
|
||||
//
|
||||
// Copyright (C) 2015- Statoil ASA
|
||||
// Copyright (C) 2015- Ceetron Solutions AS
|
||||
//
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -31,75 +31,81 @@
|
||||
#include <QVBoxLayout>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiuProjectAndPropertyView::RiuProjectAndPropertyView(QWidget* parent, Qt::WindowFlags f)
|
||||
: QWidget(parent, f)
|
||||
RiuProjectAndPropertyView::RiuProjectAndPropertyView( QWidget* parent, Qt::WindowFlags f )
|
||||
: QWidget( parent, f )
|
||||
{
|
||||
// Tree View
|
||||
m_projectTreeView = new caf::PdmUiTreeView;
|
||||
m_projectTreeView->treeView()->setHeaderHidden(true);
|
||||
m_projectTreeView->treeView()->setSelectionMode(QAbstractItemView::ExtendedSelection);
|
||||
m_projectTreeView->enableSelectionManagerUpdating(true);
|
||||
m_projectTreeView->treeView()->setHeaderHidden( true );
|
||||
m_projectTreeView->treeView()->setSelectionMode( QAbstractItemView::ExtendedSelection );
|
||||
m_projectTreeView->enableSelectionManagerUpdating( true );
|
||||
|
||||
// Install event filter used to handle key press events
|
||||
RiuTreeViewEventFilter* treeViewEventFilter = new RiuTreeViewEventFilter(this);
|
||||
m_projectTreeView->treeView()->installEventFilter(treeViewEventFilter);
|
||||
RiuTreeViewEventFilter* treeViewEventFilter = new RiuTreeViewEventFilter( this );
|
||||
m_projectTreeView->treeView()->installEventFilter( treeViewEventFilter );
|
||||
|
||||
// Drag and drop configuration
|
||||
m_projectTreeView->treeView()->setDragEnabled(true);
|
||||
m_projectTreeView->treeView()->viewport()->setAcceptDrops(true);
|
||||
m_projectTreeView->treeView()->setDropIndicatorShown(true);
|
||||
m_projectTreeView->treeView()->setDragDropMode(QAbstractItemView::DragDrop);
|
||||
m_projectTreeView->treeView()->setDragEnabled( true );
|
||||
m_projectTreeView->treeView()->viewport()->setAcceptDrops( true );
|
||||
m_projectTreeView->treeView()->setDropIndicatorShown( true );
|
||||
m_projectTreeView->treeView()->setDragDropMode( QAbstractItemView::DragDrop );
|
||||
|
||||
m_projectTreeView->treeView()->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
connect(m_projectTreeView->treeView(), SIGNAL(customContextMenuRequested(const QPoint&)), RiuMainWindow::instance(), SLOT(customMenuRequested(const QPoint&)));
|
||||
m_projectTreeView->treeView()->setContextMenuPolicy( Qt::CustomContextMenu );
|
||||
connect( m_projectTreeView->treeView(),
|
||||
SIGNAL( customContextMenuRequested( const QPoint& ) ),
|
||||
RiuMainWindow::instance(),
|
||||
SLOT( customMenuRequested( const QPoint& ) ) );
|
||||
|
||||
// Property view
|
||||
m_propertyView = new caf::PdmUiPropertyView;
|
||||
|
||||
connect(m_projectTreeView, SIGNAL(selectedObjectChanged(caf::PdmObjectHandle*)), m_propertyView, SLOT(showProperties(caf::PdmObjectHandle*)));
|
||||
connect( m_projectTreeView,
|
||||
SIGNAL( selectedObjectChanged( caf::PdmObjectHandle* ) ),
|
||||
m_propertyView,
|
||||
SLOT( showProperties( caf::PdmObjectHandle* ) ) );
|
||||
|
||||
QWidget* propertyEditorWithHeader = new QWidget;
|
||||
{
|
||||
QLabel* propertyHeader = new QLabel;
|
||||
propertyHeader->setText("Property Editor");
|
||||
propertyHeader->setStyleSheet("QLabel { background-color: #CCCCCC }");
|
||||
propertyHeader->setFixedHeight(20);
|
||||
propertyHeader->setText( "Property Editor" );
|
||||
propertyHeader->setStyleSheet( "QLabel { background-color: #CCCCCC }" );
|
||||
propertyHeader->setFixedHeight( 20 );
|
||||
|
||||
QVBoxLayout* layout = new QVBoxLayout;
|
||||
layout->setMargin(0);
|
||||
layout->addWidget(propertyHeader);
|
||||
layout->addWidget(m_propertyView);
|
||||
layout->setMargin( 0 );
|
||||
layout->addWidget( propertyHeader );
|
||||
layout->addWidget( m_propertyView );
|
||||
|
||||
propertyEditorWithHeader->setLayout(layout);
|
||||
propertyEditorWithHeader->setMinimumHeight(150);
|
||||
propertyEditorWithHeader->setLayout( layout );
|
||||
propertyEditorWithHeader->setMinimumHeight( 150 );
|
||||
}
|
||||
|
||||
QSplitter* splitter = new QSplitter(Qt::Vertical);
|
||||
splitter->addWidget(m_projectTreeView);
|
||||
splitter->addWidget(propertyEditorWithHeader);
|
||||
QSplitter* splitter = new QSplitter( Qt::Vertical );
|
||||
splitter->addWidget( m_projectTreeView );
|
||||
splitter->addWidget( propertyEditorWithHeader );
|
||||
|
||||
QVBoxLayout* layout = new QVBoxLayout;
|
||||
layout->setMargin(0);
|
||||
layout->addWidget(splitter);
|
||||
layout->setMargin( 0 );
|
||||
layout->addWidget( splitter );
|
||||
|
||||
setLayout(layout);
|
||||
setLayout( layout );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuProjectAndPropertyView::setPdmItem(caf::PdmUiItem* object)
|
||||
void RiuProjectAndPropertyView::setPdmItem( caf::PdmUiItem* object )
|
||||
{
|
||||
m_propertyView->showProperties(nullptr);
|
||||
m_projectTreeView->setPdmItem(object);
|
||||
m_propertyView->showProperties( nullptr );
|
||||
m_projectTreeView->setPdmItem( object );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuProjectAndPropertyView::showProperties(caf::PdmObjectHandle* object)
|
||||
void RiuProjectAndPropertyView::showProperties( caf::PdmObjectHandle* object )
|
||||
{
|
||||
m_propertyView->showProperties(object);
|
||||
m_propertyView->showProperties( object );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user