[Interest] R: Replicate QML Listview in QtCpp and widgets
Simone
cjb.sw.nospam at gmail.com
Tue Nov 12 08:43:45 CET 2013
Hello Alan,
thank you.
The customer don't want QML because for some strange reason he don't want to
use it. I don't know much more, anyway I have to adapt..
And of course we cannot force him to use QML.
I've saw your example but seems that is only for qt5, we are currently using
qt4.8.5
Let's see if I can find something on the web..
However, I am waiting for some good soul who wants to help me :-)
Regards
Simone
-----Messaggio originale-----
Da: Alan Alpert [mailto:416365416c at gmail.com]
Inviato: lunedì 11 novembre 2013 23:01
A: Simone
Cc: interest at qt-project.org
Oggetto: Re: [Interest] Replicate QML Listview in QtCpp and widgets
Depending on what "political reasons" means, you could do stuff like
QQmlComponent c;
c.setData("import MyApp 0.1; import QtQuick 2.2; ListView{model:
MyModel{}; delegate: MyDelegate{}}");
inside your C++ implementation. MyModel being your custom QAbstractItemModel
and MyDelegate being a custom QQuickItem written in
C++ for the delegate. If you're willing to use private APIs (which has
massive drawbacks when you don't bundle a specific Qt build with your
app) you can even skip the component and create a QQuickListView directly.
A QWebView would also be fairly easy, but HTML is even worse than QML for
most of the reasons that people want to ban QML.
If you really can't use QML or QtQuick, you can implement such a widget with
QtWidgets but there's no real help for that. Just do all your own touch
handling and painting and it's still easier than a raw opengl app,
--
Alan Alpert
On Mon, Nov 11, 2013 at 12:27 PM, Simone <cjb.sw.nospam at gmail.com> wrote:
> Hello all,
> For a customer specific application we are forced to use only C++ code
without QML.
> Up to here there are no problems, except that in this new software, we
need massive use of listview (finger-scrollable, with text and image
objects, smooth moving).
> So, the QML Listview is exactly what we are looking for, but for political
questions we can't use QML.
>
> There is an alternative?
> I saw that QlistWidget is not really perfect and simple like the Qml
object..
>
> Does someone have some code or examples (or maybe web articles) to share?
> Many Thanks
> Simone
>
>
>
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
More information about the Interest
mailing list