Archive for the ‘ qt4 ’ Category

Kate plugin experiment

Just a nasty experiment,

a kate plugin to open and visualize open files.

  • Open a new file (win + O)

  • View open files (win + B)

i haven’t had much time to refactor code so …
http://github.com/jgoday/newkateplugin
Advertisements

JNI with Qt part1

I work with java every day, using kde kate editor http://kate-editor.org/,
and i was wondering how nice it would be with a java autocompletation plugin.

So i started looking for a c++ library that could get information from a java class, with no results :(.

The only possibility that i could find was JNI.

Use jni to get the information directly from a java vm using java reflection.

Here is my first try with Qt4.5:
Continue reading

Rest client with Qt 4.5

It’s very easy to call a rest service from qt, even with authentication,
using QtNetwork/QNetworkAccessManager class
http://doc.trolltech.com/4.5/qnetworkaccessmanager.html.

Using the previous rest servlet sample.


    QNetworkAccessManager *manager = new QNetworkAccessManager(this);

    QObject::connect(manager, SIGNAL(finished(QNetworkReply *)),
                              SLOT(slotRequestFinished(QNetworkReply *)));

    QNetworkRequest request;
    request.setUrl(QUrl("http://localhost:8080/restservlet/sample/tommy"));
    request.setRawHeader("Authorization", "Basic " +
                         QByteArray(QString("%1:%2").arg("user").arg("asas").toAscii()).toBase64());
    request.setHeader(QNetworkRequest::ContentTypeHeader, "text/xml");

    QNetworkReply *reply = 0;
    reply = manager->get(request);

    QObject::connect(reply, SIGNAL(downloadProgress(qint64,qint64)),
                            SLOT(slotProgress(qint64,qint64)));

Continue reading