Revive UiLoader a bit as discussed on list.
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=879713
This commit is contained in:
parent
7c7f8b098a
commit
8a4bc36925
@ -57,13 +57,13 @@ set(plasma_LIB_SRCS
|
||||
scripting/dataenginescript.cpp
|
||||
scripting/runnerscript.cpp
|
||||
scripting/scriptengine.cpp
|
||||
scripting/uiloader.cpp
|
||||
service.cpp
|
||||
servicejob.cpp
|
||||
svg.cpp
|
||||
theme.cpp
|
||||
tooltipcontent.cpp
|
||||
tooltipmanager.cpp
|
||||
uiloader.cpp
|
||||
version.cpp
|
||||
view.cpp
|
||||
wallpaper.cpp
|
||||
@ -166,7 +166,6 @@ set(plasma_LIB_INCLUDES
|
||||
theme.h
|
||||
tooltipcontent.h
|
||||
tooltipmanager.h
|
||||
uiloader.h
|
||||
tooltipmanager.h
|
||||
version.h
|
||||
view.h
|
||||
@ -210,6 +209,7 @@ install(FILES
|
||||
scripting/dataenginescript.h
|
||||
scripting/runnerscript.h
|
||||
scripting/scriptengine.h
|
||||
scripting/uiloader.h
|
||||
DESTINATION ${INCLUDE_INSTALL_DIR}/plasma/scripting COMPONENT Devel)
|
||||
|
||||
|
||||
|
@ -1,2 +1,2 @@
|
||||
#include "../../plasma/uiloader.h"
|
||||
#include "../../plasma/scripting/uiloader.h"
|
||||
|
||||
|
@ -19,7 +19,10 @@
|
||||
|
||||
#include "uiloader.h"
|
||||
|
||||
#include <QGraphicsGridLayout>
|
||||
#include <QGraphicsLinearLayout>
|
||||
#include <QStringList>
|
||||
|
||||
#include "widgets/checkbox.h"
|
||||
#include "widgets/combobox.h"
|
||||
#include "widgets/flashinglabel.h"
|
||||
@ -62,6 +65,10 @@ UiLoader::UiLoader(QObject *parent)
|
||||
<< "Slider"
|
||||
<< "TabBar"
|
||||
<< "TextEdit";
|
||||
|
||||
d->layouts
|
||||
<< "GridLayout"
|
||||
<< "LinearLayout";
|
||||
}
|
||||
|
||||
UiLoader::~UiLoader()
|
||||
@ -112,17 +119,14 @@ QStringList UiLoader::availableLayouts() const
|
||||
return d->layouts;
|
||||
}
|
||||
|
||||
Layout *UiLoader::createLayout(const QString &className, LayoutItem *parent)
|
||||
QGraphicsLayout *UiLoader::createLayout(const QString &className, QGraphicsLayoutItem *parent)
|
||||
{
|
||||
#ifdef RICHARD_WORK
|
||||
if (className == QString("HBoxLayout")) {
|
||||
return new HBoxLayout(parent);
|
||||
} else if (className == QString("VBoxLayout")) {
|
||||
return new VBoxLayout(parent);
|
||||
} else if (className == QString("FlowLayout")) {
|
||||
return new FlowLayout(parent);
|
||||
if (className == QString("GridLayout")) {
|
||||
return new QGraphicsGridLayout(parent);
|
||||
} else if (className == QString("LinearLayout")) {
|
||||
return new QGraphicsLinearLayout(parent);
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -31,8 +31,6 @@ class QGraphicsProxyWidget;
|
||||
namespace Plasma
|
||||
{
|
||||
|
||||
class Layout;
|
||||
class LayoutItem;
|
||||
class UiLoaderPrivate;
|
||||
|
||||
/**
|
||||
@ -54,7 +52,7 @@ public:
|
||||
QGraphicsWidget *createWidget(const QString &className, QGraphicsWidget *parent = 0);
|
||||
|
||||
QStringList availableLayouts() const;
|
||||
Layout *createLayout(const QString &className, LayoutItem *parent);
|
||||
QGraphicsLayout *createLayout(const QString &className, QGraphicsLayoutItem *parent);
|
||||
|
||||
private:
|
||||
UiLoaderPrivate *const d;
|
Loading…
Reference in New Issue
Block a user