This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Creating plasma applet in Qt Creator

Tags: None
(comma "," separated)
User avatar
RazrFalcon
Registered Member
Posts
23
Karma
0
OS

Creating plasma applet in Qt Creator

Wed Jun 08, 2011 10:09 pm
Can I use Qt .pro files for plasma applet creating, instead of cmake?
How should look .pro-file?

I didn't know than to replace those settings in .pro-file:
Code: Select all
find_package(KDE4 REQUIRED)
include(KDE4Defaults)

add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
include_directories(
   ${CMAKE_SOURCE_DIR}
   ${CMAKE_BINARY_DIR}
   ${KDE4_INCLUDES}
   )

kde4_add_plugin(plasma_applet_example ${example_SRCS})
target_link_libraries(plasma_applet_itmages ${KDE4_PLASMA_LIBS}
               ${KDE4_KDEUI_LIBS}
               ${KDE4_KIO_LIBS})


I think some thing like that:
Code: Select all
INCLUDEPATH += /usr/include/KDE/
LIBS += -lkdeui (and other, maybe)
...

And what about TEMPLATE, TARGET and others?

PS: sorry for bad english

Last edited by RazrFalcon on Fri Jun 10, 2011 11:17 am, edited 1 time in total.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
You need to use CMake to create a Plasma applet unfortunately. I think Qt creator supports CMake though...


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
User avatar
RazrFalcon
Registered Member
Posts
23
Karma
0
OS
Yes. I'm use Creator custom build steps to build via cmake and plasmoidviewer to run it.
Thanks for reply.
User avatar
RazrFalcon
Registered Member
Posts
23
Karma
0
OS
It can be done.
Here is example of .pro file:
Code: Select all
QT       += core gui

TARGET = plasma_applet_nowplaying
TEMPLATE = lib

OTHER_FILES += plasma-applet-nowplaying.desktop

HEADERS += nowplaying.h \
           infopanel.h \
           controls.h \
           albumart.h

SOURCES += nowplaying.cpp \
           infopanel.cpp \
           controls.cpp \
           albumart.cpp

INCLUDEPATH +="/usr/include/KDE/"

LIBS +=-lkdecore -lkdeui -lkutils -lkio

unix {
  INSTALLS        += target \
                     desktop

  desktop.path       = /usr/share/kde4/services/
  desktop.files     += plasma-applet-nowplaying.desktop
  target.path        = /usr/lib/kde4/
  target.files      += libplasma_applet_nowplaying.so
}


And nowplaying applet works fine!


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell