![]() |
2010-08-10
, 22:30
|
Posts: 145 |
Thanked: 237 times |
Joined on Mar 2010
@ Helsinki
|
#2
|
#ifndef QMPKITESERVER_H #define QMPKITESERVER_H #include <QObject> #include "kiteserver.h" class QmpKiteServer : public kiteserver { Q_OBJECT public: QmpKiteServer(QObject *parent); signals: void play(); public slots: }; #endif // QMPKITESERVER_H
kite = new QmpKiteServer(this); QString script = "function play() {kiteConn.emitRemote(\"play\", \"\");} w = new QWidget; mainL = new QVBoxLayout; pl = new QPushButton(); pl.text=\">\"; w.setLayout(mainL); mainL.addWidget(pl); pl.clicked.connect(play); w.show();"; kite->init("QMp", "test", script, kite); connect(kite, SIGNAL(play()), playAction, SIGNAL(triggered())); kite->start();
This doesn't encourage users to use their devices like this, and application developers may think it's too hard to add such features. You can pretty much forget about getting remote control in many places it would be useful, like photo album slideshows.
And that's why I've started writing a remote GUI library! I just applied for Garage hosting, but I thought I'd start this thread immediately since I have a few screenshots. (Edit: hosting approved. Project page, SVN.)
It works like this:
1. The client scans the local network for remotely controllable software and presents a simple list.
2. The user selects a program.
3. The client downloads a QtScript file and executes it.
4. The file creates a GUI and communicates with the server using signals and slots.
I have a basic example working. I duplicated (over the network) the Play-button from the Music Player example that comes with Qt Creator. Here are some screenshots.
In my next post, I'll show how easy this is for the application developer.
Last edited by jnwi; 2010-08-24 at 19:32.