Developing web based applications using QT
-
[quote author="kowtham" date="1291648260"]Can anyone please tell me whether it is possible or any tools to develop web based applications using QT? or any chance in the near feature?[/quote]
AFAIK no.
-
[quote author="kowtham" date="1291648260"]Can anyone please tell me whether it is possible or any tools to develop web based applications using QT? or any chance in the near feature? . The example i can give is like cgicc.[/quote]
btw its Qt and not QT. QT stands for Quick Time.
-
I'm not exactly sure what you're after.
You can use QtWebKit within your application of course (this is QtWebKit forum). This WebView can be your entire application if you want.
In QML it is just:
@import QtQuick 1.0
import QtWebKit 1.0
Webview {
width: 800; height: 800
url: "http://www.google.com"
}
@If you're interested in running Qt code within the HTML served by the web server, this may prove useful:
http://qt.gitorious.org/qt/kinetic/blobs/43199af242918b3c77bb47bdcc3ec60f8236b0d3/examples/declarative/webview/qml-in-html.qml -
he is probably referring to having web based application running inside the browser. Say like an online photo editor.
-
Yes, everything is possible.
For starters, there is "Wt":http://webtoolkit.eu (web toolkit, usually pronounced "witty"), that is a C++ API, with a Qt flavor for building web applications.
Also, there is the possibility of developing the web client using Qt technologies, but that is probably not what you want if you mentioned Cgicc.
-
[quote author="disperso" date="1291657045"]Yes, everything is possible.
For starters, there is "Wt":http://webtoolkit.eu (web toolkit, usually pronounced "witty"), that is a C++ API, with a Qt flavor for building web applications.
Also, there is the possibility of developing the web client using Qt technologies, but that is probably not what you want if you mentioned Cgicc.[/quote]
disperso
Thank you for providing this info. I was not aware of it. Saw a few examples on charts and it works good in my browser.
-
There is this other toolkit, called "QtWui":http://qtwui.sourceforge.net/index.html . However, Wt seems more mature.
-
[quote author="anselmolsm" date="1291670036"]There is this other toolkit, called "QtWui":http://qtwui.sourceforge.net/index.html . However, Wt seems more mature.[/quote]
I gave it a quick look, and it seems that for now it requires using the provided web server (fast cgi is planned, but not yet). To me this is a no-go. :-(
I wish I could find a simple C++ library (with a good Qt-style API) that had some of the convenience classes that Java has, but that didn't include any of this "widget oriented web".
-
Hehe. Well, to me widget oriented is not necessarily easy. ;)
I would say is the other way around in many cases. QML is kind of an example of that. Is very web inspired (CSS/Javascript), and departs a little bit from the workflow of QWidget-based UIs.
I still like to build the pages in plain HTML and CSS. Is just the server-side of things that I would like to see more Qt-ish. :)
Oh, and something that I forgot previously. If Google makes the Native Client somewhat popular, Qt-based applications on the web would be the coolest thing ever! The first time I saw the screenshot of QML apps on the browser I was just blown away:
"http://labs.trolltech.com/blogs/2010/06/25/qt-for-google-native-client-preview/":http://labs.trolltech.com/blogs/2010/06/25/qt-for-google-native-client-preview/
-
[quote author="disperso" date="1291684566"]Qt-based applications on the web would be the coolest thing ever! The first time I saw the screenshot of QML apps on the browser I was just blown away:[/quote]
Hope you know you can already do this within a browser as I posted above:
Main.qml
@
import QtQuick 1.0
import QtWebKit 1.0WebView {
width: 500; height: 500
settings.pluginsEnabled: true
html: "<html>
<body bg color=white>
These are QML plugins, shown in a QML WebView via HTML OBJECT tags
<table border=1>
<tr><th>Duration <th>Color <th>Plugin
<tr><td>500 <td>red <td><OBJECT data=ColorSquare.qml TYPE=application/x-qt-plugin width=100 height=100 period=500 color=red />
<tr><td>2000 <td>blue <td><OBJECT data=ColorSquare.qml TYPE=application/x-qt-plugin width=100 height=100 period=2000 color=blue />
<tr><td>1000 <td>green <td><OBJECT data=ColorSquare.qml TYPE=application/x-qt-plugin width=100 height=100 period=1000 color=green />
</table>
</body>
</html>"
}@ColorSquare.qml
@
import QtQuick 1.0Item {
property int period: 250 //unused for sake of space
property string color: "black"
id: root
Item {
x: root.width/2; y: root.height/2
Rectangle {
color: root.color
width: root.width; height: width
x: -width/2; y: -height/2
}
}
}
@It will probably only work within a WebView or someone with the qtplugin installed though of course ;)
-
That's really, really cool, sure, but is more targeted to Qt developers that want to do "hybrid" development, isn't it?
What blew me away was the idea that maybe (ahem dreamer ahem) in the future we could see some cases where instead of using Flash, Silverlight, etc., some web developer chose QML instead.
-
Well I can make a web page right now with that source:
@
<html>
<body bg color=white>
These are QML plugins, shown in a QML WebView via HTML OBJECT tags
<table border=1>
<tr><th>Duration <th>Color <th>Plugin
<tr><td>500 <td>red <td><OBJECT data=ColorSquare.qml TYPE=application/x-qt-plugin width=100 height=100 period=500 color=red />
<tr><td>2000 <td>blue <td><OBJECT data=ColorSquare.qml TYPE=application/x-qt-plugin width=100 height=100 period=2000 color=blue />
<tr><td>1000 <td>green <td><OBJECT data=ColorSquare.qml TYPE=application/x-qt-plugin width=100 height=100 period=1000 color=green />
</table>
</body>
</html>
@Then you visit that webpage with your web browser (plugins enabled, QtWebKit):
@
import QtQuick 1.0
import QtWebKit 1.0
Webview {
width: 800; height: 800
settings.pluginsEnabled: true
url: "http://www.thathtmlshownabove.com"
}
@And you see QML elements in your web browser, based on Qt code, running from Qt libraries on your computer. The problem comes that you need Qt libraries. They aren't exactly small, so you can't expect them to download it right then and there to run your webpage. So you have to put in an alternative method for people who can't run it.
Sort of like ActiveX worked. So I wouldn't say it's just for hybrid development.
I guess the OP wasn't talking about UI though. He wants to run the server stuff with Qt.
-
Yes, that's the problem. How many QtWebkit browsers are there? I only know Arora, and it's nor popular nor frequently updated.
However, if the Native Client can be installed as a plugin and is not tied to Chrome/Chromium (can't remember right now), the user would install it the same way she installs Flash or Java, and then the browser would download and run the ".nexe" the same way it does with a SWF or JAR. No need to install Qt.
But yes, this is probably not much related to what the OP wanted. I should probably stop here. :P
-
[quote author="disperso" date="1291689765"]Yes, that's the problem. How many QtWebkit browsers are there? I only know Arora, and it's nor popular nor frequently updated.[/quote]
http://developer.qt.nokia.com/wiki/ApplicationsUsingQtWebKitThere's also @Web by Digia and several example WebKit browsers in the SDK.
-
Well you can develop Hybrid sort of application where Qt can be behind the scene and you can use Javascript and communicate with Qt. there is one good article how you can do this is here:
http://qt.nokia.com/qt-in-use/files/pdf/qt-features-for-hybrid-web-native-application-development
http://doc.qt.nokia.com/4.7-snapshot/qtwebkit-bridge.html[quote author="kowtham" date="1291648260"]Can anyone please tell me whether it is possible or any tools to develop web based applications using QT? or any chance in the near feature? . The example i can give is like cgicc.[/quote]
-
While It's not QT on the Web Directly, I've built a web application framework (inspired by QT with signals / slots, objects for gui elements, and a graphical interface builder) that enables building web apps in a similar fashion. If you are interested you can check it out here: "www.webbot.ws":http://www.webbot.ws