QskApplicationView -> QskMainView

This commit is contained in:
Uwe Rathmann 2023-03-10 15:45:53 +01:00
parent b55e5ee00a
commit 560cc607c9
6 changed files with 117 additions and 111 deletions

View File

@ -14,7 +14,7 @@
#include <SkinnyShapeProvider.h> #include <SkinnyShapeProvider.h>
#include <SkinnyNamespace.h> #include <SkinnyNamespace.h>
#include <QskApplicationView.h> #include <QskMainView.h>
#include <QskFocusIndicator.h> #include <QskFocusIndicator.h>
#include <QskObjectCounter.h> #include <QskObjectCounter.h>
#include <QskTabView.h> #include <QskTabView.h>
@ -182,10 +182,6 @@ namespace
} }
}; };
/*
Once QskApplicationView and friends are implemented we can replace
Header/ApplicationWindow with it. TODO ...
*/
class Header : public QskLinearBox class Header : public QskLinearBox
{ {
Q_OBJECT Q_OBJECT
@ -219,11 +215,11 @@ namespace
void enabledToggled( bool ); void enabledToggled( bool );
}; };
class ApplicationView : public QskApplicationView class MainView : public QskMainView
{ {
public: public:
ApplicationView( QQuickItem* parent = nullptr ) MainView( QQuickItem* parent = nullptr )
: QskApplicationView( parent ) : QskMainView( parent )
{ {
auto header = new Header( this ); auto header = new Header( this );
@ -260,7 +256,7 @@ int main( int argc, char* argv[] )
SkinnyShortcut::enable( SkinnyShortcut::AllShortcuts ); SkinnyShortcut::enable( SkinnyShortcut::AllShortcuts );
auto mainView = new ApplicationView(); auto mainView = new MainView();
QskWindow window; QskWindow window;
window.addItem( mainView ); window.addItem( mainView );

View File

@ -13,6 +13,7 @@
#include <QskAspect.h> #include <QskAspect.h>
#include <QskBoxBorderMetrics.h> #include <QskBoxBorderMetrics.h>
#include <QskBoxShapeMetrics.h> #include <QskBoxShapeMetrics.h>
#include <QskComboBox.h>
#include <QskDialog.h> #include <QskDialog.h>
#include <QskDialogButton.h> #include <QskDialogButton.h>
#include <QskDialogButtonBox.h> #include <QskDialogButtonBox.h>
@ -22,14 +23,18 @@
#include <QskGradient.h> #include <QskGradient.h>
#include <QskGradientDirection.h> #include <QskGradientDirection.h>
#include <QskGraphicLabel.h> #include <QskGraphicLabel.h>
#include <QskIcon.h>
#include <QskIntervalF.h> #include <QskIntervalF.h>
#include <QskLayoutMetrics.h> #include <QskLayoutMetrics.h>
#include <QskLabelData.h>
#include <QskMainView.h>
#include <QskMargins.h> #include <QskMargins.h>
#include <QskMessageWindow.h> #include <QskMessageWindow.h>
#include <QskPlacementPolicy.h> #include <QskPlacementPolicy.h>
#include <QskPopup.h> #include <QskPopup.h>
#include <QskProgressBar.h> #include <QskProgressBar.h>
#include <QskPushButton.h> #include <QskPushButton.h>
#include <QskRadioBox.h>
#include <QskScrollArea.h> #include <QskScrollArea.h>
#include <QskScrollView.h> #include <QskScrollView.h>
#include <QskSelectionWindow.h> #include <QskSelectionWindow.h>
@ -40,6 +45,7 @@
#include <QskSkin.h> #include <QskSkin.h>
#include <QskSkinManager.h> #include <QskSkinManager.h>
#include <QskSlider.h> #include <QskSlider.h>
#include <QskSpinBox.h>
#include <QskStandardSymbol.h> #include <QskStandardSymbol.h>
#include <QskStatusIndicator.h> #include <QskStatusIndicator.h>
#include <QskSubWindow.h> #include <QskSubWindow.h>
@ -200,8 +206,13 @@ void QskQml::registerTypes()
registerObject< QskLinearBoxQml >( "LinearBox" ); registerObject< QskLinearBoxQml >( "LinearBox" );
registerObject< QskControl >(); registerObject< QskControl >();
registerObject< QskMainView >();
registerObject< QskComboBox >();
registerObject< QskGraphicLabel >(); registerObject< QskGraphicLabel >();
registerObject< QskVirtualKeyboard >(); registerObject< QskVirtualKeyboard >();
registerObject< QskRadioBox >();
registerObject< QskSpinBox >();
registerObject< QskTextLabel >(); registerObject< QskTextLabel >();
registerObject< QskTabButton >(); registerObject< QskTabButton >();
registerObject< QskTabBar >(); registerObject< QskTabBar >();
@ -242,6 +253,8 @@ void QskQml::registerTypes()
registerGadget< QskLayoutMetrics >(); registerGadget< QskLayoutMetrics >();
registerGadget< QskMargins >(); registerGadget< QskMargins >();
registerGadget< QskIcon >();
registerGadget< QskLabelData >();
registerGadget< QskGradient >(); registerGadget< QskGradient >();
registerGadget< QskGradientStop >(); registerGadget< QskGradientStop >();
registerGadget< QskLinearDirection >(); registerGadget< QskLinearDirection >();

View File

@ -1,95 +0,0 @@
/******************************************************************************
* QSkinny - Copyright (C) 2022 Uwe Rathmann
* This file may be used under the terms of the QSkinny License, Version 1.0
*****************************************************************************/
#include "QskApplicationView.h"
class QskApplicationView::PrivateData
{
public:
PrivateData()
{
}
QskControl* header = nullptr;
QskControl* body = nullptr;
QskControl* footer = nullptr;
};
QskApplicationView::QskApplicationView( QQuickItem* parent )
: Inherited( Qt::Vertical, parent )
, m_data( new PrivateData )
{
setAutoAddChildren( false );
setSpacing( 0 );
}
QskApplicationView::~QskApplicationView()
{
}
QskControl* QskApplicationView::header() const
{
return m_data->header;
}
void QskApplicationView::setHeader( QskControl* header )
{
if( m_data->header )
{
removeItem( m_data->header );
}
m_data->header = header;
if( m_data->header )
{
m_data->header->setSection( QskAspect::Header );
insertItem( 0, m_data->header );
}
}
QskControl* QskApplicationView::body() const
{
return m_data->body;
}
void QskApplicationView::setBody( QskControl* body )
{
if( m_data->body )
{
removeItem( m_data->body );
}
m_data->body = body;
if( m_data->body )
{
m_data->body->setSection( QskAspect::Body );
insertItem( 1, m_data->body );
}
}
QskControl* QskApplicationView::footer() const
{
return m_data->footer;
}
void QskApplicationView::setFooter( QskControl* footer )
{
if( m_data->footer )
{
removeItem( m_data->footer );
}
m_data->footer = footer;
if( m_data->footer )
{
m_data->footer->setSection( QskAspect::Footer );
insertItem( 2, m_data->footer );
}
}
#include "moc_QskApplicationView.cpp"

View File

@ -0,0 +1,92 @@
/******************************************************************************
* QSkinny - Copyright (C) 2022 Uwe Rathmann
* This file may be used under the terms of the QSkinny License, Version 1.0
*****************************************************************************/
#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"

View File

@ -3,20 +3,20 @@
* This file may be used under the terms of the QSkinny License, Version 1.0 * This file may be used under the terms of the QSkinny License, Version 1.0
*****************************************************************************/ *****************************************************************************/
#ifndef QSK_APPLICATION_VIEW_H #ifndef QSK_MAIN_VIEW_H
#define QSK_APPLICATION_VIEW_H #define QSK_MAIN_VIEW_H
#include "QskLinearBox.h" #include "QskLinearBox.h"
class QSK_EXPORT QskApplicationView : public QskLinearBox class QSK_EXPORT QskMainView : public QskLinearBox
{ {
Q_OBJECT Q_OBJECT
using Inherited = QskLinearBox; using Inherited = QskLinearBox;
public: public:
QskApplicationView( QQuickItem* parent = nullptr ); QskMainView( QQuickItem* parent = nullptr );
~QskApplicationView() override; ~QskMainView() override;
QskControl* header() const; QskControl* header() const;
void setHeader( QskControl* ); void setHeader( QskControl* );

View File

@ -168,7 +168,6 @@ HEADERS += \
controls/QskAbstractButton.h \ controls/QskAbstractButton.h \
controls/QskAnimationHint.h \ controls/QskAnimationHint.h \
controls/QskAnimator.h \ controls/QskAnimator.h \
controls/QskApplicationView.h \
controls/QskBoundedControl.h \ controls/QskBoundedControl.h \
controls/QskBoundedInput.h \ controls/QskBoundedInput.h \
controls/QskBoundedRangeInput.h \ controls/QskBoundedRangeInput.h \
@ -194,6 +193,7 @@ HEADERS += \
controls/QskInputGrabber.h \ controls/QskInputGrabber.h \
controls/QskListView.h \ controls/QskListView.h \
controls/QskListViewSkinlet.h \ controls/QskListViewSkinlet.h \
controls/QskMainView.h \
controls/QskMenu.h \ controls/QskMenu.h \
controls/QskMenuSkinlet.h \ controls/QskMenuSkinlet.h \
controls/QskObjectTree.h \ controls/QskObjectTree.h \
@ -259,7 +259,6 @@ SOURCES += \
controls/QskAbstractButton.cpp \ controls/QskAbstractButton.cpp \
controls/QskAnimator.cpp \ controls/QskAnimator.cpp \
controls/QskAnimationHint.cpp \ controls/QskAnimationHint.cpp \
controls/QskApplicationView.cpp \
controls/QskBoundedControl.cpp \ controls/QskBoundedControl.cpp \
controls/QskBoundedInput.cpp \ controls/QskBoundedInput.cpp \
controls/QskBoundedRangeInput.cpp \ controls/QskBoundedRangeInput.cpp \
@ -285,6 +284,7 @@ SOURCES += \
controls/QskInputGrabber.cpp \ controls/QskInputGrabber.cpp \
controls/QskListView.cpp \ controls/QskListView.cpp \
controls/QskListViewSkinlet.cpp \ controls/QskListViewSkinlet.cpp \
controls/QskMainView.cpp \
controls/QskMenuSkinlet.cpp \ controls/QskMenuSkinlet.cpp \
controls/QskMenu.cpp \ controls/QskMenu.cpp \
controls/QskObjectTree.cpp \ controls/QskObjectTree.cpp \