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

2010-12-13 Thread Gregory Schlomoff
n Tue, Dec 14, 2010 at 12:52 PM, wrote: > Hi Greg, > > On 10/12/2010, at 4:52 PM, ext Gregory Schlomoff wrote: > > Hi Michael, > > Somme additional figures: > > 1. Empty Rectangle, not importing QtWebkit: ~ 3MB > 2. Empty Rectangle, importing QtWebkit: ~ 13MB > 3. R

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

2010-12-09 Thread Gregory Schlomoff
ory 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 megabyt

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

2010-11-30 Thread Gregory Schlomoff
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 1

Re: [Qt-qml] Static analysis for QML

2010-11-24 Thread Gregory Schlomoff
> In fact, for types defined in a QML plugin, Creator will often already be able > to offer code completion and error reporting. What the static analysis can't > do > yet is get the types right when you embed QML in a C++ application and expose > some random objects (say using setContextProperty).

[Qt-qml] Static analysis for QML

2010-11-24 Thread Gregory Schlomoff
Hello, One of the main problems that I have with QML, and that actually is directly linked to what makes it awesome, is the fact that you won't have any compile-time error when you change property names / slots / etc... in C++. So I was wondering, would it be possible, from a technical point of v

Re: [Qt-qml] Mouse wheel events in QML

2010-11-21 Thread Gregory Schlomoff
You have to make your own component in C++ to catch them. On Sun, Nov 21, 2010 at 1:29 AM, Girish Ramakrishnan wrote: > See http://bugreports.qt.nokia.com/browse/QTBUG-7369. In short, > Flickable supports it but not MouseArea. > > Girish > > On Sat, Nov 20, 2010 at 9:17 PM, Jerzy Chalupski > w

Re: [Qt-qml] QML Component Snapshot / Cover-Flow (PathView) implementation suggestions

2010-11-17 Thread Gregory Schlomoff
> There's no built-in QML-based way to take snapshots -- you'd need a custom > C++ component to do something like this (it does seem to be a frequent > request; has anyone else made a component for this already?). Yes, we did that in our custom drag&drop component. Here's the relevant snippet fro

Re: [Qt-qml] Executable code in a model?

2010-11-16 Thread Gregory Schlomoff
. Short answer: you have to try out for yourself, but you will certainly come up with a solution. 2010/11/16 Pertti Kellomäki : > On 11/16/2010 03:00 PM, ext Gregory Schlomoff wrote: >> >> Easy, just bind your javascript code to a signal or a property. >> >> QML

Re: [Qt-qml] Executable code in a model?

2010-11-16 Thread Gregory Schlomoff
Easy, just bind your javascript code to a signal or a property. QML version of your pseudo-code : Menu { MenuItem { title: "save" onActivated: { var file = file.save(); } } 2010/11/16 Pertti Kellomäki : > Is it possible to have executable code as part of a mod

Re: [Qt-qml] How to handle binary data in qml

2010-11-13 Thread Gregory Schlomoff
I don't know how your API work, but you'll probably need to encode the binary data into a format more suitable for transfer, like Base 64, or something. So my advice would be to expose the binary data as a string (encoded as needed). On Sat, Nov 13, 2010 at 4:00 PM, vuleetu wrote: > Hi, >   I am

Re: [Qt-qml] How to change mouseGrabber in Qml?

2010-10-27 Thread Gregory Schlomoff
Drag and drop is still something that is not really implemented in QML. >From our experience, the best way to achieve it is to create a custom QML component in C++ that will in turn call the standard Qt API to handle drag&drop with QGraphicItem You can see an example implementation that we did he

Re: [Qt-qml] Getting a list of strings from plugin

2010-09-30 Thread Gregory Schlomoff
you probably want to use QDeclarativeListProperty cheers greg On Thu, Sep 30, 2010 at 5:01 PM, Toni Leppänen wrote: > I'm trying to return a list of strings from a plugin. I'm getting an > error when trying to access the list: > foo.qml:13: TypeError: Result of expression 'list' [undefined] is n

Re: [Qt-qml] Semantics of 'return' in a JavaScript block in QML

2010-09-29 Thread Gregory Schlomoff
Hi Steve, Yes, those are indeed anonymous functions, also called lambda expressions (http://en.wikipedia.org/wiki/Anonymous_function) They are quite easy to read once you know the syntax: 1. function() is the part that tells javascript you're creating an anonymous function. You can also define p

Re: [Qt-qml] Sleeping in javascript

2010-09-27 Thread Gregory Schlomoff
> I know javascript doesn't have a sleep() per se, but I've tried using > the setTimeout() function, which I thought was standard, Technically setTimeout is a member of the window object (you should write window.setTimeout, but the window object is implicit) That's why setTimeout doesn't work in

Re: [Qt-qml] Getting the size of a QList in QML

2010-09-20 Thread Gregory Schlomoff
I've replied previously that .length works very well for me. Did you try it again? This is the correct property to get the size of the list. On Mon, Sep 20, 2010 at 8:27 PM, Cornelius Hald wrote: > On Fri, 2010-09-17 at 14:59 +0200, Cornelius Hald wrote: >> I'm exposing an object with a QList pro

Re: [Qt-qml] Semantics of 'return' in a JavaScript block in QML

2010-09-17 Thread Gregory Schlomoff
> > > Besides, IIRC, qml has a non-standard syntax for switch blocks, requiring > each > > case to be enclosed within curly braces for the break statement to work. > Why > > this happens (if it still happens - haven't tested now) would be > interesting > > to know. > > I would also be interested in

Re: [Qt-qml] Getting the size of a QList in QML

2010-09-17 Thread Gregory Schlomoff
Hi, I'm using length, no problems at all. On Fri, Sep 17, 2010 at 7:59 PM, Cornelius Hald wrote: > Hi, > > I'm exposing an object with a QList property to QML. How can > I read out the size of that list in QML? I tried .size, .length > and .count. Non of them seem to work. > > Am I missing som

Re: [Qt-qml] textInput.text not updated instantly

2010-09-17 Thread Gregory Schlomoff
Hi, Maybe you should use onTextChanged, instead? Cheers, Greg On Fri, Sep 17, 2010 at 5:11 PM, rijubrata bhaumik wrote: > Hi, > > i am using a TextInput element and printing the character thats was > pressed > when i press a character, the TextInput.text is updated only in the next > iteration

Re: [Qt-qml] Semantics of 'return' in a JavaScript block in QML

2010-09-15 Thread Gregory Schlomoff
I'd be definetely in understanding qml "from the grounds up" Things such as prototype, and how the specifities of qml are implemented (like the example you gave above), are of huge interest. Besides, IIRC, qml has a non-standard syntax for switch blocks, requiring each case to be enclosed within

Re: [Qt-qml] Global mouse coordinates

2010-09-15 Thread Gregory Schlomoff
Ok. I'm don't know if that's possible in pure QML, but if it's really not possible, you should be able to do it with a custom QML element. For example, you could make your own TitleBar class in C++, and use it like this: import TitleBar 1.0 Item { TitleBar { width: parent.width height

Re: [Qt-qml] Global mouse coordinates

2010-09-15 Thread Gregory Schlomoff
Maybe using drag.target ? On Wed, Sep 15, 2010 at 11:02 PM, Surik Sayadyan wrote: > Item::mapToItem(null,mouseX,mouseY) return the same coordinates as in > mouseX and mouseY. > Does anyone know how moving the widget on the screen by mouse? > ___ > Qt-q

Re: [Qt-qml] Semantics of 'return' in a JavaScript block in QML

2010-09-15 Thread Gregory Schlomoff
> > where the last evaluated statement is used as return value. This is > specially useful for one-liners like the one below. > Text { text: condition ? "A" : "B" } While we are on this topic, you may want to check out this article. http://javascriptweblog.wordpress.com/2010/07/26/no-m

Re: [Qt-qml] Reordering children

2010-09-11 Thread Gregory Schlomoff
It depends of what you mean by order. Usually, the order of the children just determine their stacking position (ie: the second child will stack over the first, the third will be over the second, etc...). In this case, you can change the stacking order with the z property. In your case, the order

Re: [Qt-qml] import QtQuick 1.0

2010-09-09 Thread Gregory Schlomoff
I feel this is an excellent move. I was getting concerned by the fact that once Qt 4.7 will be officially out, we were going to have to wait a lot until new features were added to QML. Greg On Fri, Sep 10, 2010 at 11:48 AM, wrote: > Hi, > > Currently all the core QML elements are in the “Qt”

Re: [Qt-qml] partial MouseArea

2010-08-23 Thread Gregory Schlomoff
I would add that from our experience, it should be quite trivial to make your own C++ component that support complex shapes. On Tue, Aug 24, 2010 at 8:39 AM, wrote: > On 23/08/2010, at 10:36 AM, ext Bartosh Wroblevksy wrote: > > I would like to set a partial MouseArea determine by real coordin

Re: [Qt-qml] What´s the correct QML type for arrays ?

2010-08-19 Thread Gregory Schlomoff
Thanks for sharing. I was wondering for a long time how to use the qml list type. The documentation gives absolutely no clue that you must use the bracket syntax, like in C++. I never thought that it was possible to do that in javascript. On Thu, Aug 19, 2010 at 8:31 PM, Cornelius Hald wrote: >

Re: [Qt-qml] Section header 'always on top'

2010-08-13 Thread Gregory Schlomoff
Hehehe, that's so funny. We made a component that does the exact same thing, except that we would keep all section headers visible on screen, stacked either on top or bottom of the ListView, so that you could click on a section header to jump to this section. But that's definetely a proof that thi

Re: [Qt-qml] Replacing a C++ listview with QML listview

2010-08-13 Thread Gregory Schlomoff
-boun...@trolltech.com [mailto:qt-qml-boun...@trolltech.com] > *On Behalf Of *ext Gregory Schlomoff > *Sent:* 13 August 2010 07:56 > *To:* Westbrook Alan (Nokia-MS/MtView) > *Cc:* qt-qml@trolltech.com > *Subject:* Re: [Qt-qml] Replacing a C++ listview with QML listview > > > &

Re: [Qt-qml] Replacing a C++ listview with QML listview

2010-08-12 Thread Gregory Schlomoff
n, as the rest of the QML > API seems to use 'target' for components that affect other components, > perhaps you should change the 'attachTo' to 'target' > > So .. Who's going to make a web 2.0 site for sharing QML bits? > > =) > > Alan >

Re: [Qt-qml] Replacing a C++ listview with QML listview

2010-08-12 Thread Gregory Schlomoff
IT license. It may have bugs, and it probabably can be enhanced (adding support for horizontal scrolling, for example). If you make any changes that make this code better, please feel free to submit patches / merge requests. Cheers, Greg On Thu, Aug 12, 2010 at 8:40 PM, Gregory Schlomoff < gr

Re: [Qt-qml] Replacing a C++ listview with QML listview

2010-08-12 Thread Gregory Schlomoff
We are using QML ListViews in our desktop app. It works well... Now that a lot of bugs have been fixed, and that we really understand how ListView works :) As for the scrollbar, we made a quick Scrollbar component that works very well. The code looks like this: ListView { id: myList ... } Scrol

[Qt-qml] Why the need for QDeclarativeListProperty?

2010-08-10 Thread Gregory Schlomoff
Hello, As we dive more and more into the QML world, we started making C++ code that needed to define QDeclarativeListProperties. At first, QDLP can be quite intimidating: you don't really know what to make of those static functions, then you feel relieved when you see that there is a constructor

Re: [Qt-qml] enumerations in QML

2010-08-04 Thread Gregory Schlomoff
Thanks Bea, that's exactly what I needed! Yes, should be nice to see that in the reference documentation geg On Thu, Aug 5, 2010 at 12:03 PM, wrote: > > On 05/08/2010, at 2:45 PM, ext Gregory Schlomoff wrote: > >> Isn't there a way to expose an enum to QML with q

Re: [Qt-qml] enumerations in QML

2010-08-04 Thread Gregory Schlomoff
== app.qml === MyScrollbar { orientation: scrollbar.vertical } On Thu, Aug 5, 2010 at 11:45 AM, Gregory Schlomoff wrote: > Isn't there a way to expose an enum to QML with qRegisterType or something? > > How do you guys expose enumerations to QML? > > While I understand that Javascript i

Re: [Qt-qml] enumerations in QML

2010-08-04 Thread Gregory Schlomoff
Isn't there a way to expose an enum to QML with qRegisterType or something? How do you guys expose enumerations to QML? While I understand that Javascript is weakly typed and hasn't such concept as constants, when you are developing generic components, it's very scary to do stuff like that: MySc

Re: [Qt-qml] enumerations in QML

2010-08-04 Thread Gregory Schlomoff
+1, same question here On Thu, Aug 5, 2010 at 7:36 AM, Alex wrote: > [ Sorry, I'll stop flooding the mailing list in a minute :-)  ] > > Is there any way to declare enumerations in QML?  For example, assume I > have a custom element called "MyText" that has a property called > sizeType, for whic

Re: [Qt-qml] Why FocusChange is never emitted?

2010-08-04 Thread Gregory Schlomoff
gt; > Cheers, > > Aaron > > On 04/08/2010, at 9:52 PM, ext Gregory Schlomoff > wrote: > >> Hello everyone, >> >> We are using the latest version of Qt 4.7 from the repository, and the >> focus works very well, in a very intuitive way, much better than

[Qt-qml] Why FocusChange is never emitted?

2010-08-04 Thread Gregory Schlomoff
Hello everyone, We are using the latest version of Qt 4.7 from the repository, and the focus works very well, in a very intuitive way, much better than with the old "wantsFocus". Except for one thing: onFocusChanged never gets called. Sure, we could use onActiveFocusChanged instead, and indeed,

Re: [Qt-qml] QDeclarativeItem subclasses and mouse events

2010-08-04 Thread Gregory Schlomoff
This gets me thinking: it would be really nice if there were more information on what exactly QML is doing behind the scene. What impacts performance, and what doesn't. What costs the most, in QML? Bindings? Javascript evaluation? Memory allocation for items? And why? Yes, I'm aware that some of t

Re: [Qt-qml] QDeclarativeItem subclasses and mouse events

2010-08-02 Thread Gregory Schlomoff
Hello ! You may want to have a look at our code for drag and drop, it's working well: http://bitbucket.org/gregschlom/qml-drag-drop (and more specifically http://bitbucket.org/gregschlom/qml-drag-drop/src/tip/DeclarativeDragArea.cpp ) On Tue, Aug 3, 2010 at 3:13 AM, Jan Ekholm wrote: > On Mond

Re: [Qt-qml] Key event capturing

2010-07-29 Thread Gregory Schlomoff
>> Also while trying to debug I attempted to set a break point.  Are >> break points possible in QML? There is some early support for breakpoints and debugging javascript in QML with the latest version of Qt Creator, but it's still experimental, and it works only for pure qml apps (you can't debug

Re: [Qt-qml] Repeater inside delegate ?

2010-07-28 Thread Gregory Schlomoff
I guess you may do that by nesting a new ListModel inside each ListElement, but that's not really practical On Wed, Jul 28, 2010 at 5:34 PM, Stephen Collyer wrote: > Given a model like so: > >     ListModel >     { >     id: people_model > >     ListElement >     { >     n

Re: [Qt-qml] Loading external QML files

2010-07-27 Thread Gregory Schlomoff
You're looking for the Loader element :) Have a look at the doc: http://doc.trolltech.com/main-snapshot/qdeclarativeelements.html On Tue, Jul 27, 2010 at 5:53 PM, Ben Marinic wrote: > Hi > > I'm new to QML - having used Flex for many years. Is there a way for a QML > file to load another QML fi

Re: [Qt-qml] Where do the bug fixes go?

2010-07-23 Thread Gregory Schlomoff
Nevermind, I just found it : http://qt.gitorious.org/+qt-developers/qt/staging/commits/qml/4.7 greg On Fri, Jul 23, 2010 at 6:25 PM, Gregory Schlomoff < gregory.schlom...@gmail.com> wrote: > Can someone be kind enough to provide us with a link? > > I can't see any qt-qml

Re: [Qt-qml] Where do the bug fixes go?

2010-07-23 Thread Gregory Schlomoff
Can someone be kind enough to provide us with a link? I can't see any qt-qml branch under http://qt.gitorious.org/+qt-developers/qt/staging/ Or maybe it is still too early, and the branch will appear later? Thanks! greg On Fri, Jul 23, 2010 a

[Qt-qml] GridView with variable row height?

2010-07-23 Thread Gregory Schlomoff
Hi guys, As far as I can see, GridView only supports cells that all have the same height and width. But what if you need to display data in a table, pretty much like an HTML table, that requires row of variable height to adapt to the content height? So far, we can see several options : 1. Use a

Re: [Qt-qml] Component element: what is it for ?

2010-07-22 Thread Gregory Schlomoff
To add my thoughts here : Conceptually, I think that Component are exactly like external QML files. I think of components as a way to put in the same file the code that you would otherwise have written in a separate file. > Though I do not understand the difference between Loader.onLoaded() and >

Re: [Qt-qml] Is there a way to randomize the display of items in views

2010-07-22 Thread Gregory Schlomoff
There is a Math.random() function under javascript. One solution would be to use it with ListModel.move() to shuffle the ListModel after it has been created. Another solution would be to have the data come from a C++ model, like a QList, and to the shuffling from C++. On Thu, Jul 22, 2010 at 4:2

[Qt-qml] Firebug equivalent tool for QML ?

2010-07-19 Thread Gregory Schlomoff
Hi guys, I remember how my DOM / Javascript / CSS skills dramatically improved when I discovered the existence of Firebug in Firefox. I was wondering if there would be any chance to see a similar tool for QML. Basically, something that would enable you to right-click anywere in qmlviewer.exe, and

[Qt-qml] QML vs Photoshop point unit

2010-07-18 Thread Gregory Schlomoff
Hi guys, I just noticed that there is a difference between point sizes in Photoshop and QML by a factor of 1.32. For example, if I set a text to a pointSize of 50 in QML, I must set the text to 50 * 1.32 = 66 points in Photoshop to get the same size. While there is nothing wrong with that, I was

Re: [Qt-qml] Fw: Why can't I stylesheet a font?

2010-07-13 Thread Gregory Schlomoff
Can we please stop trolling on this ? It's pretty evident by now that everyone has his position and won't move a single inch. My inbox thanks you :) Greg On Wed, Jul 14, 2010 at 9:39 AM, wrote: > On 14/07/2010, at 10:42 AM, ext Jason H wrote: >> But the ability to define and apply arbitrary

[Qt-qml] Is it possible to subclass a QDeclarative class ?

2010-07-13 Thread Gregory Schlomoff
Hi guys, Anyone knows if it's possible to subclass a QDeclarative class? The headers are private, and we get a lot of linker errors if we try to include them. Why we want to do that: we are working on a qml implementation of drag & drop. Our first approach consisted of two custom items, DragArea

Re: [Qt-qml] QML Application Wrapper anyone?

2010-07-13 Thread Gregory Schlomoff
Someone asked this question a few weeks ago in this mailing list, and some troll answered that there were plans to include this exact functionality as a wizard in QtCreator. I don't remember if he/she specified if it was going to be in the next official release of QtCretator, though. (v2.1) On Tu

Re: [Qt-qml] Why can't I stylesheet a font?

2010-07-12 Thread Gregory Schlomoff
o: qt-qml@trolltech.com > Sent: Tue, July 13, 2010 12:30:37 AM > Subject: Re: [Qt-qml] Why can't I stylesheet a font? > > On Tue, 13 Jul 2010 10:48:46 ext Gregory Schlomoff wrote: >> I second that. Would be very useful to be able to create a predefined >> group of proper

Re: [Qt-qml] QML: DataModel

2010-07-12 Thread Gregory Schlomoff
You should probably create some slots on C++ that interact with your QAbstractItemModel, then call those slots from QML. The rule is that QML can only call slots or Q_INVOKABLE, and not normal methods. On Tue, Jul 13, 2010 at 4:40 AM, Almo Nito wrote: > Hello There, > > > > > > I played around w

Re: [Qt-qml] Why can't I stylesheet a font?

2010-07-12 Thread Gregory Schlomoff
I second that. Would be very useful to be able to create a predefined group of properties, and then assign the group as a whole to any object. Something like this: PropertyGroup { id:bigText font.face = "Arial" font.pointSize: 30 color: "red" } Text { text:"Hello" properties: [bigTex

[Qt-qml] Announcing unofficial drag and drop support to QML

2010-07-11 Thread Gregory Schlomoff
Hello everyone, We are very pleased to announce that we quickly baked some drag and drop support to qml last week, and we are making the code available as open-source for everyone. The code quality isn't close to what the trolls do, documentation is still a stub, and there are some things missing

Re: [Qt-qml] "QML supports network transparency by using URLs"

2010-07-11 Thread Gregory Schlomoff
Hello everybody, Just a small comment: last week, we built our first QML component in C++, and it was way more easier than we would have thought. All of a sudden, we discovered that extending QML from C++ either by subclassing existing items or by creating new ones from scratch was *really* easy,

[Qt-qml] Drag and drop status in QML?

2010-07-06 Thread Gregory Schlomoff
Hi guys, What is the status of drag and drop support in QML? Basically, I would like to be able, for any Item, to declare it as a drop target (maybe by setting a property like acceptDrops to true), and then, have slots like onDragEnter and onDrop that I could use to make my Item react to drag and

[Qt-qml] How-to re-order Items inside a ListView with drag and drop ?

2010-07-05 Thread Gregory Schlomoff
Hi guys, I'm trying to create a ListView where items can be re-ordered with drag and drop. Basically, the QML equivalent of this javascript / css demo : http://www.wil-linssen.com/demo/jquery-sortable-ajax/ What are your thoughts on this? 1. Is it feasible in pure QML? It seems that ListView doe

[Qt-qml] Public place to share QML components?

2010-06-29 Thread Gregory Schlomoff
Hi guys, As the philosophy of QML is to provide only the building blocks and to let the developers create their own components, I often find myself writing a lot of reusable components. Stuff to add scrollbars to Flickable, or to make TextInputs appear like regular Text elements that become editab

[Qt-qml] TextInput I-beam mouse cursor?

2010-06-04 Thread Gregory Schlomoff
Hi guys, Does anyone know if there are plans to make TextInput elements show a standard I-beam cursor, instead of the regular mouse pointer? This is very important as currently the user has no way to know which text elements are editable without trying to click them. Actually, I think this is rel

Re: [Qt-qml] Send qml signals to cpp

2010-05-31 Thread Gregory Schlomoff
Hello, I'm looking for the same thing. You may want to have a look at this example app, it might be of some help : http://zchydem.enume.net/2010/04/08/my-first-qt-quick-app-quickflickr/ (I haven't tried myself yet to send signals from my QML frontend, but I will need to do so in a while)

Re: [Qt-qml] Anchoring of elements in Row or Column

2010-05-18 Thread Gregory Schlomoff
Try something along the lines of secondElement.x = firstElement.x + firstElement.width Using left and right as you suggested would definitely look more elegant, but it doesn't work, don't ask me why. On May 18, 2010 8:32 AM, wrote: forgot to mention i am using "Repeater" in Row ., -rakesh -