2023-03-10 15:45:53 +01:00
|
|
|
/******************************************************************************
|
2023-04-06 09:23:37 +02:00
|
|
|
* QSkinny - Copyright (C) 2016 Uwe Rathmann
|
|
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
2023-03-10 15:45:53 +01:00
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
#include "QskMainView.h"
|
|
|
|
|
|
|
|
/*
|
|
|
|
This code is a placeholder implementation until we know
|
|
|
|
what kind of features we actually want to have
|
|
|
|
*/
|
|
|
|
class QskMainView::PrivateData
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
QPointer< QskControl > header;
|
|
|
|
QPointer< QskControl > body;
|
|
|
|
QPointer< QskControl > footer;
|
|
|
|
};
|
|
|
|
|
|
|
|
QskMainView::QskMainView( QQuickItem* parent )
|
|
|
|
: Inherited( Qt::Vertical, parent )
|
|
|
|
, m_data( new PrivateData )
|
|
|
|
{
|
|
|
|
setAutoAddChildren( false );
|
|
|
|
setSpacing( 0 );
|
|
|
|
}
|
|
|
|
|
|
|
|
QskMainView::~QskMainView()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
QskControl* QskMainView::header() const
|
|
|
|
{
|
|
|
|
return m_data->header;
|
|
|
|
}
|
|
|
|
|
|
|
|
void QskMainView::setHeader( QskControl* header )
|
|
|
|
{
|
|
|
|
if ( header == m_data->header )
|
|
|
|
return;
|
|
|
|
|
|
|
|
delete m_data->header;
|
|
|
|
m_data->header = header;
|
|
|
|
|
|
|
|
if( header )
|
|
|
|
{
|
|
|
|
header->setSection( QskAspect::Header );
|
|
|
|
insertItem( 0, header );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
QskControl* QskMainView::body() const
|
|
|
|
{
|
|
|
|
return m_data->body;
|
|
|
|
}
|
|
|
|
|
|
|
|
void QskMainView::setBody( QskControl* body )
|
|
|
|
{
|
|
|
|
if ( body == m_data->body )
|
|
|
|
return;
|
|
|
|
|
|
|
|
delete m_data->body;
|
|
|
|
m_data->body = body;
|
|
|
|
|
|
|
|
if( body )
|
|
|
|
{
|
|
|
|
body->setSection( QskAspect::Body );
|
|
|
|
insertItem( 1, body );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
QskControl* QskMainView::footer() const
|
|
|
|
{
|
|
|
|
return m_data->footer;
|
|
|
|
}
|
|
|
|
|
|
|
|
void QskMainView::setFooter( QskControl* footer )
|
|
|
|
{
|
|
|
|
if ( footer == m_data->footer )
|
|
|
|
return;
|
|
|
|
|
|
|
|
delete m_data->footer;
|
|
|
|
m_data->footer = footer;
|
|
|
|
|
|
|
|
if( footer )
|
|
|
|
{
|
|
|
|
footer->setSection( QskAspect::Footer );
|
|
|
|
insertItem( 2, footer );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#include "moc_QskMainView.cpp"
|