From 114a878c64ce6f8223cfd22d76a20eb16d177e5e Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- .../opietoday/examplepluginwidget.cpp | 55 ++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 languages/cpp/app_templates/opietoday/examplepluginwidget.cpp (limited to 'languages/cpp/app_templates/opietoday/examplepluginwidget.cpp') diff --git a/languages/cpp/app_templates/opietoday/examplepluginwidget.cpp b/languages/cpp/app_templates/opietoday/examplepluginwidget.cpp new file mode 100644 index 00000000..b0cb0dcc --- /dev/null +++ b/languages/cpp/app_templates/opietoday/examplepluginwidget.cpp @@ -0,0 +1,55 @@ +#include +#include + +#include "%{APPNAMELC}widget.h" + +%{APPNAME}Widget::%{APPNAME}Widget( QWidget *parent, const char* name) + : QWidget(parent, name ) { + + m_exampleLabel = 0l; + m_layout = 0l; + + if ( m_exampleLabel ) { + delete m_exampleLabel; + } + + // since here a OClickableLabel is used, the plugin part will be clickable, and the actions + // that should be triggered when clicked are defined in slotClicked() + // of course also normal widgets can be used. + m_exampleLabel = new OClickableLabel( this ); + connect( m_exampleLabel, SIGNAL( clicked() ), this, SLOT( slotClicked() ) ); + + if ( m_layout ) { + delete m_layout; + } + m_layout = new QHBoxLayout( this ); + m_layout->setAutoAdd( true ); + + readConfig(); + getInfo(); +} + + +%{APPNAME}Widget::~%{APPNAME}Widget() { + delete m_exampleLabel; + delete m_layout; +} + + +void %{APPNAME}Widget::readConfig() { +// we dont have any config entries in this plugin +// normally this method is used after today config was used +} + + +void %{APPNAME}Widget::refresh() { + +} + +void %{APPNAME}Widget::getInfo() { + m_exampleLabel->setText( tr("%{APPNAME} text") ); +} + +void %{APPNAME}Widget::slotClicked() { + getInfo(); +} -- cgit v1.2.1