[Qt-qml] PathView Performance issue

2010-12-09 Thread badrinath.chandi
Hi,

I am trying to display images using path view, I am finding the performance 
issues when I use the pathItemCount, any solutions to Fix this issue?

Thanks & Regards,
Badri
___
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml


Re: [Qt-qml] Loading font from resource file not working on Symbian

2010-12-09 Thread Cornelius Hald
On Wed, 2010-12-08 at 16:33 +0200, Juha Turunen wrote:
> >> You need to tell the Symbian FBS (font and bitmap server) that it
> >> should add your font to the typeface store. You can do that with this
> >> bit of code:
> >>
> >> TInt id;
> >> CEikonEnv::Static()->ScreenDevice()->AddFile(_L(" >> font file>"), id);
> >
> > Looks a bit scary to a Symbian noob like me :) Also I then can't load
> > the font from the resource file anymore. Still, if this part is missing
> > in Qt, it seems to be a reasonable way.
> 
> Don't be afraid the water is warm.. :) Just flag it with Q_OS_SYMBIAN
> and #include  and 

I'll give a try!

> > Thanks a lot for all this information. I'll give it a try as soon as
> > possible. BTW, do you know if there is a bug report about this already?
> > If not I think I should file one.
> 
> I could dig a bit and try to find out where the problem is (I'm sure
> it'll get fixed faster that way) and file a report. I remember trying
> out the FontLoader on Symbian myself a while ago and it didn't work,
> so the problem is probably something else than just embedding the font
> into a Qt resource file (I can imagine getting that working might be
> hairy).

I would appreciate that very much. From reading the bug Adriano posted,
it sounds like quite a deep problem. Still I think it would be good to
have a QML bug and, if appropriate, make it depend on the mentioned Qt
bug.

Thanks :)
Conny


___
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml


[Qt-qml] how to expose nested ListModel from C++ to QML?

2010-12-09 Thread Wei, Xiaohai
I need to use nested ListView in QML. In each item of the outer ListView,
named by A, it will contain another ListView B.

I can easily expose the DataModel for A from C++, but how can I expose the
list of DataModel for each B?

I have a C++ class derived from QAbstractListModel, and expose an instance
mySuperListModelA to QML for the ListView A by setContextProperty.

In the instance of this class, I have a list of another QAbstractListModel
subclass instance, but how can I expose them to QML for use by B?

I used an INVOKABLE method in class A which will return a
QAbstractListModel, and use it as the model of the inner ListView, but it
doesn't work.

Thanks

James


import Qt 4.7

Item {
  id: container

  Rectangle {
id: menu
width: 400
height: 600
color: "black"
opacity: 0.75
radius: 0
clip: true

  Component {
  id: outerDelegate
  Column{

Text {
   text: "Site Title : " + title
}

 Component {
   id: innerDelegate
   Column {
   Text {text: "   Tab Title: " + tabtitle }
   }
 }

Repeater {
model: mySuperListModelA.subListModelAt(index)   // return sub
QAbstractListModel via INVOKABLE method of mySuperListModelA
delegate: innerDelegate
}
 } // Column
   } // Component


  ListView {
 id: outerlistview
 anchors.fill: parent
 delegate: outerDelegate
 model: mySuperListModelA
 opacity: 1
  } // ListView
  } // Rectangle
}
___
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml


Re: [Qt-qml] how to expose nested ListModel from C++ to QML?

2010-12-09 Thread Chris
>
>
> I used an INVOKABLE method in class A which will return a
> QAbstractListModel, and use it as the model of the inner ListView, but it
> doesn't work.
>
> Actually, this works for me.
I believe you need to cast the returned model to a QObject* to make it work.
For example:

Q_INVOKABLE QObject* commentsForActivity(const QString &id) const;

Kr,
Chris.
___
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml


Re: [Qt-qml] how to expose nested ListModel from C++ to QML?

2010-12-09 Thread Chris
Hi,

Well, I'm not involved in QML development (just a user), so somebody else
can probably answer this.

My guess is that this data type is not supported by QML yet:
see http://doc.qt.nokia.com/4.7-snapshot/qtbinding.html#supported-data-types

Kr,
Chris.

On Thu, Dec 9, 2010 at 12:21 PM, Wei, Xiaohai  wrote:

> yeah, it works.
>
> Thanks a lot.
>
> why it doesn't work if I return QAbstractListModel* ?
>
> Thanks
>
> James
>
> On Thu, Dec 9, 2010 at 6:16 PM, Chris  wrote:
>
>>
>>> I used an INVOKABLE method in class A which will return a
>>> QAbstractListModel, and use it as the model of the inner ListView, but it
>>> doesn't work.
>>>
>>> Actually, this works for me.
>> I believe you need to cast the returned model to a QObject* to make it
>> work. For example:
>>
>> Q_INVOKABLE QObject* commentsForActivity(const QString &id) const;
>>
>> Kr,
>> Chris.
>>
>
>
___
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml


Re: [Qt-qml] How to ignore MouseArea signals

2010-12-09 Thread jerome.pasion
Hello,

Is there a reason why accepted isn't handled in the other mouse events? 

Cheers,
Jerome P.

From: qt-qml-boun...@trolltech.com [qt-qml-boun...@trolltech.com] On Behalf Of 
ext Halton Huo [halton@intel.com]
Sent: Wednesday, December 08, 2010 4:40 AM
To: Jones Martin (Nokia-MS-Qt/Brisbane)
Cc: qt-qml@trolltech.com
Subject: Re: [Qt-qml] How to ignore MouseArea signals

Thanks, http://bugreports.qt.nokia.com/browse/QTBUG-15929 is filed.

On Wed, 2010-12-08 at 10:41 +0800, martin.jo...@nokia.com wrote:
> Log a bug.  It would be good if you could suggest where the docs are lacking 
> - i.e. where you started looking when this didn't work as expected.  The 
> "accepted" behavior is documented in the MouseArea signal documentation.
>
> BR,
> Martin.
>
> > -Original Message-
> > From: ext Halton Huo [mailto:halton@intel.com]
> > Sent: Wednesday, 8 December 2010 11:56 AM
> > To: Jones Martin (Nokia-MS-Qt/Brisbane)
> > Cc: adriano.reze...@openbossa.org; qt-qml@trolltech.com
> > Subject: RE: [Qt-qml] How to ignore MouseArea signals
> >
> > Woo, OnPressed works, thanks very much.
> >
> > The document need to be improved. Any process to do that?
> >
> > Cheers,
> > Halton.
> > On Wed, 2010-12-08 at 09:46 +0800, martin.jo...@nokia.com wrote:
> > > You need to accept in onPressed.  accepted is ignored for any other event.
> > >
> > > BR,
> > > Martin.
> > >
> > >
> > > > -Original Message-
> > > > From: qt-qml-boun...@trolltech.com [mailto:qt-qml-boun...@trolltech.com]
> > On
> > > > Behalf Of ext Halton Huo
> > > > Sent: Wednesday, 8 December 2010 11:42 AM
> > > > To: Adriano Rezende
> > > > Cc: qt-qml@trolltech.com
> > > > Subject: Re: [Qt-qml] How to ignore MouseArea signals
> > > >
> > > > "enabled" does not match my case.
> > > >
> > > > I need receive the MouseArea signals but as well as those below the top
> > > > item can receive the signals also.
> > > >
> > > > Refer to MouseEvent element document, seems accepted can do that.
> > > > -
> > > > accepted : bool
> > > >
> > > > Setting accepted to true prevents the mouse event from being propagated
> > > > to items below this item.
> > > >
> > > > Generally, if the item acts on the mouse event then it should be
> > > > accepted so that items lower in the stacking order do not also respond
> > > > to the same event.
> > > >
> > > >
> > > > But following code does not work as I wish
> > > > MouseArea {
> > > > anchors.fill: parent
> > > > onClicked: {
> > > > console.log("mouse.accepted="+mouse.accepted)
> > > > mouse.accepted = false
> > > > console.log("mouse.accepted="+mouse.accepted)
> > > > }
> > > > }
> > > >
> > > > Thanks,
> > > > Halton.
> > > >
> > > > On Wed, 2010-12-08 at 02:55 +0800, Adriano Rezende wrote:
> > > > > On Tue, Dec 7, 2010 at 4:31 AM, Halton Huo  
> > > > > wrote:
> > > > > > So my questions how to ignore the received signals to let other 
> > > > > > items to
> > > > > > continue deal with those signals?
> > > > >
> > > > > You can set enabled property to false or ignore the event on mouse 
> > > > > press.
> > > > >
> > > > > MouseArea {
> > > > > anchors.fill: parent
> > > > > onClicked: console.log("background clicked");
> > > > > }
> > > > >
> > > > > MouseArea {
> > > > > anchors.fill: parent
> > > > > enabled: false
> > > > > //onPressed: mouse.accepted = false;
> > > > > onClicked: console.log("foreground clicked");
> > > > > }
> > > > >
> > > > > Br,
> > > > > Adriano
> > > >
> > > >
> > > > ___
> > > > Qt-qml mailing list
> > > > Qt-qml@trolltech.com
> > > > http://lists.trolltech.com/mailman/listinfo/qt-qml
> >
>


___
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml

___
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml


Re: [Qt-qml] How to ignore MouseArea signals

2010-12-09 Thread Adriano Rezende
On Thu, Dec 9, 2010 at 10:36 AM,   wrote:
> Hello,
>
> Is there a reason why accepted isn't handled in the other mouse events?

I believe the reason is that after accepting mouse press event that
item becomes the mouse grabber and mouse move/released events will be
delivered directly to it. The grabber condition can be removed calling
ungrabMouse() manually.

Br,
Adriano
___
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml


[Qt-qml] About possibilities of sharing common parts between the applications

2010-12-09 Thread iiro.kause
Hi,

We have been analyzing what is going on with the QML application launches on 
Symbian side. One thing we have been thinking about was, that perhaps it would 
be beneficial to share some things between applications. Now, for example,  in 
every application start we're registering all the internal Qml elements one by 
one. Could this kind of common structures be shared on some global shareable 
memory chunk, which could then be shared between applications?

This kind of sharing would probably help on both Symbian and Meego -platforms 
(perhaps a bit overkill on desktop though).

Has there been any discussion related to this?

-br, Iiro Kause
___
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml


Re: [Qt-qml] PathView Delegates Not Always Displaying

2010-12-09 Thread Michael Dippold
Sorry, I guess I had to upgrade my glib libraries to build the latest.
 I have now built the latest and it seems to fix part of my issue but
I am still having some trouble.

With the following example, line 19:
carousel.currentIndex = 0;

Does not appear to cause the path to redraw the delegates.

Steps:
1) After loading click "<<" once
("7" should now be in the center box.)
2) Click "Home" which should reload the model which will trigger the
currentIndex to be set at 0.

You should see that nothing happens when Home is clicked.  The
currentItem is currently set to 0 but the path is currently displaying
a different state.   If you click "<<" again nothing will happen (now
the path is in the state it should be in).  Click "<<" again and the
path will start to move.

At line 17 if I set highlightMoveDuration to 10 (maybe anything other
than 0) the problem is not visible.

Thanks,
Mike


On 12/7/10, martin.jo...@nokia.com  wrote:
> This is not reproducible using the current Qt 4.7 branch.  The 4.7 branch
> from http://qt.gitorious.org/qt should always build and run.
>
> BR,
> Martin.
>
>> -Original Message-
>> From: ext Michael Dippold [mailto:m...@dippold.com]
>> Sent: Wednesday, 8 December 2010 2:55 AM
>> To: Jones Martin (Nokia-MS-Qt/Brisbane)
>> Cc: qt-qml@trolltech.com
>> Subject: Re: [Qt-qml] PathView Delegates Not Always Displaying
>>
>> I am using Qt 4.7.1, I just tried compiling from the latest from Git
>> but could not get it to run.  I was able to create a simple example on
>> how to duplicate it and created a bug (QTBUG-15926).  Hopefully it is
>> reproducible on other systems.
>>
>> Thanks,
>> Mike
>>
>>
>> On Mon, Dec 6, 2010 at 10:20 PM,   wrote:
>> > Which version of Qt are you using?  There have been some fixes in
>> > PathView
>> which your bug may be related to.  I suggest trying the latest qt/4.7 from
>> git. If you
>> still see the problem then file a bug with an example that can be used to
>> reproduce it (an unreliable example is better than none).
>> >
>> > BR,
>> > Martin.
>> >
>> >> -Original Message-
>> >> From: qt-qml-boun...@trolltech.com
>> >> [mailto:qt-qml-boun...@trolltech.com]
>> On
>> >> Behalf Of ext Michael Dippold
>> >> Sent: Tuesday, 7 December 2010 10:52 AM
>> >> To: qt-qml@trolltech.com
>> >> Subject: [Qt-qml] PathView Delegates Not Always Displaying
>> >>
>> >> I currently have a PathView that is binded to a XmlListModel.  I
>> >> animate the entire path and move it off of the screen, change the
>> >> query of the XmlListModel to get new data, and then animate the entire
>> >> path back onto the screen once the XmlListModel status is set to
>> >> READY.
>> >>
>> >> I am having a problem where randomly the PathView will come back into
>> >> the main window with missing delegates.  If I use the mouse to barely
>> >> move the PathView the delegates immediately get displayed.
>> >>
>> >> I have not yet found a way to reliably reproduce the issue.
>> >> ___
>> >> Qt-qml mailing list
>> >> Qt-qml@trolltech.com
>> >> http://lists.trolltech.com/mailman/listinfo/qt-qml
>> >
>


main.qml
Description: Binary data




1


2


3


4


5


6


7



___
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml


Re: [Qt-qml] How to ignore MouseArea signals

2010-12-09 Thread martin.jones
This behavior is inherited from QGraphicsView.  I don't know why it is this 
way.  Perhaps the QGraphicsView documentation has some hints.

BR,
Martin.

> -Original Message-
> From: ext Adriano Rezende [mailto:adriano.reze...@openbossa.org]
> Sent: Friday, 10 December 2010 12:02 AM
> To: Pasion Jerome (Nokia-MS-Qt/Oslo)
> Cc: halton@intel.com; Jones Martin (Nokia-MS-Qt/Brisbane); qt-
> q...@trolltech.com
> Subject: Re: [Qt-qml] How to ignore MouseArea signals
> 
> On Thu, Dec 9, 2010 at 10:36 AM,   wrote:
> > Hello,
> >
> > Is there a reason why accepted isn't handled in the other mouse events?
> 
> I believe the reason is that after accepting mouse press event that
> item becomes the mouse grabber and mouse move/released events will be
> delivered directly to it. The grabber condition can be removed calling
> ungrabMouse() manually.
> 
> Br,
> Adriano

___
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml


Re: [Qt-qml] PathView Delegates Not Always Displaying

2010-12-09 Thread martin.jones
This one I can reproduce.  I've reopened the bug. 
http://bugreports.qt.nokia.com/browse/QTBUG-15926

Thanks,
Martin.


> -Original Message-
> From: ext Michael Dippold [mailto:m...@dippold.com]
> Sent: Friday, 10 December 2010 2:30 AM
> To: Jones Martin (Nokia-MS-Qt/Brisbane)
> Cc: qt-qml@trolltech.com
> Subject: Re: [Qt-qml] PathView Delegates Not Always Displaying
> 
> Sorry, I guess I had to upgrade my glib libraries to build the latest.
>  I have now built the latest and it seems to fix part of my issue but I am 
> still having
> some trouble.
> 
> With the following example, line 19:
> carousel.currentIndex = 0;
> 
> Does not appear to cause the path to redraw the delegates.
> 
> Steps:
> 1) After loading click "<<" once
> ("7" should now be in the center box.)
> 2) Click "Home" which should reload the model which will trigger the 
> currentIndex
> to be set at 0.
> 
> You should see that nothing happens when Home is clicked.  The currentItem is
> currently set to 0 but the path is currently displaying
> a different state.   If you click "<<" again nothing will happen (now
> the path is in the state it should be in).  Click "<<" again and the path 
> will start to
> move.
> 
> At line 17 if I set highlightMoveDuration to 10 (maybe anything other than 0) 
> the
> problem is not visible.
> 
> Thanks,
> Mike
> 
> 
> On 12/7/10, martin.jo...@nokia.com  wrote:
> > This is not reproducible using the current Qt 4.7 branch.  The 4.7
> > branch from http://qt.gitorious.org/qt should always build and run.
> >
> > BR,
> > Martin.
> >
> >> -Original Message-
> >> From: ext Michael Dippold [mailto:m...@dippold.com]
> >> Sent: Wednesday, 8 December 2010 2:55 AM
> >> To: Jones Martin (Nokia-MS-Qt/Brisbane)
> >> Cc: qt-qml@trolltech.com
> >> Subject: Re: [Qt-qml] PathView Delegates Not Always Displaying
> >>
> >> I am using Qt 4.7.1, I just tried compiling from the latest from Git
> >> but could not get it to run.  I was able to create a simple example
> >> on how to duplicate it and created a bug (QTBUG-15926).  Hopefully it
> >> is reproducible on other systems.
> >>
> >> Thanks,
> >> Mike
> >>
> >>
> >> On Mon, Dec 6, 2010 at 10:20 PM,   wrote:
> >> > Which version of Qt are you using?  There have been some fixes in
> >> > PathView
> >> which your bug may be related to.  I suggest trying the latest qt/4.7
> >> from git. If you still see the problem then file a bug with an
> >> example that can be used to reproduce it (an unreliable example is
> >> better than none).
> >> >
> >> > BR,
> >> > Martin.
> >> >
> >> >> -Original Message-
> >> >> From: qt-qml-boun...@trolltech.com
> >> >> [mailto:qt-qml-boun...@trolltech.com]
> >> On
> >> >> Behalf Of ext Michael Dippold
> >> >> Sent: Tuesday, 7 December 2010 10:52 AM
> >> >> To: qt-qml@trolltech.com
> >> >> Subject: [Qt-qml] PathView Delegates Not Always Displaying
> >> >>
> >> >> I currently have a PathView that is binded to a XmlListModel.  I
> >> >> animate the entire path and move it off of the screen, change the
> >> >> query of the XmlListModel to get new data, and then animate the
> >> >> entire path back onto the screen once the XmlListModel status is
> >> >> set to READY.
> >> >>
> >> >> I am having a problem where randomly the PathView will come back
> >> >> into the main window with missing delegates.  If I use the mouse
> >> >> to barely move the PathView the delegates immediately get displayed.
> >> >>
> >> >> I have not yet found a way to reliably reproduce the issue.
> >> >> ___
> >> >> Qt-qml mailing list
> >> >> Qt-qml@trolltech.com
> >> >> http://lists.trolltech.com/mailman/listinfo/qt-qml
> >> >
> >

___
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml


Re: [Qt-qml] Participating in QML open source projects

2010-12-09 Thread michael.brasser
On 24/11/2010, at 7:11 AM, ext Viacheslav Dukalskiy wrote:
> I would like to participate in some kind of open source QML project, to 
> bring something  useful to the community and learn QML in the same time :).
> The main problem I don't know what to start with, what QML community is 
> and what open source projects are ongoing.
> So, do you know any projects to start contributing in there?

Welcome! From what I understand several KDE projects are starting to use (or at 
least experiment with) QML more extensively (I know of at least plasma and 
Akonadi), so there might be some projects there that interested you.

Regards,
Michael


___
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml


Re: [Qt-qml] C++ MyClass to detect child added/removed from QML

2010-12-09 Thread michael.brasser
On 25/11/2010, at 7:25 AM, ext Charley Bay wrote:
> This does raise the next question (or two):
> 
> (1) The QML implies an "instantiation tree" of items in a parent-child 
> relationship.  That's great, and part of what makes QML so easy to use.  Is 
> this tree "special" in any way?  For example, if I dynamically create items, 
> or explicitly re-parent-items, are they treated differently in any way from 
> the ones "hard-coded" in the QML?  (I've observed strange behavior attempting 
> to re-parent a nested item that was hard-coded to a peer of the parent, 
> effectively removing it from its hard-coded parent.)

One difference is that the items created by the instantiation tree cannot be 
destroyed from QML (you cannot call destroy() on them the way you can for 
dynamically created items). I can't think of any differences in reparenting 
though -- do you remember what the strange behavior was that you observed?

> Fun stuff!  It works, and I'm happy.  However, I'd feel better if one of the 
> Trolls would comment that I'm doing "acceptable as-designed" practice, or if 
> I should think about doing this differently (e.g., how to implement a C++ 
> layout container operating on items dynamically added/removed from QML).


I'm not certain, but it's probably more of an optimization than anything else 
that ItemChildAddedChange is not triggered for items in the instantiation tree. 
If you haven't done so already, I'd suggest looking at the implementation of 
the QML "positioners" (Row, Column, Grid, etc) --  they layout all items (not 
just those added dynamically), but might give you some additional ideas for 
your layout container.

Regards,
Michael
___
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml


Re: [Qt-qml] Performance cost of using Loader's sourceComponent

2010-12-09 Thread michael.brasser
On 03/12/2010, at 4:00 AM, ext Adriano Rezende wrote:
> On Fri, Oct 22, 2010 at 2:12 AM,   wrote:
>> On 21/10/2010, at 4:44 AM, ext mathias.malmqv...@nokia.com wrote:
>>> Quick question; is there a cost involved in instantiating elements using the
>>> Loader's sourceComponent property? I.e. does it prevent the source
>>> component's code from being cached when it's compiled the first time?
>> 
>> It shouldn't be preventing the component from caching the compiled qml.
> 
> Is there a plan to save the compiled data to disk in order to improve
> future loads? For example, caching Screen.qml into Screen.qmlc.

It's certainly something we've discussed -- I imagine we'll likely do a trial 
implementation at some point, see what we learn, and go from there.

Regards,
Michael
___
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml


Re: [Qt-qml] how to expose nested ListModel from C++ to QML?

2010-12-09 Thread Wei, Xiaohai
Thanks.

another question on nested listview.

How can inner delegate get the index of current outer model index?

Thanks

James

On Thu, Dec 9, 2010 at 7:11 PM, Chris  wrote:

> Hi,
>
> Well, I'm not involved in QML development (just a user), so somebody else
> can probably answer this.
>
> My guess is that this data type is not supported by QML yet:
> see
> http://doc.qt.nokia.com/4.7-snapshot/qtbinding.html#supported-data-types
>
> Kr,
> Chris.
>
>
> On Thu, Dec 9, 2010 at 12:21 PM, Wei, Xiaohai  wrote:
>
>> yeah, it works.
>>
>> Thanks a lot.
>>
>> why it doesn't work if I return QAbstractListModel* ?
>>
>> Thanks
>>
>> James
>>
>> On Thu, Dec 9, 2010 at 6:16 PM, Chris  wrote:
>>
>>>
 I used an INVOKABLE method in class A which will return a
 QAbstractListModel, and use it as the model of the inner ListView, but it
 doesn't work.

 Actually, this works for me.
>>> I believe you need to cast the returned model to a QObject* to make it
>>> work. For example:
>>>
>>> Q_INVOKABLE QObject* commentsForActivity(const QString &id) const;
>>>
>>> Kr,
>>> Chris.
>>>
>>
>>
>
___
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml


Re: [Qt-qml] PathView Performance issue

2010-12-09 Thread michael.brasser
Hi,

I would guess that the problem comes from instantiating new items as the path 
is flicked. If that is the case, the only real solution at this point is to 
simplify your delegate (see 
http://doc.qt.nokia.com/4.7-snapshot/qdeclarativeperformance.html#view-delegates).
 If the data model is relatively small, you also might be able to work around 
the issue by not using pathItemCount, and cleverly constructing your path (e.g. 
so the 'visible' path still only shows pathItemCount number of items, but they 
are still all instantiated).

Regards,
Michael

On 09/12/2010, at 6:18 PM, ext 
badrinath.cha...@nokia.com wrote:

Hi,

I am trying to display images using path view, I am finding the performance 
issues when I use the pathItemCount, any solutions to Fix this issue?

Thanks & Regards,
Badri


___
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml


Re: [Qt-qml] aliasing property of a delegate in a listview

2010-12-09 Thread michael.brasser
Hi,

The ListView's delegate is really just a template for the list items that will 
be shown in the view (as Girish pointed out in an earlier thread, delegate: 
aCustomDelegate {} is really just shorthand for delegate: Component { 
aCustomDelegate {} }), which is why you cannot create an alias to it (it will 
be instantiated many times). Are you looking for access to the data of the 
currently selected item in the view (i.e. the ListView's currentItem)? You 
could try something like the following if you don't need true aliasing:

 ListView {
id: listview
property string text: listview.currentItem ? listview.currentItem.text : ""
delegate: Text {
id: myDelegate
text: sometext
}
}

Regards,
Michael

On 06/12/2010, at 10:13 AM, ext Bartosh Wroblevksy wrote:

I would like to export the properties of the delegate of a listview to make it 
more reusable. In other words, I would like to do something like this


ListView {

id: listview

property alias text: myDelegate.text


delegate: aCustomDelegate {

id:myDelegate

text: sometext

}

}


Is it possible?


Thanks,
Bartosh




___
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml


Re: [Qt-qml] how to expose nested ListModel from C++ to QML?

2010-12-09 Thread bea.lam
Hi James,

On 10/12/2010, at 2:20 PM, ext Wei, Xiaohai wrote:

> Thanks. 
> 
> another question on nested listview. 
> 
> How can inner delegate get the index of current outer model index?
> 

One way to do it is to add a property to each delegate of the outer view, which 
holds the 'index' value of that the delegate. The index can then be accessed by 
the inner view. E.g.

Component {
id: outerDelegate

Repeater {
id: outerDelegate
property int outerIndex: index

model: ...
delegate: Text { text: outerDelegate.outerIndex }

}
}

regards,

Bea
___
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml


Re: [Qt-qml] QML memory usage with "import QtWebKit"

2010-12-09 Thread michael.brasser
Hi Greg,

>From what I remember 10MB for the "base" usage of webkit sounds about right, 
>though I didn't realize that just an import statement would add this cost. Did 
>you try any other configurations? e.g. did adding an empty WebView cause the 
>memory to go up or was it still around 13MB?

Regards,
Michael

On 30/11/2010, at 6:48 PM, ext Gregory Schlomoff wrote:

> Hello,
> 
> One simple observation. Launching the following code in qmlviewer.exe,
> I get a memory usage of aroung 3 megabytes:
> ---
> import QtQuick 1.0
> 
> Rectangle {
>   width: 200
>   height: 200
> }
> 
> 
> Now, with the following code, memory usage jumps to 13 megabytes. I'm
> not instantiating any WebView element, just importing QtWebkit.
> ---
> import QtQuick 1.0
> import QtWebKit 1.0
> 
> Rectangle {
>   width: 200
>   height: 200
> }
> 
> 
> Is that normal? Would someone care to explain what the import
> statement is doing that is adding 10 mb of memory consumption?
> 
> Thanks
> 
> Greg
> ___
> Qt-qml mailing list
> Qt-qml@trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-qml


___
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml


Re: [Qt-qml] how to expose nested ListModel from C++ to QML?

2010-12-09 Thread bea.lam
And ignore the duplicate 'outerDelegate' id below - that should only be in the 
Repeater, not the Component.

On 10/12/2010, at 3:09 PM, ext bea@nokia.com wrote:

> Hi James,
> 
> On 10/12/2010, at 2:20 PM, ext Wei, Xiaohai wrote:
> 
>> Thanks. 
>> 
>> another question on nested listview. 
>> 
>> How can inner delegate get the index of current outer model index?
>> 
> 
> One way to do it is to add a property to each delegate of the outer view, 
> which holds the 'index' value of that the delegate. The index can then be 
> accessed by the inner view. E.g.
> 
> Component {
>id: outerDelegate
> 
>Repeater {
>id: outerDelegate
>property int outerIndex: index
> 
>model: ...
>delegate: Text { text: outerDelegate.outerIndex }
> 
>}
> }
> 
> regards,
> 
> Bea
> ___
> Qt-qml mailing list
> Qt-qml@trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-qml

--
Bea Lam
Software Engineer
Nokia, Qt Development Frameworks


___
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml


Re: [Qt-qml] QML memory usage with "import QtWebKit"

2010-12-09 Thread Gregory Schlomoff
Hi Michael,

Somme additional figures:

1. Empty Rectangle, not importing QtWebkit: ~ 3MB
2. Empty Rectangle, importing QtWebkit: ~ 13MB
3. Rectangle with an empty WebView: ~ 14 MB
4. Setting url: "about:blank" in the WebView: ~15 MB
5. Setting url: "http://www.google.com/": ~19 MB (and a repaint bug: webview
displays a checkered background, and I have to resize the window a little
bit to make it actually paint the page.)

All tests on windows 7 64-bits, running qmlviewer.exe built from the 4.7.0
branch on Oct, 6.

Thanks,

Greg

On Fri, Dec 10, 2010 at 12:12 PM,  wrote:

> Hi Greg,
>
> From what I remember 10MB for the "base" usage of webkit sounds about
> right, though I didn't realize that just an import statement would add this
> cost. Did you try any other configurations? e.g. did adding an empty WebView
> cause the memory to go up or was it still around 13MB?
>
> Regards,
> Michael
>
> On 30/11/2010, at 6:48 PM, ext Gregory Schlomoff wrote:
>
> > Hello,
> >
> > One simple observation. Launching the following code in qmlviewer.exe,
> > I get a memory usage of aroung 3 megabytes:
> > ---
> > import QtQuick 1.0
> >
> > Rectangle {
> >   width: 200
> >   height: 200
> > }
> > 
> >
> > Now, with the following code, memory usage jumps to 13 megabytes. I'm
> > not instantiating any WebView element, just importing QtWebkit.
> > ---
> > import QtQuick 1.0
> > import QtWebKit 1.0
> >
> > Rectangle {
> >   width: 200
> >   height: 200
> > }
> > 
> >
> > Is that normal? Would someone care to explain what the import
> > statement is doing that is adding 10 mb of memory consumption?
> >
> > Thanks
> >
> > Greg
> > ___
> > Qt-qml mailing list
> > Qt-qml@trolltech.com
> > http://lists.trolltech.com/mailman/listinfo/qt-qml
>
>
___
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml