Things I Learnt From Making Plasmoid Kdictionary

I was busy making a KDE plasmoid named kdictionary recently. And I found myself actually learnt a lot through this process.

QtQuick

Of course. I never programme in QML before but now I am a big fan of it. It’s very easy to get start and cook couples of small applications. Although I used QtQuick 1.1 from Qt 4.8, I recommend you use QtQuick 2.0 from Qt 5 for the sake of convience and new Qt magic.

Qt

Haha.. Qt is another thing. I start another project kdictionary-lingoes to port LingoesLD2Reader.java to C++ realm. Well, Qt provides tons of useful and powerful libraries which you definitely need outside of standard C++.

Hmm.. I have to mention that function QString::toStdString() actually implements toascii(), which result in losses of some unicode character. To fix that, you need to use std::string() to wrap the data of QString. i.e. std::string(getDef(input).toUtf8().data())

KDE Plasmoid

Out of question. I made plasmoid of course I knew something new from it.

The configuration dialog UI file is config.ui, use QtDesigner to finish design work. Make sure that the name of checkbox or some control stuffs like that has a prefix kcfg_ (Just check what I done in kdictionary). Because that will let Plasmoid and QML do a magic work to integrate the UI file and the configuration data file main.xml.

Oh, use plasmate to cook your plasma-stuffs. But remember that tool has a lot of bugs and TODOs. :–)

REALLY looking forward to taste KDE 5 and Plasma 2. (some annoying problems are only fixed in Qt5, along with many long-waited functions.)

Comments