diff --git a/examples/gallery/main.cpp b/examples/gallery/main.cpp index 264691fcf..d602995b9 100644 --- a/examples/gallery/main.cpp +++ b/examples/gallery/main.cpp @@ -14,7 +14,7 @@ #include #include -#include +#include #include #include #include @@ -182,10 +182,6 @@ namespace } }; - /* - Once QskApplicationView and friends are implemented we can replace - Header/ApplicationWindow with it. TODO ... - */ class Header : public QskLinearBox { Q_OBJECT @@ -219,11 +215,11 @@ namespace void enabledToggled( bool ); }; - class ApplicationView : public QskApplicationView + class MainView : public QskMainView { public: - ApplicationView( QQuickItem* parent = nullptr ) - : QskApplicationView( parent ) + MainView( QQuickItem* parent = nullptr ) + : QskMainView( parent ) { auto header = new Header( this ); @@ -260,7 +256,7 @@ int main( int argc, char* argv[] ) SkinnyShortcut::enable( SkinnyShortcut::AllShortcuts ); - auto mainView = new ApplicationView(); + auto mainView = new MainView(); QskWindow window; window.addItem( mainView ); diff --git a/qmlexport/QskQml.cpp b/qmlexport/QskQml.cpp index a4bf4c0d4..0b120779c 100644 --- a/qmlexport/QskQml.cpp +++ b/qmlexport/QskQml.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -22,14 +23,18 @@ #include #include #include +#include #include #include +#include +#include #include #include #include #include #include #include +#include #include #include #include @@ -40,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -200,8 +206,13 @@ void QskQml::registerTypes() registerObject< QskLinearBoxQml >( "LinearBox" ); registerObject< QskControl >(); + + registerObject< QskMainView >(); + registerObject< QskComboBox >(); registerObject< QskGraphicLabel >(); registerObject< QskVirtualKeyboard >(); + registerObject< QskRadioBox >(); + registerObject< QskSpinBox >(); registerObject< QskTextLabel >(); registerObject< QskTabButton >(); registerObject< QskTabBar >(); @@ -242,6 +253,8 @@ void QskQml::registerTypes() registerGadget< QskLayoutMetrics >(); registerGadget< QskMargins >(); + registerGadget< QskIcon >(); + registerGadget< QskLabelData >(); registerGadget< QskGradient >(); registerGadget< QskGradientStop >(); registerGadget< QskLinearDirection >(); diff --git a/src/controls/QskApplicationView.cpp b/src/controls/QskApplicationView.cpp deleted file mode 100644 index 18c6b14f6..000000000 --- a/src/controls/QskApplicationView.cpp +++ /dev/null @@ -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" diff --git a/src/controls/QskMainView.cpp b/src/controls/QskMainView.cpp new file mode 100644 index 000000000..678dc54da --- /dev/null +++ b/src/controls/QskMainView.cpp @@ -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" diff --git a/src/controls/QskApplicationView.h b/src/controls/QskMainView.h similarity index 75% rename from src/controls/QskApplicationView.h rename to src/controls/QskMainView.h index c0cfa35ec..ec451cd47 100644 --- a/src/controls/QskApplicationView.h +++ b/src/controls/QskMainView.h @@ -3,20 +3,20 @@ * This file may be used under the terms of the QSkinny License, Version 1.0 *****************************************************************************/ -#ifndef QSK_APPLICATION_VIEW_H -#define QSK_APPLICATION_VIEW_H +#ifndef QSK_MAIN_VIEW_H +#define QSK_MAIN_VIEW_H #include "QskLinearBox.h" -class QSK_EXPORT QskApplicationView : public QskLinearBox +class QSK_EXPORT QskMainView : public QskLinearBox { Q_OBJECT using Inherited = QskLinearBox; public: - QskApplicationView( QQuickItem* parent = nullptr ); - ~QskApplicationView() override; + QskMainView( QQuickItem* parent = nullptr ); + ~QskMainView() override; QskControl* header() const; void setHeader( QskControl* ); diff --git a/src/src.pro b/src/src.pro index 09429d433..6cd9ba771 100644 --- a/src/src.pro +++ b/src/src.pro @@ -168,7 +168,6 @@ HEADERS += \ controls/QskAbstractButton.h \ controls/QskAnimationHint.h \ controls/QskAnimator.h \ - controls/QskApplicationView.h \ controls/QskBoundedControl.h \ controls/QskBoundedInput.h \ controls/QskBoundedRangeInput.h \ @@ -194,6 +193,7 @@ HEADERS += \ controls/QskInputGrabber.h \ controls/QskListView.h \ controls/QskListViewSkinlet.h \ + controls/QskMainView.h \ controls/QskMenu.h \ controls/QskMenuSkinlet.h \ controls/QskObjectTree.h \ @@ -259,7 +259,6 @@ SOURCES += \ controls/QskAbstractButton.cpp \ controls/QskAnimator.cpp \ controls/QskAnimationHint.cpp \ - controls/QskApplicationView.cpp \ controls/QskBoundedControl.cpp \ controls/QskBoundedInput.cpp \ controls/QskBoundedRangeInput.cpp \ @@ -285,6 +284,7 @@ SOURCES += \ controls/QskInputGrabber.cpp \ controls/QskListView.cpp \ controls/QskListViewSkinlet.cpp \ + controls/QskMainView.cpp \ controls/QskMenuSkinlet.cpp \ controls/QskMenu.cpp \ controls/QskObjectTree.cpp \