move rangemodel in a components plugin

This commit is contained in:
Marco Martin 2011-09-13 21:21:29 +02:00
parent e5b43a7357
commit 0fec8e54c5
26 changed files with 100 additions and 9 deletions

View File

@ -3,5 +3,4 @@ add_subdirectory(draganddrop)
add_subdirectory(graphicslayouts)
add_subdirectory(graphicswidgets)
add_subdirectory(qtextracomponents)
install(DIRECTORY plasmacomponents/ DESTINATION ${IMPORTS_INSTALL_DIR}/org/kde/plasma/components)
add_subdirectory(plasmacomponents)

View File

@ -10,7 +10,6 @@ set(corebindings_SRCS
svgitem.cpp
framesvgitem.cpp
dialog.cpp
qrangemodel.cpp
tooltip.cpp
)

View File

@ -32,7 +32,6 @@
#include "svgitem_p.h"
#include "theme_p.h"
#include "dialog.h"
#include "qrangemodel.h"
#include "tooltip.h"
void CoreBindingsPlugin::registerTypes(const char *uri)
@ -51,7 +50,6 @@ void CoreBindingsPlugin::registerTypes(const char *uri)
qmlRegisterType<Plasma::SortFilterModel>(uri, 0, 1, "SortFilterModel");
qmlRegisterType<DialogProxy>(uri, 0, 1, "Dialog");
qmlRegisterType<Plasma::QRangeModel>(uri, 0, 1, "RangeModel");
qmlRegisterType<ToolTipProxy>(uri, 0, 1, "ToolTip");
qmlRegisterInterface<Plasma::Service>("Service");

View File

@ -0,0 +1,22 @@
project(plasmacomponents)
set(plasmacomponents_SRCS
plasmacomponentsplugin.cpp
qrangemodel.cpp
)
INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}
${CMAKE_BINARY_DIR}
${KDE4_INCLUDES}
)
qt4_automoc(${plasmacomponents_SRCS})
add_library(plasmacomponentsplugin SHARED ${plasmacomponents_SRCS})
target_link_libraries(plasmacomponentsplugin ${QT_QTCORE_LIBRARY} ${QT_QTDECLARATIVE_LIBRARY})
install(TARGETS plasmacomponentsplugin DESTINATION ${IMPORTS_INSTALL_DIR}/org/kde/plasma/components)
install(DIRECTORY qml/ DESTINATION ${IMPORTS_INSTALL_DIR}/org/kde/plasma/components)

View File

@ -0,0 +1,36 @@
/*
* Copyright 2011 by Marco Martin <mart@kde.org>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "plasmacomponentsplugin.h"
#include <QtDeclarative/qdeclarative.h>
#include "qrangemodel.h"
void PlasmaComponentsPlugin::registerTypes(const char *uri)
{
Q_ASSERT(uri == QLatin1String("org.kde.plasma.components"));
qmlRegisterType<Plasma::QRangeModel>(uri, 0, 1, "RangeModel");
}
#include "plasmacomponentsplugin.moc"

View File

@ -0,0 +1,35 @@
/*
* Copyright 2011 by Marco Martin <mart@kde.org>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef PLASMACOMPONENTSPLUGIN_H
#define PLASMACOMPONENTSPLUGIN_H
#include <QDeclarativeExtensionPlugin>
class PlasmaComponentsPlugin : public QDeclarativeExtensionPlugin
{
Q_OBJECT
public:
void registerTypes(const char *uri);
};
Q_EXPORT_PLUGIN2(plasmacomponentsplugin, PlasmaComponentsPlugin)
#endif

View File

@ -39,7 +39,7 @@ Item {
height: 20
opacity: enabled ? 1.0 : 0.5
PlasmaCore.RangeModel {
RangeModel {
id: range
// default values

View File

@ -208,7 +208,7 @@ Item {
right: rightButton.left
}
PlasmaCore.RangeModel {
RangeModel {
id: range
minimumValue: 0

View File

@ -58,7 +58,7 @@ Item {
anchors.fill: parent
PlasmaCore.RangeModel {
RangeModel {
id: range
minimumValue: 0

View File

@ -101,7 +101,7 @@ Item {
anchors.centerIn: parent
PlasmaCore.RangeModel {
RangeModel {
id: range
minimumValue: 0.0

View File

@ -1,3 +1,5 @@
plugin plasmacomponentsplugin
BusyIndicator 0.1 BusyIndicator.qml
Button 0.1 Button.qml
ButtonGroup 0.1 ButtonGroup.js