[Kde-games-devel] Review Request 109365: Support for QtQuick in libkdegames
Viranch Mehta
viranch.mehta at gmail.com
Mon Mar 18 07:00:48 UTC 2013
> On March 17, 2013, 10:50 p.m., Albert Astals Cid wrote:
> > kgthemeprovider.h, line 43
> > <http://git.reviewboard.kde.org/r/109365/diff/4/?file=120201#file120201line43>
> >
> > Do we need this properties/signals? Do you see them being used from QML?
yes, this is used in KgItem. it has source: "image://"+provider.name+"/"...
this is useful if we want to have multiple KgThemeProviders, developers can register these KgThemeProvider objects with a name to QML engine (see registerProvider(QString name, KgThemeProvider* prov) method in KgDeclarativeView). registerProvider will add a KgImageProvider with same name, and KgItem will use this name to reference the image provider it wants to ask for pixmaps.
> On March 17, 2013, 10:50 p.m., Albert Astals Cid wrote:
> > kgthemeprovider.h, line 89
> > <http://git.reviewboard.kde.org/r/109365/diff/4/?file=120201#file120201line89>
> >
> > Since this seems to be used only from C++ can't we just do what this function does in the caller? Doesn't really seem to add much value
this is also used in KgItem, we have the currentThemeName as part of Image (KgItem)'s source url to trigger pixmap request on theme changes.
- Viranch
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/109365/#review29411
-----------------------------------------------------------
On March 17, 2013, 6:28 a.m., Viranch Mehta wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/109365/
> -----------------------------------------------------------
>
> (Updated March 17, 2013, 6:28 a.m.)
>
>
> Review request for KDE Games.
>
>
> Description
> -------
>
> This is a copy of review request #7017 in SVN review board because I needed to update the patch (it won't accept git diffs). Updated description:
>
> This patch contains support for QtQuick in libkdegames for future porting QML. Post this patch, libkdeclarative becomes a dependency for libkdegames.
>
> We have some new classes:
>
> 1. KgImageProvider:
> This is a QDeclarativeImageProvider, and a sort-of replacement for KGameRenderer for QML ports. This class is supplied with a KgThemeProvider which it uses to discover SVG locations, reads them using QSvgRenderer and returns the requested sprite pixmap. QDeclarativeImageProvider has inbuilt ability of caching and asynchronous loading of pixmaps, which is why can replace usages of KGameRenderer in QML ports.
>
> 2. KgDeclarativeView:
> This is a QDeclarativeView with KDE-specific import paths for QML components configured and javascript functions bindings added (like i18n() methods) using the KDeclarative library. Game's KgThemeProviders are supplied to this class which in turn registers them with the underlying QML engine, and adds KgImageProviders corresponding to each KgThemeProvider.
>
> 3. KgItem QML component:
> This is simple QML Image element wrapper for showing sprites on QML views using the KgImageProviders. We specify which one of the KgImageProviders we want to use and which sprite key we want to show, and it will be painted on the view.
>
> The patch may not stay up-to-date, relevant code is in "viranch/qtquick" branch in libkdegames's git repo.
>
>
> Diffs
> -----
>
> CMakeLists.txt 67b8b40
> declarativeimports/CMakeLists.txt PRE-CREATION
> declarativeimports/corebindingsplugin.h PRE-CREATION
> declarativeimports/corebindingsplugin.cpp PRE-CREATION
> declarativeimports/qml/KgItem.qml PRE-CREATION
> declarativeimports/qml/qmldir PRE-CREATION
> includes/CMakeLists.txt 8756a50
> includes/KgDeclarativeView PRE-CREATION
> kgdeclarativeview.h PRE-CREATION
> kgdeclarativeview.cpp PRE-CREATION
> kgimageprovider.h PRE-CREATION
> kgimageprovider.cpp PRE-CREATION
> kgthemeprovider.h 6ca9b63
> kgthemeprovider.cpp e186106
>
> Diff: http://git.reviewboard.kde.org/r/109365/diff/
>
>
> Testing
> -------
>
> I'm using KBreakout to test all of this. The relevant port can be found in "qtquick/imageprovider" branch in KBreakout's git repo.
>
>
> Thanks,
>
> Viranch Mehta
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-games-devel/attachments/20130318/009ec03a/attachment-0001.html>
More information about the kde-games-devel
mailing list