maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   [WIP] Hildon Qt Components (https://talk.maemo.org/showthread.php?t=85955)

freemangordon 2012-08-11 07:37

Re: [WIP] Hildon Qt Components
 
Quote:

Originally Posted by marxian (Post 1249997)
I don't believe it will require Qt 4.7.4, unless I use QSystemInfo for the battery indicator etc. Presumably there are lower-level methods to get battery info and such that would enable me to avoid using the high-level QtMobility APIs.

EDIT: Also, I don't suppose you know the answer to my question of how to determine which theme is currently being used? I need to be able to tell my QDeclarativeImageProvider where to load the images from (and also load transistions.ini if the theme overrides the default one).

Well, there is a little "hack" in CSSU Qt, which allows applications to use GTK syles, without taking care what is the current theme, you may want to look at it:

http://gitorious.org/community-ssu/q...f9c83f6668f4f9

this is an example of how it is used:
http://gitorious.org/community-ssu/o...ton.cpp#line46

That way Qt uses whatever sapwood has decided to be current, theme changes are applied on-the-fly, you don't need to care where the current theme images are stored and what their names are, etc. And of course memory usage is reduced, as Qt does not load its owns set of images, but uses shared pixmaps (the same ones GTK uses)

NFC if the above helps you, I am not much into QML, but for native QPushButton that works with no problems (check how osso-calculator in CSSU behaves when theme is changed). So you may want to create your own set of native GTK widgets (in the same way Qt does) and trick somehow GTK to give you the pixmaps so you can GL draw them (I suspect QML uses QGLWidget/QGraphicsWidget/QGraphicsScene).

Though I may had written nonsense as well :D


EDIT:
Why do you need to know the current transitions.ini?

marxian 2012-08-11 14:15

Re: [WIP] Hildon Qt Components
 
Quote:

Originally Posted by freemangordon (Post 1250323)
Well, there is a little "hack" in CSSU Qt, which allows applications to use GTK syles, without taking care what is the current theme, you may want to look at it:

http://gitorious.org/community-ssu/q...f9c83f6668f4f9

this is an example of how it is used:
http://gitorious.org/community-ssu/o...ton.cpp#line46

That way Qt uses whatever sapwood has decided to be current, theme changes are applied on-the-fly, you don't need to care where the current theme images are stored and what their names are, etc. And of course memory usage is reduced, as Qt does not load its owns set of images, but uses shared pixmaps (the same ones GTK uses)

NFC if the above helps you, I am not much into QML, but for native QPushButton that works with no problems (check how osso-calculator in CSSU behaves when theme is changed). So you may want to create your own set of native GTK widgets (in the same way Qt does) and trick somehow GTK to give you the pixmaps so you can GL draw them (I suspect QML uses QGLWidget/QGraphicsWidget/QGraphicsScene).

Though I may had written nonsense as well :D


EDIT:
Why do you need to know the current transitions.ini?

I already have my QDeclarativeImageProvider set up, but I'll at least consider the method you propose. For now, the fact that /etc/hildon/theme points to the directory of the current theme is enough.

As I understand it, some themes supply their own transitions.ini. I want to load this (if applicable) to provide correct values for pop-in/out durations etc. The idea is that these components will behave just as any GTK/QtGui application would.

I have all the above working now, but for some reason I have an undefined symbol error when trying to import the plugin. AFAICT, my approach to exporting the plugin library is exactly the as that used by the MeeGo/Symbian components plugin.

qwazix 2013-01-15 22:31

Re: [WIP] Hildon Qt Components
 
Is this already in extras-devel or otherwise available for use?

marxian 2013-01-15 23:10

Re: [WIP] Hildon Qt Components
 
Quote:

Originally Posted by qwazix (Post 1315288)
Is this already in extras-devel or otherwise available for use?

Not yet. Most of the components are fully working, but there is a performance issue with popup components (menus, dialogs etc). Should be easy to fix, but I haven't had time to resume work on this yet.

I'm considering re-writing the components using C++, and basing them on C++ QDeclarativeItem instead of the QML Item element. This should allow me to use the GTK pixmaps, as per freemangordon's suggestion. It will also have other benefits. QML is great for quickly building a UI with existing components, but writing complex components using QML and JS is messy (just look at some of the Nokia Qt Components).

qwazix 2013-01-16 07:34

Re: [WIP] Hildon Qt Components
 
If it's not too much to ask, can I have them even in the current state? I'd like to start doing an UI for the fremantle port of ipcLite. Whenever you update, if API breaks, I'll be happy to update my code.

marxian 2013-01-16 13:22

Re: [WIP] Hildon Qt Components
 
1 Attachment(s)
Quote:

Originally Posted by qwazix (Post 1315358)
If it's not too much to ask, can I have them even in the current state? I'd like to start doing an UI for the fremantle port of ipcLite. Whenever you update, if API breaks, I'll be happy to update my code.

I've attached a tarball containing the source. I don't expect the existing API to change. There will be additions (currently there is no edit bar, tree view etc), but the names, properties and signals of the current set of components should remain the same.

qwazix 2013-01-19 14:32

Re: [WIP] Hildon Qt Components
 
Marxian, thanks for the source, I managed to build it, but QDeclarativeFolderListModel is missing. I copied the one from qt examples but it lacks some methods such as setRoot()

For now I can work as I commented out the calls to those methods but please share this file as well.

Thanks again.

(Now I have to set up my thimb toolchain :) )

marxian 2013-01-19 16:33

Re: [WIP] Hildon Qt Components
 
1 Attachment(s)
Quote:

Originally Posted by qwazix (Post 1315888)
Marxian, thanks for the source, I managed to build it, but QDeclarativeFolderListModel is missing. I copied the one from qt examples but it lacks some methods such as setRoot()

For now I can work as I commented out the calls to those methods but please share this file as well.

Thanks again.

(Now I have to set up my thimb toolchain :) )

The files have been deleted. :( I have recreated QDeclarativeFolderListModel and made some changes. Replace filesystemmodel.* with the new files.

Are you able to import org.hildon.components successfully after installation? I was getting an undefined symbol error in the plugin, and wasn't able to figure out the cause.

qwazix 2013-01-19 18:26

Re: [WIP] Hildon Qt Components
 
No, I get that undefined symbol error too but I thought it should be the fact that I compiled with different qt (madde, 4.6.3) than that on the device (4.7.4).

However, as with the repos down it's impossible for now to set up a working thumb scratchbox target, I compiled it with desktop Qt for the simulator, and installed them in the simulator. However I'm getting the same error when importing. This new finding, and the fact that this happens to you too probably invalidates the above assumption.

I'll try to find what causes that undefined symbol.

freemangordon 2013-01-19 18:37

Re: [WIP] Hildon Qt Components
 
Quote:

Originally Posted by qwazix (Post 1315947)
No, I get that undefined symbol error too but I thought it should be the fact that I compiled with different qt (madde, 4.6.3) than that on the device (4.7.4).

However, as with the repos down it's impossible for now to set up a working thumb scratchbox target, I compiled it with desktop Qt for the simulator, and installed them in the simulator. However I'm getting the same error when importing. This new finding, and the fact that this happens to you too probably invalidates the above assumption.

I'll try to find what causes that undefined symbol.

what symbol is undefined?


All times are GMT. The time now is 14:25.

vBulletin® Version 3.8.8