[Interest] porting a tcl gui to qt

Jonathan Wilkes jancsika at yahoo.com
Sun Jul 6 21:28:19 CEST 2014


On 07/01/2014 02:17 PM, Josiah Bryan wrote:
> I've written a basic generic QVariantMap server/client set of classes. 
> I know this code is probably rather rough - might just be better used 
> as an "example" or a starting point on writing your own. Take it for 
> what it's worth, here's the code:
>
> https://code.google.com/p/livepro/source/browse/trunk/varnet
>
> The "server" end would use VariantMapServer (derived from QTcpServer) 
> and connect to the "receivedMap(QVariantMap)" signal to receive input 
> from clients, and use the "sendMap(QVariantMap)" slot to send data to 
> the clients.
>
> The "client" end would use the "VariantMapClient" class which offers 
> the same pair of signal and slots to send/receive QVariantMaps.

Hi Josiah,
Thanks a lot, I'll check this out.

Best,
Jonathan

>
>
>
> On Tue, Jul 1, 2014 at 3:38 AM, Konrad Rosenbaum <konrad at silmor.de 
> <mailto:konrad at silmor.de>> wrote:
>
>     On Tue, July 1, 2014 00:05, Jonathan Wilkes wrote:
>     > On 06/30/2014 03:30 PM, Alejandro Exojo wrote:
>     > I suppose I am looking for a kind of UI protocol.  Here's another
>     > question-- do you know any cross-platform apps with a Qt GUI
>     that talks
>     > to the "main" process over a socket?
>
>     I've written a few of those - I always wrote the protocol myself
>     on top of
>     QTcpSocket or QLocalSocket.
>
>     The protocol you are using right now is probably a good starting
>     point -
>     you'll just have to write your command parser yourself.
>
>     I recommend using a registry(*) for your main items and use their
>     IDs just
>     like you used the Tk item/widget names as "command", then
>     interpret the
>     remainder of the commands - it usually is a simple matter of using
>     QString::split and handing the result to some hierarchy of methods
>     to do
>     the evaluation of the components.
>
>     (*) QMap<int,QGraphicsItem*>registry; or the better
>     QMap<int,QPointer<MyPdItemClass> >; with MyPdItemClass containing
>     enough
>     logic to work in the context of your program as well as taking care of
>     item deletion, etc.
>
>     I would also recommend updating the protocol to exchange high-level
>     information instead of actual widget commands - more like "item1234
>     setActive 1" instead of ".item1234 setColor green".
>
>
>        Konrad
>
>     _______________________________________________
>     Interest mailing list
>     Interest at qt-project.org <mailto:Interest at qt-project.org>
>     http://lists.qt-project.org/mailman/listinfo/interest
>
>
>
>
> -- 
> Josiah Bryan
> 765-215-0511
> josiahbryan at gmail.com <mailto:josiahbryan at gmail.com>
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140706/22c44745/attachment.html>


More information about the Interest mailing list