Projekat

Općenito

Profil

Akcije

Prijedlozi #18048

Zatvoren

qt 4.6 declarative ui, qt-interest, GPL-LGPL qt-mysql

Dodano od Ernad Husremović prije skoro 16 godina. Izmjenjeno prije oko 15 godina.

Status:
Zatvoreno
Prioritet:
Normalan
Odgovorna osoba:
Kategorija:
-
Početak:
30.07.2009
Završetak:
% završeno:

0%

Procjena vremena:


Fajlovi

QtHybridWebNativeDevelopment_Whitepaper.pdf (344 KB) QtHybridWebNativeDevelopment_Whitepaper.pdf Whitepaper: Qt Features for Hybrid Development Ernad Husremović, 30.07.2009 15:01
Akcije #2

Izmjenjeno od Ernad Husremović prije skoro 16 godina

http://labs.trolltech.com/blogs/2009/05/13/qt-declarative-ui/

Declarative UI is a way of making fluid user interfaces by describing them in terms of simple elements (Text, Image, Rect,and other QObjects) that are built up into components. The reason it is “declarative” is that rather than the changes in the UI being expressed as imperative code (”set this, set that, do this, do that, …”), they are instead expressed as sets of QObject property expressions (”this width is always half that width”), grouped into states (”when enabled, the properties are …, when disabled, they are …”). The language that enables this is named QML. QML is simple yet powerful. Most of a user interface is described by a simple tree structure of property bindings:

Rect {

    width: 200

    height: 200

    color: "white" 

    Text {

        text: "Hello World" 

        anchors.centeredIn: parent

    }

}

The power is that those property values can be any JavaScript expression - and because it’s a binding rather than just an assignment, the expressions are re-evaluated whenever their dependencies change. This concept has been in Qt forever - if you go back to the old cannon tutorial where a QLCDNumber’s display was connected to a QSlider’s value, that’s a binding: the number displayed changes automatically when the slider value changes.

The fluid part comes from animated transitions between the sets of properties. Combined with Qt’s signals and slots, and a little bit of script for the tricky parts, the result is a very powerful technology for making very cool looking UIs that are enjoyable to use. There is also a set of building blocks useful for creating a fluid UI, including drawing (e.g. Rect, Image), behavior (e.g. MouseRegion, Flickable) and layout (e.g. ListView). These sorts of fluid user interfaces work well for small simple user interfaces such as those on a phone, or gadget-style desktop applications like media players or VoIP clients. We’ve put a couple of demos like this in qt/demos/declarative/ directory of the source.

For larger applications, especially on the desktop, fancy effects are currently mainly at the fringes - the bulk of any large application will use traditional widgets (there’s a lot of value in desktop consistency!), with just a little “fluidness” at the edges to give the apps a modern feel.

On the web side of things, Declarative UI is completely network transparent - if so configured, Qt will happily load a complete declarative user interface incrementally via HTTP - images and all. And since Declarative UI can use Qt’s XQuery support to process other remote data, there are quite a few applications you can write completely in script - no C++ at all.

Qt Declarative integrates perfectly with existing Qt C++ applications. Qt Declarative components can expose an API with signals, slots, and properties. For example, the QML below defines a simple button with an API consisting of a label property and the signal clicked():

Rect {

    id: Container

    property string label

    signal clicked    radius: 5; pen.color: "black" 

    color: Mouse.pressed ? "steelblue" : "lightsteelblue" 

    gradientColor: Mouse.pressed ? "lightsteelblue" : "steelblue";

    MouseRegion { id: Mouse; anchors.fill: parent; onClicked: Container.clicked.emit() }

    Text { anchors.fill: parent; text: Container.label; anchors.centeredIn: parent }

}

We can create this component in C++ and access its API, just like any other Qt QObject subclass:

QmlComponent component(qmlEngine, "Button.qml");

QObject *button = component.create();

button->setProperty("label", tr("Press Me!"));

connect(button, SIGNAL), this, SIGNAL));

Qt’s data models also work immediately with QML. Just expose the C++ model to the QML engine:

MyFancyModel *model = new MyFancyModel();

QmlContext *ctxt = canvas->rootContext();

ctxt->setContextProperty("MyModel", model);

Then reference the model’s name in QML:

Rect {

    width: 800; height: 600; color: "black" 

    ListView {

        anchors.fill: parent

        model: MyModel

        delegate: Text { text: display; color: "white" }

    }

}

Declarative UI is a new way to use the core concepts of Qt, so it fits in with your existing code.

We’ve already started integrating Declarative UI support in Qt Creator. Right now you get QML syntax highlighting and an integrated viewer - check out the Qt Creator blog for details.

And in the KDE playground, there is a demonstration of KDE Plasma integration, so you can run any Declarative UI as a Plasmoid on the desktop!

Akcije #5

Izmjenjeno od Ernad Husremović prije skoro 16 godina

  • Naslov promijenjeno iz qt declarative ui u qt 4.6 declarative ui
Akcije #6

Izmjenjeno od Ernad Husremović prije skoro 16 godina

http://labs.trolltech.com/page/Projects/Compilers/QLALR

QLALR is a LALR parser generator, created by Roberto Raggi, and used internally in various Trolltech projects. The beauty of QLALR - other than the very compact tables and its speed - is the power it gives to the programmer: with QLALR, you write your main parsing function yourself, using QLALR to fill in the necessary parts required to handle your grammar. This makes the tool insanely flexible. Only drawback currently is its underdocumentation. But if you do understand LALR and have used tools like yacc before, you should get along well with the examples.

Akcije #7

Izmjenjeno od Ernad Husremović prije skoro 16 godina

Conclusion

Having looked at CSS3 support in WebKit and the upcoming Qt Declarative UI format, it is clear that while both add support for animations, Qt's QML is better for developing real application user interfaces, where as CSS3's support currently seem to just add animation support to html based content; just as animation triggers on mouse over, clicks etc, and some fixed animations that could be used to replace Flash ads. It is a very valuable addition, though.

QML on the other hand, has really amazed us. It is very well thought out, and the binding and javascript support (each property is a javascript expression) has really amazed us.

We were able to implement a song tracker that would modify the label showing the remaining time, in a few lines of code. The below code shows the code needed to show the remaining time.

Text {
    id: TotalTime
    x: parent.width + 20 // BINDING!
    font.size: 12
    font.bold: true
    color: "white" 
    text: "-" + Math.floor((354 - Knob.x + 13) / 60) + ":" 
              + Math.floor((354 - Knob    .x + 13) % 60) // JAVASCRIPT!
}

QML also has some support for loading it on demand over HTTP, much like Flash, and it seems that it has the potential for becoming a Flash killer with time.

A web browser plugin could easily be developed and Nokia could support it directly on all its S60 phones, when the Qt S60 port is ready. This way, third parties could develop applications that you run remotely and where you always would run the latest release!

Akcije #9

Izmjenjeno od Ernad Husremović prije skoro 16 godina

http://srchiliteqt.sourceforge.net/

Source-highlight-qt is a library for performing syntax highlighting in Qt documents by relying on GNU Source-Highlight library, http://www.gnu.org/software/src-highlite/.

Although the use of GNU Source-highlight library is pretty hidden by this library, so the programmer must not need the details of GNU Source-highlight library, yet, some general notions of GNU Source-highlight might be useful (especially how language definition files are defined, where the configuration files are stored, etc.).

This library provides an implementation of the qt abstract class QSyntaxHighlighter class, and it deals both with Qt3 and Qt4, although you will need to build a separate version of the library for the two different qt frameworks.
Please note, the Qt3 version has less features and it is there only for old qt applications; furthermore, QSyntaxHighlighter class in Qt3 has some design problems which make it quite inefficient to use.

Akcije #11

Izmjenjeno od Ernad Husremović prije skoro 16 godina

  • Naslov promijenjeno iz qt 4.6 declarative ui u qt 4.6 declarative ui, qt-interest, GPL-LGPL qt-mysql
Akcije #13

Izmjenjeno od Ernad Husremović prije skoro 16 godina

qt-kinetic build

bringout@nmraka-5:~/devel/work/qt-kinetic$ sudo apt-get build-dep libqt4-core
bringout@nmraka-5:~/devel/work/qt-kinetic$ ./configure --prefix=/home/bringout/devel/work/qt-kinetic

uild ............... libs tools examples demos docs translations
Configuration .......  release shared dll largefile stl precompile_header separate_debug_info mmx 3dnow sse sse2  minimal-config small-config medium-config large-config full-config qt3support accessibility opengl reduce_exports ipv6 clock-gettime clock-monotonic mremap getaddrinfo ipv6ifname getifaddrs inotify system-jpeg system-mng system-png png system-tiff system-freetype system-zlib nis cups iconv glib dbus openssl x11sm xshape xsync xrender mitshm fontconfig xkb xmlpatterns svg declarative webkit scripttools release
Debug ............... no
Qt 3 compatibility .. yes
QtDBus module ....... yes (run-time)
QtConcurrent code.... yes
QtScriptTools module  yes
QtXmlPatterns module  yes
Phonon module ....... no
SVG module .......... yes
WebKit module ....... yes
Declarative module .. yes <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<,
STL support ......... yes
PCH support ......... yes
MMX/3DNOW/SSE/SSE2..  yes/yes/yes/yes
Graphics System ..... default
IPv6 support ........ yes
IPv6 ifname support . yes
getaddrinfo support . yes
getifaddrs support .. yes
Accessibility ....... yes
NIS support ......... yes
CUPS support ........ yes
Iconv support ....... yes
Glib support ........ yes
GStreamer support ... no ??????????????????????
Large File support .. yes
GIF support ......... plugin
TIFF support ........ plugin (system)
JPEG support ........ plugin (system)
PNG support ......... yes (system)
MNG support ......... plugin (system)
zlib support ........ system
Session management .. yes
OpenGL support ...... yes (Desktop OpenGL)
OpenVG support ...... no
NAS sound support ... no
XShape support ...... yes
XSync support ....... yes
Xinerama support .... runtime
Xcursor support ..... runtime
Xfixes support ...... runtime
Xrandr support ...... runtime
Xrender support ..... yes
Xi support .......... runtime
MIT-SHM support ..... yes
FontConfig support .. yes
XKB Support ......... yes
immodule support .... yes
GTK theme support ... yes
MySQL support ....... plugin
PostgreSQL support .. plugin
ODBC support ........ plugin
SQLite 2 support .... plugin
SQLite support ...... plugin (qt)
OpenSSL support ..... yes (run-time)
Akcije #15

Izmjenjeno od Ernad Husremović prije oko 15 godina

  • Status promijenjeno iz Dodijeljeno u Zatvoreno
Akcije

Također dostupno kao Atom PDF