Skip to content

Commit

Permalink
worked on widget_component
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Tuerke committed Jul 14, 2012
1 parent 87d6b1c commit 0c00fa0
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 7 deletions.
6 changes: 3 additions & 3 deletions lib/core/util/widget_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ namespace glance
{
namespace widget
{

namespace _internal {
struct NoBaseWidget {};

}
/**
* Base class for widgets.
*/

template < class BASE = NoBaseWidget >
template < class BASE = _internal::NoBaseWidget >
class WidgetBase :
public plugin::PluginInterfaceBase,
public BASE,
Expand Down
4 changes: 2 additions & 2 deletions lib/qt4/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ macro( build_qt4 name type)
target_link_libraries( ${name} ${CMAKE_DL_LIBS} ${QT_LIBRARIES})
set_target_properties( ${name} PROPERTIES
${ISIS_GLANCE_QT4_BUILD_PROPERTIES}
SOVERSION ${ISIS_GLANCE_QT4_VERSION_SO}
VERSION ${ISIS_GLANCE_QT4_VERSION_API}
SOVERSION ${ISIS_GLANCE_VERSION_SO}
VERSION ${ISIS_GLANCE_VERSION_API}
INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib"
OUTPUT_NAME "isis_glance_qt4")
set(target_list ${target_list} ${name})
Expand Down
15 changes: 15 additions & 0 deletions lib/qt4/widget_component.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,18 @@
******************************************************************/
#include "widget_component.hpp"

namespace isis {
namespace glance {
namespace qt4 {

WidgetComponent::WidgetComponent(QWidget* parent, WidgetBaseType *widgetInterface ) :
QWidget( parent ),
widgetInterface_( widgetInterface )
{

}


} // end namespace qt4
} // end namespace glance
} // end namespace isis
15 changes: 13 additions & 2 deletions lib/qt4/widget_component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,28 @@
#ifndef _ISIS_GLANCE_WIDGET_COMPONENT_HPP
#define _ISIS_GLANCE_WIDGET_COMPONENT_HPP

#include <boost/shared_ptr.hpp>

#include <QWidget>
#include "util/widget_base.hpp"


namespace isis {
namespace glance {
namespace qt4 {

class WidgetComponent : public QWidget
{
Q_OBJECT

public:
typedef isis::glance::widget::WidgetBase<QWidget> WidgetBaseType;
WidgetComponent( QWidget *parent, WidgetBaseType *widgetInterface );

boost::shared_ptr< WidgetBaseType > get() const { return widgetInterface_; }

private:
boost::shared_ptr< WidgetBaseType > widgetInterface_;

};

} // end namespace qt4
Expand Down

0 comments on commit 0c00fa0

Please sign in to comment.