code moved to QskRgbValueQml

This commit is contained in:
Uwe Rathmann 2020-10-29 19:26:16 +01:00
parent 2fe846fa17
commit b8867dcd76
3 changed files with 35 additions and 19 deletions

View File

@ -7,6 +7,7 @@
#include "QskLayoutQml.h"
#include "QskShortcutQml.h"
#include "QskMainQml.h"
#include "QskRgbValueQml.h"
#include <QskCorner.h>
#include <QskDialog.h>
@ -24,7 +25,6 @@
#include <QskPopup.h>
#include <QskProgressBar.h>
#include <QskPushButton.h>
#include <QskRgbValue.h>
#include <QskScrollArea.h>
#include <QskScrollView.h>
#include <QskSelectionWindow.h>
@ -70,21 +70,6 @@ QSK_QT_PRIVATE_END
qmlRegisterSingletonType< className >( QSK_MODULE_NAME, 1, 0, typeName, \
[] ( QQmlEngine*, QJSEngine* ) { return dynamic_cast< QObject* >( singleton ); } )
// Expose values in QskRgbValue to QML
struct QskRgbValue_Gadget
{
enum Enum
{
#define RGB( name, value ) name = value,
QSK_RGB_VALUES
#undef RGB
};
Q_ENUM( Enum )
Q_GADGET
};
#if QT_VERSION >= QT_VERSION_CHECK( 6, 0, 0 )
#include <qloggingcategory.h>
@ -127,7 +112,11 @@ namespace
void QskQml::registerTypes()
{
#if 0
#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
qmlRegisterRevision< QQuickItem, 6 >( QSK_MODULE_NAME, 1, 0 );
#endif
#endif
qmlRegisterUncreatableType< QskSetup >( QSK_MODULE_NAME, 1, 0, "Setup", QString() );
qmlRegisterUncreatableType< QskSkin >( QSK_MODULE_NAME, 1, 0, "Skin", QString() );
@ -196,7 +185,7 @@ void QskQml::registerTypes()
WarningBlocker warningBlocker;
#endif
QSK_REGISTER_GADGET( QskRgbValue_Gadget, "RgbValue" );
QSK_REGISTER_GADGET( QskRgbValueQml, "RgbValue" );
QSK_REGISTER_GADGET( QskStandardSymbol, "StandardSymbol" );
QSK_REGISTER_GADGET( QskCorner, "Corner" );
QSK_REGISTER_GADGET( QskGradient, "Gradient" );
@ -271,5 +260,3 @@ void QskQml::registerTypes()
}
);
}
#include "QskQml.moc"

View File

@ -0,0 +1,28 @@
/******************************************************************************
* QSkinny - Copyright (C) 2016 Uwe Rathmann
* This file may be used under the terms of the QSkinny License, Version 1.0
*****************************************************************************/
#ifndef QSK_RGBVALUE_QML_H
#define QSK_RGBVALUE_QML_H
#include "QskQmlGlobal.h"
#include <QskRgbValue.h>
#include <qmetatype.h>
class QskRgbValueQml
{
Q_GADGET
public:
enum Enum
{
#define RGB( name, value ) name = value,
QSK_RGB_VALUES
#undef RGB
};
Q_ENUM( Enum )
};
#endif

View File

@ -10,6 +10,7 @@ HEADERS += \
QskQmlGlobal.h \
QskShortcutQml.h \
QskLayoutQml.h \
QskRgbValueQml.h \
QskMainQml.h \
QskQml.h