Commit 53d1e7e2 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

added: plugin for Qt Designer adding support for the widgets from the Okteta gui library

svn path=/trunk/KDE/kdeutils/okteta/; revision=1022878
parent ae45399d
......@@ -9,4 +9,5 @@ add_subdirectory( includes )
add_subdirectory( kasten )
add_subdirectory( parts )
add_subdirectory( designer )
add_subdirectory( program )
......@@ -24,6 +24,9 @@ gui:
includes:
headers of the basic libraries of Okteta
designer:
plugin for Qt Designer to add support for widgets from the Okteta gui library
kasten:
Okteta elements for the Kasten framework (currently found in libs/kasten)
......
project( oktetadesignerplugin )
set( OKTETA_REL_DIR .. )
include_directories(
${OKTETA_REL_DIR}/core
${OKTETA_REL_DIR}/gui/libcolumnsview
${OKTETA_REL_DIR}/gui
)
set( oktetadesignerplugin_SRCS
bytearraycolumnviewdesignerfactory.cpp
bytearrayrowviewdesignerfactory.cpp
oktetawidgetdesignerfactorycollection.cpp
main.cpp
)
kde4_add_plugin( oktetadesignerplugin ${oktetadesignerplugin_SRCS} )
target_link_libraries( oktetadesignerplugin
oktetagui
# oktetacore
${QT_QTGUI_LIBRARY}
${QT_QTCORE_LIBRARY}
)
install( TARGETS oktetadesignerplugin DESTINATION ${PLUGIN_INSTALL_DIR}/plugins/designer )
Okteta Qt Designer plugin
=========================
part of the Okteta project, a part of the KDE project.
Copyright: 2009 Friedrich W. H. Kossebau <kossebau@kde.org>
Author/Maintainer: Friedrich W. H. Kossebau <kossebau@kde.org>
description:
-----------
The Okteta Qt Designer plugin adds support for the widgets from the Okteta gui library.
So developers are able to use these widgets in UI files.
/*
This file is part of the Okteta Designer plugin, part of the KDE project.
Copyright 2009 Friedrich W. H. Kossebau <kossebau@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) version 3, or any
later version accepted by the membership of KDE e.V. (or its
successor approved by the membership of KDE e.V.), which shall
act as a proxy defined in Section 6 of version 3 of the license.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include "bytearraycolumnviewdesignerfactory.h"
// Okteta gui
#include <bytearraycolumnview.h>
// TODO: add translations for visible names
ByteArrayColumnViewDesignerFactory::ByteArrayColumnViewDesignerFactory( QObject* parent )
: QObject( parent )
{
}
QWidget* ByteArrayColumnViewDesignerFactory::createWidget( QWidget* parent )
{
return new Okteta::ByteArrayColumnView( 0, parent );
}
QString ByteArrayColumnViewDesignerFactory::group() const
{
return QString::fromLatin1("Okteta (KDE)");
}
QIcon ByteArrayColumnViewDesignerFactory::icon() const
{
return QIcon();
}
QString ByteArrayColumnViewDesignerFactory::includeFile() const
{
return QString::fromLatin1("KDE/Okteta/ByteArrayColumnView");
}
QString ByteArrayColumnViewDesignerFactory::toolTip() const
{
return QString::fromLatin1("Column oriented Viewer/Editor for Byte Arrays");
}
QString ByteArrayColumnViewDesignerFactory::whatsThis() const
{
return QString::fromLatin1("A widget to show and edit byte arrays provided by subclasses of Okteta::AbstractByteArrayModel");
}
bool ByteArrayColumnViewDesignerFactory::isContainer() const
{
return false;
}
QString ByteArrayColumnViewDesignerFactory::name() const
{
return QString::fromLatin1("Okteta::ByteArrayColumnView");
}
/*
This file is part of the Okteta Designer plugin, part of the KDE project.
Copyright 2009 Friedrich W. H. Kossebau <kossebau@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) version 3, or any
later version accepted by the membership of KDE e.V. (or its
successor approved by the membership of KDE e.V.), which shall
act as a proxy defined in Section 6 of version 3 of the license.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef BYTEARRAYCOLUMNVIEWDESIGNERFACTORY_H
#define BYTEARRAYCOLUMNVIEWDESIGNERFACTORY_H
// Qt
#include <QtDesigner/QDesignerCustomWidgetInterface>
#include <QtCore/QObject>
class ByteArrayColumnViewDesignerFactory : public QObject,
public QDesignerCustomWidgetInterface
{
Q_OBJECT
Q_INTERFACES(
QDesignerCustomWidgetInterface
)
public:
explicit ByteArrayColumnViewDesignerFactory( QObject* parent = 0 );
public: // QDesignerCustomWidgetInterface API
virtual QWidget* createWidget( QWidget* parent );
virtual QString group() const;
virtual QIcon icon() const;
virtual QString includeFile() const;
virtual bool isContainer() const;
virtual QString name() const;
virtual QString toolTip() const;
virtual QString whatsThis() const;
};
#endif
/*
This file is part of the Okteta Designer plugin, part of the KDE project.
Copyright 2009 Friedrich W. H. Kossebau <kossebau@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) version 3, or any
later version accepted by the membership of KDE e.V. (or its
successor approved by the membership of KDE e.V.), which shall
act as a proxy defined in Section 6 of version 3 of the license.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include "bytearrayrowviewdesignerfactory.h"
// Okteta gui
#include <bytearrayrowview.h>
// Qt
#include <QtCore/QtPlugin>
// TODO: add translations for visible names
ByteArrayRowViewDesignerFactory::ByteArrayRowViewDesignerFactory( QObject* parent )
: QObject( parent )
{
}
QWidget* ByteArrayRowViewDesignerFactory::createWidget( QWidget* parent )
{
// TODO: why does this constructor differ from the column one?
return new Okteta::ByteArrayRowView( /*0, */parent );
}
QString ByteArrayRowViewDesignerFactory::group() const
{
return QString::fromLatin1("Okteta (KDE)");
}
QIcon ByteArrayRowViewDesignerFactory::icon() const
{
return QIcon();
}
QString ByteArrayRowViewDesignerFactory::includeFile() const
{
return QString::fromLatin1("KDE/Okteta/ByteArrayRowView");
}
QString ByteArrayRowViewDesignerFactory::toolTip() const
{
return QString::fromLatin1("Row oriented Viewer/Editor for Byte Arrays");
}
QString ByteArrayRowViewDesignerFactory::whatsThis() const
{
return QString::fromLatin1("A widget to show and edit byte arrays provided by subclasses of Okteta::AbstractByteArrayModel");
}
bool ByteArrayRowViewDesignerFactory::isContainer() const
{
return false;
}
QString ByteArrayRowViewDesignerFactory::name() const
{
return QString::fromLatin1("Okteta::ByteArrayRowView");
}
/*
This file is part of the Okteta Designer plugin, part of the KDE project.
Copyright 2009 Friedrich W. H. Kossebau <kossebau@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) version 3, or any
later version accepted by the membership of KDE e.V. (or its
successor approved by the membership of KDE e.V.), which shall
act as a proxy defined in Section 6 of version 3 of the license.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef BYTEARRAYROWVIEWDESIGNERFACTORY_H
#define BYTEARRAYROWVIEWDESIGNERFACTORY_H
// Qt
#include <QtDesigner/QDesignerCustomWidgetInterface>
#include <QtCore/QObject>
class ByteArrayRowViewDesignerFactory : public QObject,
public QDesignerCustomWidgetInterface
{
Q_OBJECT
Q_INTERFACES(
QDesignerCustomWidgetInterface
)
public:
explicit ByteArrayRowViewDesignerFactory( QObject* parent = 0 );
public: // QDesignerCustomWidgetInterface API
virtual QWidget* createWidget( QWidget* parent );
virtual QString group() const;
virtual QIcon icon() const;
virtual QString includeFile() const;
virtual bool isContainer() const;
virtual QString name() const;
virtual QString toolTip() const;
virtual QString whatsThis() const;
};
#endif
/*
This file is part of the Okteta Designer plugin, part of the KDE project.
Copyright 2009 Friedrich W. H. Kossebau <kossebau@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) version 3, or any
later version accepted by the membership of KDE e.V. (or its
successor approved by the membership of KDE e.V.), which shall
act as a proxy defined in Section 6 of version 3 of the license.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
// lib
#include "oktetawidgetdesignerfactorycollection.h"
// Qt
#include <QtCore/QtPlugin>
Q_EXPORT_PLUGIN2( oktetadesignerplugin, OktetaWidgetDesignerFactoryCollection )
/*
This file is part of the Okteta Designer plugin, part of the KDE project.
Copyright 2009 Friedrich W. H. Kossebau <kossebau@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) version 3, or any
later version accepted by the membership of KDE e.V. (or its
successor approved by the membership of KDE e.V.), which shall
act as a proxy defined in Section 6 of version 3 of the license.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include "oktetawidgetdesignerfactorycollection.h"
// plugin
#include "bytearraycolumnviewdesignerfactory.h"
#include "bytearrayrowviewdesignerfactory.h"
OktetaWidgetDesignerFactoryCollection::OktetaWidgetDesignerFactoryCollection( QObject* parent )
: QObject( parent )
{
mWidgetFactories.append( new ByteArrayColumnViewDesignerFactory(this) );
mWidgetFactories.append( new ByteArrayRowViewDesignerFactory(this) );
}
QList<QDesignerCustomWidgetInterface*> OktetaWidgetDesignerFactoryCollection::customWidgets() const
{
return mWidgetFactories;
}
\ No newline at end of file
/*
This file is part of the Okteta Designer plugin, part of the KDE project.
Copyright 2009 Friedrich W. H. Kossebau <kossebau@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) version 3, or any
later version accepted by the membership of KDE e.V. (or its
successor approved by the membership of KDE e.V.), which shall
act as a proxy defined in Section 6 of version 3 of the license.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OKTETAWIDGETDESIGNERFACTORYCOLLECTION_H
#define OKTETAWIDGETDESIGNERFACTORYCOLLECTION_H
// Qt
#include <QtDesigner/QDesignerCustomWidgetCollectionInterface>
#include <QtCore/QObject>
class OktetaWidgetDesignerFactoryCollection : public QObject,
public QDesignerCustomWidgetCollectionInterface
{
Q_OBJECT
Q_INTERFACES(
QDesignerCustomWidgetCollectionInterface
)
public:
explicit OktetaWidgetDesignerFactoryCollection( QObject* parent = 0 );
public: // QDesignerCustomWidgetCollectionInterface API
virtual QList<QDesignerCustomWidgetInterface*> customWidgets() const;
private:
QList<QDesignerCustomWidgetInterface*> mWidgetFactories;
};
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment