Wednesday, October 15th 2008, 9:40pm UTC+1

You are not logged in.

  • Login
  • Register

leoqt

Beginner

1

Sunday, March 2nd 2008, 8:09pm

kicker applet

Hello
I'd like to create a applet for the kicker but I don't find a tutorial
If have Kdevelop if some one help me to start. I'd like to create a kicker that have 3 buttons. For example (amarok--play , pause , stop).
I now that this kicker already exist but id like to start create applets with this.

Thank's
  • Go to the top of the page

nijish

Trainee

Posts: 154

Location: Bangalore

Occupation: Software Engineer

2

Saturday, March 8th 2008, 10:36am

hey leo.. if you get know something let me/us know too.. :)
  • Go to the top of the page

leoqt

Beginner

3

Monday, March 10th 2008, 4:25pm

Quoted

Originally posted by nijish
hey leo.. if you get know something let me/us know too.. :)


If you use kdevelop you can create an "hello applet". Unfortunately I don't know programming in qt but I think that someone who know qt are able to modify it.

I will report piece of "hello applet" it create a display (42).
If you can help me .....

Quoted


#include <qlcdnumber.h>
#include <kglobal.h>
#include <klocale.h>
#include <kconfig.h>
#include <kapplication.h>
#include <kmessagebox.h>

#include "firstapplet.h"


Firstapplet::Firstapplet(const QString& configFile, Type type, int actions, QWidget *parent, const char *name)
: KPanelApplet(configFile, type, actions, parent, name)
{
// Get the current application configuration handle
ksConfig = config();
QLCDNumber *w = new QLCDNumber(this);
w->display(42);

mainView = w;
mainView->show();
}


Firstapplet::~Firstapplet()
{
}


void Firstapplet::about()
{
KMessageBox::information(0, i18n("This is an about box"));
}


void Firstapplet::help()
{
KMessageBox::information(0, i18n("This is a help box"));
}


void Firstapplet::preferences()
{
KMessageBox::information(0, i18n("This is a preferences box"));
}

int Firstapplet::widthForHeight(int height) const
{
return width();
}

int Firstapplet::heightForWidth(int width) const
{
return height();
}

void Firstapplet::resizeEvent(QResizeEvent *e)
{
}


extern "C"
{
KPanelApplet* init( QWidget *parent, const QString& configFile)
{
KGlobal::locale()->insertCatalogue("firstapplet");
return new Firstapplet(configFile, KPanelApplet::Normal,
KPanelApplet::About | KPanelApplet::Help | KPanelApplet::Preferences,
parent, "firstapplet");
}
}
  • Go to the top of the page

Rate this thread