Page 1 of 1

Database support a la Evelevatesoft's Web Builder

Posted: Sun Jun 28, 2015 6:47 pm
by platysternon
Now that would be the feline's derrière...

Any chance of something like that coming in the not so distant future?

Re: Database support a la Evelevatesoft's Web Builder

Posted: Tue Jun 30, 2015 2:55 pm
by Fred
How does it works ? Is there a client side database ? If yes, how do they ensure it doesn't get deleted between browser session ? Adding a DB support isn't really a problem (there is even SQLite for Javascript), the issue here is to backup the file.

Re: Database support a la Evelevatesoft's Web Builder

Posted: Thu Jul 02, 2015 5:19 pm
by platysternon

Re: Database support a la Evelevatesoft's Web Builder

Posted: Fri Jul 03, 2015 3:52 pm
by the.weavster
I've just been going through some of the examples that come with QtCreator, amongst them is the QtWebChannel demo.

It shows how you can use the QWebSocketServer and QWebChannel Qt classes in conjunction with a client side library, qwebchannel.js, to bridge the gap between server and client. On the server side you create classes that descend from QObject to build the functionality you require and register them using a QWebChannel. On the client side you open a web socket, create a new QWebChannel (presumably defined in qwebchannel.js) and then write a little JavaScript to make your object(s) from the channel available in the client, e.g:

Code: Select all

var socket = new WebSocket(url);
socket.onopen = function() {

new QWebChannel(socket, function(channel)  {
    // make dialog object accessible globally
    // dialog is the custom class descended from QObject
    window.dialog = channel.objects.dialog;

....

});

}
It's almost like magic 8-)