Database support a la Evelevatesoft's Web Builder

Got an idea for enhancing SpiderBasic? New command(s) you'd like to see?
platysternon
Posts: 2
Joined: Sun Jun 28, 2015 6:43 pm

Database support a la Evelevatesoft's Web Builder

Post by platysternon »

Now that would be the feline's derrière...

Any chance of something like that coming in the not so distant future?
Fred
Site Admin
Posts: 1820
Joined: Mon Feb 24, 2014 10:51 am

Re: Database support a la Evelevatesoft's Web Builder

Post 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.
the.weavster
Posts: 229
Joined: Sat Mar 01, 2014 3:02 pm

Re: Database support a la Evelevatesoft's Web Builder

Post 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-)
Post Reply