Files
ResInsight/cafUserInterface/cafPdmUiListView.cpp
Magne Sjaastad 15efd2fbcc Added list view editor to Pdm
p4#: 22306
2013-09-04 12:08:39 +02:00

71 lines
2.2 KiB
C++

//##################################################################################################
//
// Custom Visualization Core library
// Copyright (C) 2011-2012 Ceetron AS
//
// This library 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.
//
// This library 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>>
// for more details.
//
//##################################################################################################
#include "cafPdmUiListView.h"
#include "cafPdmObject.h"
#include "cafPdmUiListViewEditor.h"
#include <QHBoxLayout>
namespace caf
{
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
PdmUiListView::PdmUiListView(QWidget* parent, Qt::WindowFlags f)
: QWidget (parent, f)
{
m_layout = new QVBoxLayout(this);
m_layout->insertStretch(1, 1);
m_layout->setContentsMargins(0, 0, 0, 0);
m_layout->setSpacing(0);
setLayout(m_layout);
m_listViewEditor = new PdmUiListViewEditor();
m_layout->addWidget(m_listViewEditor->getOrCreateWidget(this));
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
PdmUiListView::~PdmUiListView()
{
if (m_listViewEditor) delete m_listViewEditor;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void PdmUiListView::setPdmObject(caf::PdmObject* object)
{
assert(m_listViewEditor);
m_listViewEditor->setPdmObject(object);
}
} //End of namespace caf