6#include "QskMainView.h"
13class QskMainView::PrivateData
16 QPointer< QskControl > header;
17 QPointer< QskControl > body;
18 QPointer< QskControl > footer;
21QskMainView::QskMainView( QQuickItem* parent )
22 : Inherited( Qt::Vertical, parent )
23 , m_data( new PrivateData )
25 setAutoAddChildren(
false );
29 setFlag( QQuickItem::ItemIsFocusScope,
true );
31 setFocusPolicy( Qt::StrongFocus );
34QskMainView::~QskMainView()
40 return m_data->header;
43void QskMainView::setHeader(
QskControl* header )
45 if ( header == m_data->header )
48 delete m_data->header;
49 m_data->header = header;
53 header->setSection( QskAspect::Header );
54 insertItem( 0, header );
65 if ( body == m_data->body )
73 body->setSection( QskAspect::Body );
74 insertItem( 1, body );
80 return m_data->footer;
83void QskMainView::setFooter(
QskControl* footer )
85 if ( footer == m_data->footer )
88 delete m_data->footer;
89 m_data->footer = footer;
93 footer->setSection( QskAspect::Footer );
94 insertItem( 2, footer );
98void QskMainView::focusInEvent( QFocusEvent* event )
100 Inherited::focusInEvent( event );
102 if ( isFocusScope() && ( scopedFocusItem() ==
nullptr ) )
104 if (
auto focusItem = nextItemInFocusChain(
true ) )
106 if ( !qskIsItemInDestructor( focusItem )
107 && qskIsAncestorOf(
this, focusItem ) )
109 focusItem->setFocus(
true );
115#include "moc_QskMainView.cpp"
Base class of all controls.