<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>eduardofleury.com &#187; Primary</title>
	<atom:link href="http://blog.eduardofleury.com/archives/category/primary/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.eduardofleury.com</link>
	<description>Thoughts, shuffled...</description>
	<lastBuildDate>Sat, 01 May 2010 00:22:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Mapping mouse position to angles (QtQuick example)</title>
		<link>http://blog.eduardofleury.com/archives/2010/04/108/</link>
		<comments>http://blog.eduardofleury.com/archives/2010/04/108/#comments</comments>
		<pubDate>Fri, 30 Apr 2010 20:53:02 +0000</pubDate>
		<dc:creator>fleury</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Primary]]></category>
		<category><![CDATA[Qt]]></category>
		<category><![CDATA[Qt Labs Americas (en)]]></category>
		<category><![CDATA[angle]]></category>
		<category><![CDATA[brasil]]></category>
		<category><![CDATA[brazil]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[components]]></category>
		<category><![CDATA[conversion]]></category>
		<category><![CDATA[coordinates]]></category>
		<category><![CDATA[diagram]]></category>
		<category><![CDATA[eduado]]></category>
		<category><![CDATA[eduardo fleury]]></category>
		<category><![CDATA[fleury]]></category>
		<category><![CDATA[gui]]></category>
		<category><![CDATA[helper]]></category>
		<category><![CDATA[indt]]></category>
		<category><![CDATA[interface]]></category>
		<category><![CDATA[model]]></category>
		<category><![CDATA[mouse]]></category>
		<category><![CDATA[openbossa]]></category>
		<category><![CDATA[qml]]></category>
		<category><![CDATA[qtquick]]></category>
		<category><![CDATA[recife]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://blog.eduardofleury.com/?p=108</guid>
		<description><![CDATA[Hi there! This post is to share with you something I hacked these days. The use case Image you are writing a widget or a piece of an application interface and you want to rotate something based on a mouse click. For instance, you may have a widget that looks like a rotating knob, or [...]]]></description>
			<content:encoded><![CDATA[<p>Hi there! This post is to share with you something I hacked these days.</p>
<h3><strong>The use case</strong></h3>
<p>Image you are writing a widget or a piece of an application interface and you want to rotate something based on a mouse click. For instance, you may have a widget that looks like a rotating knob, or a round analogue gauge.</p>
<p>For this post, let&#8217;s use a car dashboard speedometer. What I want here is to click somewhere on the gauge and have the needle rotated towards the current mouse position. Check this video of how it should work.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/Qi6HOu7wWj4&amp;hl=en_US&amp;fs=1&amp;color1=0x234900&amp;color2=0x4e9e00" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/Qi6HOu7wWj4&amp;hl=en_US&amp;fs=1&amp;color1=0x234900&amp;color2=0x4e9e00" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<h3>The problem</h3>
<p>In Qt, rotating a widget is easy in the context of QtQuick or QGraphicsView, just define the &#8220;rotation&#8221; property to the desired angle and you are all set. The problem here is to find out <span style="text-decoration: underline;"><strong>what the desired angle is.</strong></span></p>
<p>Here I want to find out which is the angle formed between a given mouse position and centre of the gauge, or the origin of the needle rotation. Getting the mouse position is easy in QtQuick, simply watch the &#8220;mouseX&#8221; and &#8220;mouseY&#8221; properties of a MouseArea. But what about converting that to an &#8220;angle&#8221; ?</p>
<p>In mathematical terms what I want is to convert the mouse position from linear coordinates (X,Y pair) to circular coordinates (angle, radius pair) with the centre of the gauge being the origin of my plane. But designers using QtQuick really don&#8217;t want to deal with that.</p>
<h3>The solution</h3>
<p>I made a Qt class meant to be used as a &#8220;model&#8221; or &#8220;helper&#8221; for both C++ and QtQuick applications. This class hides the trigonometry required for that conversion by exporting a set of properties, namely:</p>
<ul>
<li>originX</li>
<li>originY</li>
<li>x</li>
<li>y</li>
<li>angle</li>
<li>radius</li>
</ul>
<p>So how would we use it in our example?</p>
<ol>
<li>Set &#8220;<strong>originX</strong>&#8221; and &#8220;<strong>originY</strong>&#8221; to the centre of the gauge. That&#8217;s the origin of the needle, right?</li>
<li>Set &#8220;<strong>x</strong>&#8221; and &#8220;<strong>y</strong>&#8221; to the current mouse position. In QML that would be &#8220;x: mouseArea.mouseX&#8221; and &#8220;y: mouseArea.mouseY&#8221;.</li>
<li>Read the value of &#8220;<strong>angle</strong>&#8220;. In QML that would be something like  &#8220;needleRotation.angle: angleModel.angle&#8221;</li>
</ol>
<p>Then QtQuick data binding system will handle everything else. Every time the mouse moves, the properties &#8220;<strong>x</strong>&#8221; and &#8220;<strong>y</strong>&#8221; will be updated, the model will then recalculate the values of &#8220;<strong>angle</strong>&#8221; and &#8220;<strong>radius</strong>&#8221; causing the needle to update itself.</p>
<p>Below you can see a diagram of that behaviour. Note that the opposite also works, that is, once I explicitly set an &#8220;<strong>angle</strong>&#8221; and &#8220;<strong>radius</strong>&#8221; in the model, the values of &#8220;<strong>x</strong>&#8221; and &#8220;<strong>y</strong>&#8221; are automatically updated.</p>
<div id="attachment_111" class="wp-caption alignnone" style="width: 910px"><img class="size-full wp-image-111" title="AngleModel" src="http://blog.eduardofleury.com/wp-content/uploads/2010/04/AngleModel.png" alt="Relationship between AngleModel and different coordinates" width="900" height="506" /><p class="wp-caption-text">Relationship between AngleModel and different coordinates</p></div>
<h3>The Source</h3>
<p>To grab the code go to<strong> <a title="Qt Components Gitorious" href="http://gitorious.org/qt-components/qt-components/commits/master" target="_blank">Qt Components Gitorious</a> </strong>and check:</p>
<ul>
<li>examples/clickable-dial</li>
<li>examples/angle-model</li>
</ul>
<p>Hope you enjoy it. Comments are always welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eduardofleury.com/archives/2010/04/108/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arbitrary and/or animated opacity masks to QGraphicsItems with QGraphicsEffect</title>
		<link>http://blog.eduardofleury.com/archives/2010/04/102/</link>
		<comments>http://blog.eduardofleury.com/archives/2010/04/102/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 14:09:47 +0000</pubDate>
		<dc:creator>fleury</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Primary]]></category>
		<category><![CDATA[Qt]]></category>

		<guid isPermaLink="false">http://blog.eduardofleury.com/?p=102</guid>
		<description><![CDATA[Last week I dropped by this neat image slider and was wondering how could that be done in Qt (C++ or Quick). And basically what we need is an animated opacity mask, or &#8220;clipper&#8221;. While QGraphicsView and QML already provide rectangular clipping, it does not support clipping to arbitrary forms and opacity, something we would [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I dropped by this <a href="http://nivo.dev7studios.com/">neat image slider</a> and was wondering how could that be done in Qt (C++ or Quick). And basically what we need is an animated opacity mask, or &#8220;clipper&#8221;.</p>
<p>While QGraphicsView and QML already provide rectangular clipping, it does not support clipping to arbitrary forms and opacity, something we would need in order to implement the &#8220;moving bars&#8221; transition used in the image slider I mentioned above.</p>
<p>I expected QGraphicsEffect to be suitable for that usecase but I had no experience with it, so I decided to try and make a proof of concept effect class that would clip an arbitrary QGraphicsItem to the shape of a bouncing circle.</p>
<p>A more useful class would be one that received as parameter a mask image instead of the &#8220;hard-coded&#8221; bouncing circle, but I&#8217;ll let that as an exercise to those reading <img src='http://blog.eduardofleury.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Code is attached, I complied against Qt 4.6 and it works fine. Just run:</p>
<p><span style="font-family: Courier;"># qmake<br />
# make<br />
# ./effect</span></p>
<p>l class would be one that received as parameter a mask image instead of the &#8220;hard-coded&#8221; bouncing circle, but I&#8217;ll let that as an exercise to those read.</p>
<p><strong><a href="http://blog.eduardofleury.com/wp-content/uploads/effect.tgz">Download and try it here</a></strong>.</p>
<p><strong>UPDATE</strong>:  If your default graphics system is not raster, ie. if you get errors like:</p>
<p>QPainter::setCompositionMode: Blend modes not supported on device</p>
<p>Try running the example as follows:<br />
<span style="font-family: Courier;"># ./effect -graphicssystem raster</span></p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 69px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">QPainter::setCompositionMode: Blend modes not supported on device</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.eduardofleury.com/archives/2010/04/102/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Foi lançado o Qt 4.6 !</title>
		<link>http://blog.eduardofleury.com/archives/2009/12/98/</link>
		<comments>http://blog.eduardofleury.com/archives/2009/12/98/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 16:15:34 +0000</pubDate>
		<dc:creator>fleury</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Maemo]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Português]]></category>
		<category><![CDATA[Primary]]></category>
		<category><![CDATA[Qt]]></category>
		<category><![CDATA[Qt Labs Americas (pt)]]></category>
		<category><![CDATA[anchorlayout]]></category>
		<category><![CDATA[brasil]]></category>
		<category><![CDATA[brazil]]></category>
		<category><![CDATA[fleury]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[indt]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[Nokia]]></category>
		<category><![CDATA[openbossa]]></category>
		<category><![CDATA[oslo]]></category>
		<category><![CDATA[Qt 4.6]]></category>
		<category><![CDATA[recife]]></category>
		<category><![CDATA[release]]></category>
		<category><![CDATA[symbian]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://blog.eduardofleury.com/?p=98</guid>
		<description><![CDATA[Está disponível desde hoje cedo a versão 4.6.0 do Qt com diversas novidades, como diz o post oficial dos nossos amigos do Qt. A nova versão está disponível para download em qt.nokia.com, em versões pré compiladas para Windows, MacOS e Symbian, além do código fonte (para todas as plataformas). Usuários Linux podem baixar e compilar [...]]]></description>
			<content:encoded><![CDATA[<p>Está disponível desde hoje cedo a versão 4.6.0 do Qt com diversas novidades, como diz o <a href="http://labs.trolltech.com/blogs/2009/12/01/qt-460-released-early-due-to-good-behaviour/" target="_blank">post oficial</a> dos nossos amigos do Qt.</p>
<p>A nova versão está disponível para download em <a title="Qt" href="http://qt.nokia.com/" target="_blank">qt.nokia.com</a>, em versões pré compiladas para Windows, MacOS e Symbian, além do código fonte (para todas as plataformas). Usuários Linux podem baixar e compilar o fonte ou então instalar usando os procedimentos normais de cada distribuição, tão logo estejam disponíveis os pacotes desta versão.</p>
<p>Entre as novidades dessa versão estão:</p>
<ul>
<li>API de Animação (QAnimation)</li>
<li>Máquina de Estados (QStateMachine)</li>
<li>Novo layout (QGraphicsAnchorLayout)</li>
<li>Suporte para a plataforma Symbian, o que permite que o Qt rode em dezenas de milhões de novos aparelhos <img src='http://blog.eduardofleury.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </li>
</ul>
<p>A documentação atualizada com todas as novas classes está pronta também, ou pelo Qt Assistant ou <a title="Qt Docs" href="http://qt.nokia.com/doc/4.6/index.html" target="_blank">online</a>.</p>
<p>Outro fato marcante desta versão é o fato de ser a primeira após a abertura do repositório Git do Qt, e assim marca uma integração cada vez maior com a comunidade. Nesse sentido esperamos que todos usem, testem e mandem opiniões e reports de eventuais bugs, para que as próximas versões sejam cada vez melhores!</p>
<p>Para ilustrar um pouco, <a title="Qt 4.6.0 video" href="http://www.youtube.com/watch?v=PCx8RfNhhXk" target="_blank">um vídeo</a> feito pelo pessoal aqui do openBossa mostrando o 4.6.0 rodando em diversos aparelhos!</p>
<p><object width="480" height="295"><param name="movie" value="http://www.youtube.com/v/PCx8RfNhhXk&#038;hl=en_US&#038;fs=1&#038;rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/PCx8RfNhhXk&#038;hl=en_US&#038;fs=1&#038;rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="295"></embed></object></p>
<p>Para finalizar, algumas fotos do time do Qt.</p>
<p>Em Oslo</p>
<p><a title="Oslo Team" href="http://labs.trolltech.com/blogs/wp-content/uploads/2009/12/oslo1.jpg"><img width=340 height=255 src="http://labs.trolltech.com/blogs/wp-content/uploads/2009/12/oslo1.jpg" alt="Oslo Team" /></a></p>
<p>Em Berlin</p>
<p><a title="Berlin Development Team" href="http://labs.trolltech.com/blogs/wp-content/uploads/2009/12/berlin.jpg"><img width=340 height=192 src="http://labs.trolltech.com/blogs/wp-content/uploads/2009/12/berlin.jpg" alt="Berlin Development Team" /></a></p>
<p>Em Brisbane</p>
<p><a title="Brisbane Development Team" href="http://labs.trolltech.com/blogs/wp-content/uploads/2009/12/brisbane.jpg"><img width=340 height=255 src="http://labs.trolltech.com/blogs/wp-content/uploads/2009/12/brisbane.jpg" alt="Brisbane Development Team" /></a></p>
<p>Em Munich</p>
<p><a title="Munich Development Team" href="http://labs.trolltech.com/blogs/wp-content/uploads/2009/12/munich.jpg"><img width=340 height=96 src="http://labs.trolltech.com/blogs/wp-content/uploads/2009/12/munich.jpg" alt="Munich Development Team" /></a></p>
<p>Parabéns pessoal!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eduardofleury.com/archives/2009/12/98/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The QGraphicsAnchorLayout</title>
		<link>http://blog.eduardofleury.com/archives/2009/09/86/</link>
		<comments>http://blog.eduardofleury.com/archives/2009/09/86/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 23:11:39 +0000</pubDate>
		<dc:creator>fleury</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Maemo]]></category>
		<category><![CDATA[Primary]]></category>
		<category><![CDATA[Qt]]></category>
		<category><![CDATA[Qt Labs Americas (en)]]></category>
		<category><![CDATA[anchorlayout]]></category>
		<category><![CDATA[brasil]]></category>
		<category><![CDATA[brazil]]></category>
		<category><![CDATA[designer]]></category>
		<category><![CDATA[fleury]]></category>
		<category><![CDATA[gui]]></category>
		<category><![CDATA[layout]]></category>
		<category><![CDATA[linear programming]]></category>
		<category><![CDATA[openbossa]]></category>
		<category><![CDATA[qgal]]></category>
		<category><![CDATA[qgraphicsanchorlayout]]></category>
		<category><![CDATA[recife]]></category>
		<category><![CDATA[rich UI]]></category>
		<category><![CDATA[simplex]]></category>

		<guid isPermaLink="false">http://blog.eduardofleury.com/?p=86</guid>
		<description><![CDATA[In the last post I mentioned that the new QGraphicsLayout, to be released in Qt 4.6, is already available in the public Qt git repository. Now I&#8217;d like to give some overview of how it works and why we&#8217;re so excited about it. To do that I&#8217;ll talk about the layouts that already existed in [...]]]></description>
			<content:encoded><![CDATA[<p>In the last post I mentioned that the new QGraphicsLayout, to be released in Qt 4.6, is already available in the public Qt git repository.</p>
<p>Now I&#8217;d like to give some overview of how it works and why we&#8217;re so excited about it.</p>
<p>To do that I&#8217;ll talk about the layouts that already existed in Qt, the Anchor Layout basic usage and finally, the situations that are better handled by the latter. From now on assume I&#8217;m talking about the QGraphicsView framework and where you read &#8220;widget&#8221; or &#8220;layout&#8221;, understand that I refer to QGraphicsWidgets and QGraphicsLayouts.</p>
<p><strong>Existing QGraphicsLayouts</strong></p>
<p>As of Qt 4.5, the exiting layouts available were the Linear and the Grid layouts. With those, as their names imply, users could have their widgets arranged side-by-side or in a spreadsheet-like fashion, with support for merged cells included.</p>
<p>It was not possible however to lay items out of the screen or overlap them, total or partially. Besides that, some cases would require several layouts to be nested in order to achieve the desired result.</p>
<p><strong>The Anchor Layout concept</strong></p>
<p>Previous layouts work like this: the linear layout would require you to add items to the layout in a given sequence and then those would be arranged side by side (or one on top of the other); in the grid layout the concept is similar, but items are now associated to X,Y indexes to represent the row and column where they should be inserted.</p>
<p>The Anchor Layout breaks with this paradigm in the sense there is no pre-defined concept of how should the items be arranged. The final position of each item is totally dependent on how you set the anchors. In other words, the anchor layout is a very, very <em>flexible</em> layout.</p>
<p>While most layouts are flexible to some extent and allow you to configure parameters like spacing between items or margins, the Anchor Layout brings flexibility to a new level. It was also our goal to make the setup process something easy. We didn&#8217;t want to expose hundreds of abstract parameters to the user, instead, we wanted to provide a high-level API and concept. Besides making the coding more rewarding, that would make it easier to translate into C++ code, the  UI designers ideas and way of thinking. That&#8217;s what<em> the anchors</em> are about.</p>
<p>In this layout, each item has six anchorage points, which are Left, Right, Top, Bottom and the Horizontal and Vertical centers. The user is then responsible for connecting the anchorage points of different items to the others, and to the anchorage points of the layout itself. These connections are made through the use of the so called Anchors, that have well defined sizes.</p>
<p>Then, based on:</p>
<p>- the anchors created,<br />
- the size hints of each item, and<br />
- the size of the layout itself</p>
<p>the layout engine calculates the appropriate  geometry of each widget.</p>
<p><strong>Real world Anchor Layout use cases</strong></p>
<p>Here at openBossa we have been involved on the development of rich-UI applications for long, and it was with that experience in mind that we started contributing with the guys from Qt on the development of the QGraphicsAnchorLayout.</p>
<p>Bellow you will find a few use cases of ours that were not handled by existing layouts and work fine with anchors.</p>
<p><em>Transition between screens</em></p>
<p>We often want to make a transition between two screens of the same application. Imagine the user performs an action that should hide the current screen and show another one.</p>
<p>In a rich UI application we probably want to animate such transition, one of the alternatives is to apply a fade-out or blur to the current screen until the new screen is seen. To achieve that, we want both screens to occupy the same position on the screen, the old one being in front of the new one (higher Z value). Then it&#8217;s just a matter of changing the opacity of the screen on the front and voilà, we have the effect.</p>
<p>So, how do we use a standard layout to make one widget (next screen) occupy the same position as another one (current screen)? We couldn&#8217;t do that with existing layout. With anchor is just a matter of anchoring both screens edges to the layout edges (right of item to right of layout, left to left, and so forth).</p>
<div id="attachment_87" class="wp-caption aligncenter" style="width: 330px"><img class="size-full wp-image-87" title="AnchorLayout_Swallow" src="http://blog.eduardofleury.com/wp-content/uploads/2009/09/swallow.png" alt="Usage of AnchorLayout to set two swallows on the same place" width="320" height="348" /><p class="wp-caption-text">Usage of AnchorLayout to set two swallows on the same place.</p></div>
<p><em>Off-screen items</em></p>
<p>Another common trick used in UI animations is to have an off-screen item get &#8220;inside&#8221;  the screen or vice-versa. For instance, imagine a toolbar on the top of the screen that shows or hides itself in an animated way, like &#8220;walking into&#8221; or &#8220;out&#8221; of the screen. The idea here is to have two states (QStates maybe?) where the toolbar widget is on-screen in one of them, and off-screen in the other.</p>
<p>Again, with standard layouts we could not create this &#8220;off-screen&#8221; state. With anchors it&#8217;s just a matter of anchoring for instance, the bottom of the toolbar to the top of the layout, thus, the toolbar will sit right above the layout, ready to enter the screen (in an animated way) when necessary.</p>
<div id="attachment_88" class="wp-caption aligncenter" style="width: 333px"><img class="size-full wp-image-88" title="AnchorLayout_Toolbar" src="http://blog.eduardofleury.com/wp-content/uploads/2009/09/toolbar.png" alt="Usage of AnchorLayout to set a toolbar on or off-screen." width="323" height="404" /><p class="wp-caption-text">Usage of AnchorLayout to set a toolbar on or off-screen.</p></div>
<p><em>Organic setup</em></p>
<p>There are also those cases where we have several items arranged on the screen in a very organic way as drawn by the UI designers. Often it&#8217;s not practical (or possible) to define that arrangement in terms of several  nested layouts. However, with a single Anchor Layout, all items can be arranged precisely.</p>
<p><strong>Try it</strong></p>
<p>There are other situations where such a flexible layout is helpful, however I hope the cases above exemplify the kind of problem we are trying to solve. Please, give it a try, let us know of your impressions. We really appreciate all kinds of feedback, either on usage, performance, API, features, and so forth. All of these will be taken into account so you can have a nice new tool ready for use in Qt 4.6.</p>
<p>Enjoy <img src='http://blog.eduardofleury.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eduardofleury.com/archives/2009/09/86/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Anchor Layout available in Qt 4.6 repository</title>
		<link>http://blog.eduardofleury.com/archives/2009/09/81/</link>
		<comments>http://blog.eduardofleury.com/archives/2009/09/81/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 22:09:21 +0000</pubDate>
		<dc:creator>fleury</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Misc Links]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Primary]]></category>
		<category><![CDATA[Qt]]></category>
		<category><![CDATA[Qt Labs Americas (en)]]></category>
		<category><![CDATA[anchor layout]]></category>
		<category><![CDATA[anchorlayout]]></category>
		<category><![CDATA[brasil]]></category>
		<category><![CDATA[brazil]]></category>
		<category><![CDATA[fleury]]></category>
		<category><![CDATA[graphicsview]]></category>
		<category><![CDATA[indt]]></category>
		<category><![CDATA[openbossa]]></category>
		<category><![CDATA[qgal]]></category>
		<category><![CDATA[qgraphicsanchorlayout]]></category>
		<category><![CDATA[recife]]></category>

		<guid isPermaLink="false">http://blog.eduardofleury.com/?p=81</guid>
		<description><![CDATA[This post is just to let you know that the Qt approach to Anchor Layouts, the QGraphicsAnchorLayout is available in the Qt 4.6 repository. To browse the source or download a tarball, visit Qt Gitorious. As the name implies, the current version is only available for the Graphics View Framework, ie. it is a QGraphicsLayout, [...]]]></description>
			<content:encoded><![CDATA[<p>This post is just to let you know that the Qt approach to Anchor Layouts, the QGraphicsAnchorLayout is available in the Qt 4.6 repository.</p>
<p>To browse the source or download a tarball, visit <a title="Qt 4.6 Gitorious" href="http://qt.gitorious.org/qt/qt/commits/4.6" target="_blank">Qt Gitorious.</a></p>
<p>As the name implies, the current version is only available for the Graphics View Framework, ie. it is a QGraphicsLayout, not a QLayout. The current version is still under development and still have know issues, specially with impossible arrangements of items. You can expect improvements through the next month though.</p>
<p>Check the QGraphicsAnchorLayout <a href="http://qt.gitorious.org/qt/qt/blobs/4.6/src/gui/graphicsview/qgraphicsanchorlayout.h" target="_blank">header</a> for its public API while documentation is not available. I&#8217;m going to post more about its usage soon as well.</p>
<p>Comments are always welcome!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eduardofleury.com/archives/2009/09/81/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Canola-like layout in Qt Kinetic</title>
		<link>http://blog.eduardofleury.com/archives/2009/04/69/</link>
		<comments>http://blog.eduardofleury.com/archives/2009/04/69/#comments</comments>
		<pubDate>Fri, 03 Apr 2009 22:17:15 +0000</pubDate>
		<dc:creator>fleury</dc:creator>
				<category><![CDATA[Canola]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Maemo]]></category>
		<category><![CDATA[Misc Links]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Primary]]></category>
		<category><![CDATA[Qt]]></category>
		<category><![CDATA[Qt Labs Americas (en)]]></category>
		<category><![CDATA[animated layouts]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[brasil]]></category>
		<category><![CDATA[gui]]></category>
		<category><![CDATA[openbossa]]></category>
		<category><![CDATA[recife]]></category>
		<category><![CDATA[rich UI]]></category>

		<guid isPermaLink="false">http://blog.eduardofleury.com/?p=69</guid>
		<description><![CDATA[Hi all, We&#8217;ve just uploaded a new video showing our latest animated layout example. You can check it at: OpenBossa&#8217;s Youtube Channel Or here: Rather than showing how to animate from one layout to another, this example shows how could a Qt user create his/her own custom layout that uses QGraphicsLayoutProxies internally to animate its [...]]]></description>
			<content:encoded><![CDATA[<p>Hi all,</p>
<p>We&#8217;ve just uploaded a new video showing our latest animated layout example.</p>
<p>You can check it at:<br />
<a href=http://www.youtube.com/openbossa>OpenBossa&#8217;s Youtube Channel</a></p>
<p>Or here:<br />
<object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/eJcTBJaPRZg&#038;hl=en&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/eJcTBJaPRZg&#038;hl=en&#038;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
<p>Rather than showing how to animate from one layout to another, this example shows how could a Qt user create his/her own custom layout that uses QGraphicsLayoutProxies internally to animate its items.</p>
<p>From the usage point of view, once the layout is ready, all one has to do is to add or remove widgets to the layout or resize it to see them animating to the right places.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eduardofleury.com/archives/2009/04/69/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using QAnimation to create Animated Qt Layouts</title>
		<link>http://blog.eduardofleury.com/archives/2009/02/51/</link>
		<comments>http://blog.eduardofleury.com/archives/2009/02/51/#comments</comments>
		<pubDate>Thu, 26 Feb 2009 15:22:27 +0000</pubDate>
		<dc:creator>fleury</dc:creator>
				<category><![CDATA[Canola]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Misc Links]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Português]]></category>
		<category><![CDATA[Primary]]></category>
		<category><![CDATA[Qt]]></category>
		<category><![CDATA[Qt Labs Americas (en)]]></category>
		<category><![CDATA[Talks]]></category>
		<category><![CDATA[qt; animated layouts; rich UI; gui; animation;]]></category>

		<guid isPermaLink="false">http://blog.eduardofleury.com/?p=51</guid>
		<description><![CDATA[In this post I&#8217;ll share a little bit about what we&#8217;ve been working with, Animated Layouts in Qt. To be more precise, how we have been animating QGraphicsLayouts. Layouts If you are familiar with Qt, chances are you have already used layouts and widgets a couple times. If you haven&#8217;t, try to think of a [...]]]></description>
			<content:encoded><![CDATA[<p>In this post I&#8217;ll share a little bit about what we&#8217;ve been working with, Animated Layouts in Qt. To be more precise, how we have been animating QGraphicsLayouts.</p>
<p><strong>Layouts</strong></p>
<p>If you are familiar with Qt, chances are you have already used layouts and widgets a couple times. If you haven&#8217;t, try to think of a layout as a set of geometry rules, or principles, that are applied to the children widgets when the layout is associated to a parent widget.</p>
<p>In other words, imagine you have a box drawn on the screen, and, inside it, three widgets, say, a button, a checkbox and a label. Now imagine you want these three components to be organized somehow inside the box, horizontally aligned for instance. In Qt all you have to do is to apply an horizontal layout to the box and its widgets (button, checkbox and label) will follow the rules enforced by that layout.</p>
<p><strong>The Goal</strong></p>
<p>While existing layouts work fine for forms  other static UIs but lack something when seek the development of rich, animated, interfaces, as the one in <a title="Canola 2" href="http://openbossa.indt.org.br/canola/" target="_blank">Canola 2</a>. In these scenarios animating from different layouts and/or different layout states is a must, and that&#8217;s what we went after. As the starting point, we focused on the <em>Graphics View Framework</em> and therefore started with QGraphicsLayouts rather than QLayouts. After talking with the guys at Qt Software we found a solution that enables:</p>
<ul><span></p>
<li>animated transitions from one QGraphicsLayout to a completely different one (grid to linear, for instance);</li>
<li>animated transitions from one QGraphicsLayout state to another (when an item is added for instance, or items are re-arranged);</li>
<li>works with all third-party QGraphicsLayout subclasses you may have coded to fit your personal needs; and</li>
<li>works with all third-party widgets.</li>
<p></span></ul>
<p><strong>The result</strong></p>
<p>A video is worth more than a bunch of words. <img src='http://blog.eduardofleury.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> In this demo we show:</p>
<ul>
<li>Addition of new items to a visible layout;</li>
<li>Change between three different layouts (horizontal, vertical and grid); and</li>
<li>Changes in the parent widget size.</li>
</ul>
<p><object width="425" height="344" data="http://www.youtube.com/v/M3HbmrNvQl4&amp;hl=en&amp;fs=1" type="application/x-shockwave-flash"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/M3HbmrNvQl4&amp;hl=en&amp;fs=1" /><param name="allowfullscreen" value="true" /></object></p>
<p>Can&#8217;t see the video? Watch it on YouTube:</p>
<p><a title="Animated Layouts Demo" href="http://www.youtube.com/watch?v=M3HbmrNvQl4" target="_blank">http://www.youtube.com/watch?v=M3HbmrNvQl4</a></p>
<p><strong>The Usage</strong></p>
<p>This post is focused on the internals but read <a title="MoRpHeUz blog" href="http://labs.morpheuz.eng.br/blog/26/02/2009/animated-layouts-with-qt-kinetic/" target="_blank">MoRpHeUz recent post</a> about this subject for the end-user point of view.</p>
<p><strong>The Solution</strong></p>
<p>We had a strong requirement of providing compatibility with 3rd party layouts and widgets, we also couldn&#8217;t break Qt&#8217;s API or ABI. To understand the next step it is necessary to know a little bit about how QGraphicsLayouts work in Qt, but, in a nutshell what happens when a layout is applied to a widget is the following:</p>
<ul>
<li>When the parent widget (the outer box) undergoes a change (is resized for instance), its associated layout is informed about it.</li>
<li>The layout recalculates new geometries for each of the child widgets (the label, the button and the checkbox).</li>
<li>The layout sets the new children geometries.</li>
</ul>
<p>What we did was to create an Animated Layout Proxy that sits between the Layout and each of the child widgets. Due to the way Qt is organized what is expected then is that our proxies pass along the geometry change information they received from the layout to the item below it. The <em>trick</em> here is that rather than sending the geometry change request immediatelly, the Proxy creates a QAnimation from the former state to the new one. The result after the animation is finished is the same, the child widgets were set to their new geometries, what is different however is that the widget moves in an animated, sleek way, rather than at once, which is the standard.</p>
<p>The high-level diagram below shows how the Animated Layout Proxy is inserted in the existing QGraphicsLayoutItem hierarchy. Other relationships were omitted to keep things simple.</p>
<p><img class="size-full wp-image-56" title="proxy" src="http://blog.eduardofleury.com/wp-content/uploads/2009/02/proxy.png" alt="Qt Animated Proxy Layout diagram" width="600" height="372" /><br />
<br />
Cheers,<br />
Fleury</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eduardofleury.com/archives/2009/02/51/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Bossa Conference Programme is out!</title>
		<link>http://blog.eduardofleury.com/archives/2009/02/45/</link>
		<comments>http://blog.eduardofleury.com/archives/2009/02/45/#comments</comments>
		<pubDate>Tue, 03 Feb 2009 20:50:28 +0000</pubDate>
		<dc:creator>fleury</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Maemo]]></category>
		<category><![CDATA[Misc Links]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Primary]]></category>
		<category><![CDATA[Qt]]></category>
		<category><![CDATA[Qt Labs Americas (en)]]></category>
		<category><![CDATA[Talks]]></category>
		<category><![CDATA[bossa conference brazil linux mobile conference beach openbossa indt]]></category>

		<guid isPermaLink="false">http://blog.eduardofleury.com/?p=45</guid>
		<description><![CDATA[Fresh news right from the source, the programme for Bossa Conference 2009 in Porto de Galinhas, Pernambuco &#8211; Brazil was just released. Check it out at: http://www.bossaconference.indt.org/programme And for those who haven&#8217;t seen it yet, don&#8217;t miss the Bossa Conference teaser at YouTube: http://www.youtube.com/watch?v=IHM8cUoxmio Don&#8217;t miss this one!]]></description>
			<content:encoded><![CDATA[<p>Fresh news right from the source, the <strong>programme</strong> for <strong>Bossa Conference 2009</strong> in Porto de Galinhas, Pernambuco &#8211; Brazil was just released.</p>
<p>Check it out at:<br />
<a href="http://www.bossaconference.indt.org/programme" target="_blank">http://www.bossaconference.indt.org/programme</a></p>
<p>And for those who haven&#8217;t seen it yet, don&#8217;t miss the Bossa Conference <strong>teaser at YouTube</strong>:<br />
<a href="http://www.youtube.com/watch?v=IHM8cUoxmio" target="_blank">http://www.youtube.com/watch?v=IHM8cUoxmio</a></p>
<p>Don&#8217;t miss this one! <img src='http://blog.eduardofleury.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eduardofleury.com/archives/2009/02/45/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>44 and counting&#8230; Days for Bossa Conference 09 :-)</title>
		<link>http://blog.eduardofleury.com/archives/2009/01/38/</link>
		<comments>http://blog.eduardofleury.com/archives/2009/01/38/#comments</comments>
		<pubDate>Fri, 23 Jan 2009 17:28:14 +0000</pubDate>
		<dc:creator>fleury</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Maemo]]></category>
		<category><![CDATA[Misc Links]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Primary]]></category>
		<category><![CDATA[Qt]]></category>
		<category><![CDATA[Qt Labs Americas (en)]]></category>
		<category><![CDATA[Talks]]></category>

		<guid isPermaLink="false">http://blog.eduardofleury.com/?p=38</guid>
		<description><![CDATA[No, that&#8217;s not a post about the 44th President of the USA, Mr. Barack Obama. The inauguration was very nice and so it is to know that hopefully some change will come to America, I mean, less weapons, more jobs However let&#8217;s get back to the topic, the 2009 edition of Bossa Conference is around [...]]]></description>
			<content:encoded><![CDATA[<p>No, that&#8217;s not a post about the 44th President of the USA, Mr. Barack Obama. The inauguration was very nice and so it is to know that hopefully some change will come to America, I mean, less weapons, more jobs <img src='http://blog.eduardofleury.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  However let&#8217;s get back to the topic, <strong>the 2009 edition of Bossa Conference is around the corner, have you registered online yet?</strong></p>
<p>I had just begun working at OpenBossa (the company) when I attended to last year&#8217;s Bossa Conference was delighted to experience this unique event on Free and Open Source solutions for mobile embedded devices.</p>
<p>Bossa is different because it goes beyond the high quality talks, those who attend to Bossa have the chance to hang out with the speakers and other participants in a very casual way, all of that while enjoying the best-in-class Summerville Beach Resort, in the northeast of Brazil. Expanding your network and chatting about the latest technologies is incredibly amusing when done inside a pool and under the bright sun of Porto de Galinhas, Pernambuco.</p>
<p>A teaser for those who could not be present at last years edition.</p>
<p><object width="425" height="344" data="http://www.youtube.com/v/IHM8cUoxmio&amp;hl=en&amp;fs=1" type="application/x-shockwave-flash"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/IHM8cUoxmio&amp;hl=en&amp;fs=1" /><param name="allowfullscreen" value="true" /></object></p>
<p>Online subscription is opened already at the <a title="Bossa Conference" href="http://www.bossaconference.indt.org/" target="_blank">Official Site</a>.</p>
<p>Don&#8217;t forget to read about this year&#8217;s <a title="Bossa 09 List of Speakers" href="http://www.bossaconference.indt.org/programme" target="_blank">list of speakers</a> that include, in no special order:</p>
<p>Andreas Aardal Hanssen<br />
Carsten Haitzler (Rasterman)<br />
David Zeuthen<br />
Gustavo Barbieri<br />
Hadi Nahari<br />
Holger Krekel<br />
Iñaky Pérez- Gonzalez<br />
Karen Sandler<br />
Koen Kooi<br />
Marius Bugge Monsen<br />
Olivier Crête<br />
Patrícia Montenegro<br />
Scoot James Remnant<br />
Sebastian Kügler<br />
Simon Hausmann<br />
Thiago Macieira<br />
Zack Rusin</p>
<p>Best regards!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eduardofleury.com/archives/2009/01/38/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Improving QEdje and Qt performance with nvidia drivers.</title>
		<link>http://blog.eduardofleury.com/archives/2008/08/34/</link>
		<comments>http://blog.eduardofleury.com/archives/2008/08/34/#comments</comments>
		<pubDate>Thu, 21 Aug 2008 23:14:40 +0000</pubDate>
		<dc:creator>fleury</dc:creator>
				<category><![CDATA[English]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Misc Links]]></category>
		<category><![CDATA[Primary]]></category>
		<category><![CDATA[QEdje]]></category>
		<category><![CDATA[Qt]]></category>
		<category><![CDATA[Qt Labs Americas (en)]]></category>
		<category><![CDATA[gentoo]]></category>
		<category><![CDATA[kde]]></category>
		<category><![CDATA[nvidia]]></category>
		<category><![CDATA[opengl]]></category>

		<guid isPermaLink="false">http://blog.eduardofleury.com/?p=34</guid>
		<description><![CDATA[Hey all, You may have been following the buzz around bad 2D performance of nvidia-drivers, specially with KDE 4. Well, I found out that QEdje was running slower than it could on my machine due to the same reason. Zack Rusin released yesterday a nice benchmark utility for Qt, QGears2, which I used to measure [...]]]></description>
			<content:encoded><![CDATA[<p>Hey all,</p>
<p>You may have been following the buzz around bad 2D performance of nvidia-drivers, specially with KDE 4. Well, I found out that QEdje was running slower than it could on my machine due to the same reason.</p>
<p>Zack Rusin released yesterday a nice benchmark utility for Qt, <a title="Zack Rusin blog - QGears2" href="http://zrusin.blogspot.com/2008/08/fast-graphics.html" target="_blank">QGears2</a>, which I used to measure the effect of <a title="Lemma's suggestion to improve nVidia 2D performance" href="http://techbase.kde.org/User:Lemma/KDE4-NVIDIA" target="_blank">Lemma&#8217;s suggestion on KDE&#8217;s techbase</a>.</p>
<p>My machine is a 2.4GHz Core 2 Duo / 2gb / nVidiaGeForce 8600M 256mb MacBook Pro, running Gentoo ~x86.</p>
<p>The first tests were conducted using:</p>
<ul>
<li>Xorg-server 1.4.2</li>
<li>Xorg 7.3</li>
<li>nvidia proprietary drivers (nvidia-drivers) 173.14.12</li>
</ul>
<p>The second test session were conducted after the following changes:</p>
<ul>
<li>nvidia proprietary drivers (nvidia-drivers) 177.67 beta (I&#8217;ve unmasked them in Gentoo)</li>
<li>Added PixmapCacheSize and OnDemandVBlankInterrupts options to xorg.conf</li>
<li>applied InitialPixmapPlacement and GlyphCache hacks:
<pre>nvidia-settings -a InitialPixmapPlacement=2 -a GlyphCache=1</pre>
</li>
</ul>
<p><strong>GEARSFANCY results</strong>:</p>
<p><strong>Old setup</strong>:</p>
<ul>
<li>-image  &#8211;&gt;  42 fps</li>
<li>-render &#8211;&gt; 35 fps</li>
<li>-gl &#8211;&gt; 396 fps</li>
</ul>
<p><strong>New setup</strong>:</p>
<ul>
<li>-image  &#8211;&gt;  67 fps</li>
<li>-render  &#8211;&gt;  41 fps</li>
<li>-gl  &#8211;&gt;  476 fps</li>
</ul>
<p>Let me know of your results.</p>
<p>Cheers,</p>
<p>Fleury</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eduardofleury.com/archives/2008/08/34/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
