<?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>esdrasbeleza.com &#187; Development</title>
	<atom:link href="http://www.esdrasbeleza.com/category/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.esdrasbeleza.com</link>
	<description>Só mais um blog do WordPress</description>
	<lastBuildDate>Fri, 13 Jan 2012 14:14:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>The first tips you&#8217;ll need before start programming for Symbian using Qt</title>
		<link>http://www.esdrasbeleza.com/2012/01/13/the-first-tips-youll-need-before-start-programming-for-symbian-using-qt/</link>
		<comments>http://www.esdrasbeleza.com/2012/01/13/the-first-tips-youll-need-before-start-programming-for-symbian-using-qt/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 03:08:48 +0000</pubDate>
		<dc:creator>Esdras Beleza</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Mobile phones]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.esdrasbeleza.com/?p=313</guid>
		<description><![CDATA[Last weekend I made my first Qt/Symbian mobile application. It was a very simple project, and its only purpose was to learn how to program for Symbian platform. I made a small application to search information about movies in TheMovieDb, and its source code is available at my github profile. A Qt/Symbian app is something very [...]]]></description>
			<content:encoded><![CDATA[<p>Last weekend I made my first Qt/Symbian mobile application. It was a very simple project, and its only purpose was to learn how to program for Symbian platform. I made a small application to search information about movies in <a href="http://www.themoviedb.org/">TheMovieDb</a>, and <a href="https://github.com/esdrasbeleza/BlzMovies">its source code is available at my github profile</a>.</p>
<p>A Qt/Symbian app is something very close to a normal Qt-based application for desktop, but there are some little differences that can make you confused and some tips you may need, here are my advices for some pitfalls I&#8217;ve found.</p>
<h2>Instead of showing widgets, add them to a QStackedWidget</h2>
<p><em>(that&#8217;s the best solution I&#8217;ve found, but it seems to have other solutions)</em></p>
<p>In desktop Qt, you create a new <em>QWidget</em> and call <em>show()</em> to create a new window containing that widget. <strong>This won&#8217;t work with Symbian</strong>. When you do that, all you&#8217;ll get is a small, transparent widget at the corner of your screen.</p>
<p>The solution is to get the <a href="http://developer.qt.nokia.com/doc/qt-4.8/qmainwindow.html">QMainWindow</a> of your application, add a <a href="http://developer.qt.nokia.com/doc/qt-4.8/qstackedwidget.html">QStackedWidget</a> as its central widget and add your new widgets into this QStackedWidget.</p>
<p><img class="aligncenter size-medium wp-image-314" title="How to design your widget stack" src="http://www.esdrasbeleza.com/wp-content/uploads/2012/01/qstackwidget-symbian-300x300.png" alt="" width="300" height="300" /></p>
<p>Every new widget must be added to QStackedWidget. It sounds painful, but Qt documentation <strong>tells us that when a widget is added to a QStackedWidget, the QStackedWidget becomes its parent</strong>.</p>
<p>When you create the first widget and add it to the stack, <strong>our QStackedWidget becomes its parent</strong>. So, to create a second widget and add it to the stack, you create your new widget as you do normally and asks the parent of the first widget – the QStackWidget! – to add it to the stack.</p>
<pre class="brush: cpp; title: ; notranslate">
// Create your widget
QWidget *someWidget = new QWidget(parent());

// Get the reference to our QStackedWidget casting the widget parent
QStackedWidget *stackedWidget = (QStackedWidget*) parent();

// Add the widget
stackedWidget-&gt;addWidget(someWidget);
stackedWidget-&gt;setCurrentWidget(someWidget);
</pre>
<h2>Creating menus and associating to positive and negative buttons</h2>
<p>Nokia cell phones, even the cheaper ones, have options associated to the <em>positive</em> and <em>negative</em> buttons. Take a look on this picture of an old N70:</p>
<p style="text-align: center;"><img class="aligncenter size-medium wp-image-318" title="Nokia N70" src="http://www.esdrasbeleza.com/wp-content/uploads/2012/01/n70-160x300.jpg" alt="" width="160" height="300" /></p>
<p style="text-align: left;">In the picture above, the <em>positive</em> action is <strong>Options</strong>, the <em>negative</em> option is <strong>Back</strong>. Creating options like these for your widget is quite simple.</p>
<p style="text-align: left;">In your widget&#8217;s source code, put the following lines in your constructor. Behold the lines where we use <em>setSoftKeyRole </em>to associate the action to a key. In my example, I have a &#8220;Back&#8221; shortcut and a &#8220;Details&#8221; shortcut, that access some slots.</p>
<pre class="brush: cpp; title: ; notranslate">
// Register the negative action
QAction *backToMainScreenAction = new QAction(&quot;Back&quot;, this);
backToMainScreenAction-&gt;setSoftKeyRole(QAction::NegativeSoftKey);
connect(backToMainScreenAction, SIGNAL(triggered()), SLOT(removeWidget()));
addAction(backToMainScreenAction);

// Register the negative action
QAction *selectResultAction = new QAction(&quot;Details&quot;, this);
selectResultAction-&gt;setSoftKeyRole(QAction::PositiveSoftKey);
connect(selectResultAction, SIGNAL(triggered()), SLOT(showDetailsAboutTheCurrentItem()));
addAction(selectResultAction);
</pre>
<p>This code will register the action of each widget. But to make the options show in the screen, we must make the widget&#8217;s container – the <strong>QStackedWidget</strong>! – register these actions in the menu every time the widget is created. I put the following lines in the same file where&#8217;s my main window containing the QStackedWidget. First we create the following slot:</p>
<pre class="brush: cpp; title: ; notranslate">
// This is a slot!
void MainWindow::updateActions() {
    QWidget *currentWidget = stackedWidget-&gt;currentWidget();
    menuBar()-&gt;clear();
    menuBar()-&gt;addActions(currentWidget-&gt;actions());
}
</pre>
<p>In the class&#8217;s constructor, we connect the stacked widget&#8217;s signals that are emmited when a widget is added or removed to the slot above:</p>
<pre class="brush: cpp; title: ; notranslate">
connect(stackedWidget, SIGNAL(currentChanged(int)), SLOT(updateActions()));
connect(stackedWidget, SIGNAL(widgetRemoved(int)), SLOT(updateActions()));
</pre>
<h2>Don&#8217;t believe the Nokia simulator</h2>
<p><strong>It&#8217;s still experimental.</strong> Sometimes you may think you made a mistake and have a bug, but you don&#8217;t. The simulator sometimes is confused with menus and soft buttons. If you get lost with your code and can&#8217;t find the causes of some obscure bug, try your application with a real device.</p>
<h2>Good luck with the Remote Compiler</h2>
<p><strong>It&#8217;s still experimental too.</strong> When I tried to use it, I got some short error messages whose source I couldn&#8217;t discover. So, if you don&#8217;t use Windows (like me), prepare a virtual machine running Qt SDK on Windows.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.esdrasbeleza.com/2012/01/13/the-first-tips-youll-need-before-start-programming-for-symbian-using-qt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Qt Ambassador Kit and my first impressions of Nokia C7</title>
		<link>http://www.esdrasbeleza.com/2011/03/25/the-qt-ambassador-kit-and-my-first-impressions-of-nokia-c7/</link>
		<comments>http://www.esdrasbeleza.com/2011/03/25/the-qt-ambassador-kit-and-my-first-impressions-of-nokia-c7/#comments</comments>
		<pubDate>Fri, 25 Mar 2011 04:18:40 +0000</pubDate>
		<dc:creator>Esdras Beleza</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Mobile phones]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[C7]]></category>
		<category><![CDATA[Nokia]]></category>
		<category><![CDATA[Nokia C7]]></category>
		<category><![CDATA[Qt]]></category>
		<category><![CDATA[Qt Ambassador]]></category>
		<category><![CDATA[Review]]></category>
		<category><![CDATA[Symbian]]></category>
		<category><![CDATA[Symbian^3]]></category>

		<guid isPermaLink="false">http://www.esdrasbeleza.com/?p=280</guid>
		<description><![CDATA[A few months ago, I submitted my personal audio player project Audactile to the Nokia&#8217;s Qt Ambassador program. They seem to have liked it and I was accepted into the program. The good surprise is that they sent me a Qt Ambassador kit: a t-shirt, some stickers and a Nokia C7 mobile phone. The pictures [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">A few months ago, I submitted my personal audio player project <a href="http://audactile.esdrasbeleza.com">Audactile</a> to the Nokia&#8217;s <a href="http://qt.nokia.com/qt-in-use/ambassadors/qtambassador/">Qt Ambassador program</a>. They seem to have liked it and I was accepted into the program.</p>
<p style="text-align: justify;">The good surprise is that they sent me a Qt Ambassador kit: a t-shirt, some stickers and a Nokia C7 mobile phone. The pictures I took aren&#8217;t very good, but here they are:</p>
<p><a href="http://www.esdrasbeleza.com/wp-content/uploads/2011/03/IMG_0045.jpg"><img class="aligncenter size-full wp-image-281" title="Qt Ambassador Kit" src="http://www.esdrasbeleza.com/wp-content/uploads/2011/03/IMG_0045.jpg" alt="Qt Ambassador Kit" width="360" height="480" /></a></p>
<p><a href="http://www.esdrasbeleza.com/wp-content/uploads/2011/03/IMG_0048.jpg"><img class="aligncenter size-full wp-image-282" title="Nokia C7" src="http://www.esdrasbeleza.com/wp-content/uploads/2011/03/IMG_0048.jpg" alt="" width="286" height="361" /></a></p>
<p><a href="http://www.esdrasbeleza.com/wp-content/uploads/2011/03/IMG_0047.jpg"><img class="aligncenter size-full wp-image-283" title="Nokia C7" src="http://www.esdrasbeleza.com/wp-content/uploads/2011/03/IMG_0047.jpg" alt="" width="312" height="356" /></a></p>
<p style="text-align: justify;">The stickers are beautiful and I&#8217;m thinking of where I&#8217;ll put them. <img src='http://www.esdrasbeleza.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  The most attractive item is, obviously, the <strong>Nokia C7</strong>. It runs <strong>Symbian^3</strong>, and it was the very first time I could use a device with it. My first impressions:</p>
<ul>
<li style="text-align: justify;">The capactive touch screen is very good. I already test devices from Apple, Motorola, Sony Ericsson and HTC, and I can say that it&#8217;s very sensitive. It has support for pinch zoom on images.</li>
<li style="text-align: justify;">Symbian^3&#8242;s UI is way better than its predecessors. It&#8217;s like a mix of the old Symbian (since it&#8217;s still Symbian&#8230;), iOS and Android. You have non-intrusive alerts at the top of the screen (like a desktop) instead of the old ugly rectangles that older versions of Symbian used for their notifications. The menus still are a bit confusing, but are better than my old Nokia E71&#8242;s menus.</li>
<li style="text-align: justify;">The AMOLED display is very sharp, its colours are brilliant and the images look great. You have an ambient light detector that changes the display&#8217;s illumination, like my MacBook does.</li>
<li style="text-align: justify;">The stereo sound from its back outputs are clear and powerful. Nokia knows how to put a good sound into its devices.</li>
<li style="text-align: justify;">Its camera has 8.0MP, dual flash and face recognition. It can record videos in HD resolution, but I haven&#8217;t tested it yet.</li>
</ul>
<p style="text-align: justify;">Nokia C7 has a very powerful hardware. Its software is pretty cool and as friendly as Android IMHO (unfortunately Nokia will use Windows Phone instead of Symbian in some time&#8230;). The mobile phone was given to me with a short letter asking to develop for it, so that&#8217;s what I&#8217;ll do. I&#8217;ll try to write some Qt application for Symbian, and I&#8217;ll report any progress here. <img src='http://www.esdrasbeleza.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.esdrasbeleza.com/2011/03/25/the-qt-ambassador-kit-and-my-first-impressions-of-nokia-c7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cool tools to avoid suffering with Windows</title>
		<link>http://www.esdrasbeleza.com/2010/10/11/cool-tools-to-avoid-suffering-with-windows/</link>
		<comments>http://www.esdrasbeleza.com/2010/10/11/cool-tools-to-avoid-suffering-with-windows/#comments</comments>
		<pubDate>Mon, 11 Oct 2010 18:11:43 +0000</pubDate>
		<dc:creator>Esdras Beleza</dc:creator>
				<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[classic shell]]></category>
		<category><![CDATA[notepad++]]></category>
		<category><![CDATA[pidgin]]></category>
		<category><![CDATA[Screenshots]]></category>
		<category><![CDATA[text editor]]></category>
		<category><![CDATA[vídeo]]></category>
		<category><![CDATA[vlc]]></category>
		<category><![CDATA[winamp]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.esdrasbeleza.com/?p=248</guid>
		<description><![CDATA[After two years working only with Linux and Mac OS, I received a new task that requires using Windows for two months (only two months, happily). It&#8217;s hard to get back to this bugful, unstable and confusing world: I do believe Linux and Mac OS are easier to use than Windows, that big world of [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">After two years working only with Linux and Mac OS, I received a new task that requires using Windows for two months (only two months, happily). It&#8217;s hard to get back to this bugful, unstable and confusing world: I do believe Linux and Mac OS are easier to use than Windows, that big world of icons that lead to icons that lead to icons that lead to nowhere, but I&#8217;m doing my best.</p>
<p style="text-align: justify;">I tried to find a set of useful and free (as in &#8220;free beer&#8221; and/or as in &#8220;free speech&#8221;) tools to make my work easier. They are:</p>
<p style="text-align: justify;"><strong><a href="http://classicshell.sourceforge.net/" target="_blank">Classic Shell Setup</a></strong></p>
<p style="text-align: justify;">I don&#8217;t know why Microsoft removed the toolbar from Windows Explorer since Windows Vista, but this application tries to put it back there. It also allows you to get some customisation of Start Menu, and get a simple, fast and useful menu like the Windows 9x/ME/2000 times.</p>
<p><a href="http://www.esdrasbeleza.com/wp-content/uploads/2010/10/classic_shell.png"><img class="aligncenter size-medium wp-image-249" title="Windows 7 with Classic Shell" src="http://www.esdrasbeleza.com/wp-content/uploads/2010/10/classic_shell-300x245.png" alt="" width="300" height="245" /></a></p>
<p style="text-align: justify;"><strong><a href="http://notepad-plus-plus.org/" target="_blank">Notepad++</a></strong></p>
<p style="text-align: justify;">I like <a href="http://projects.gnome.org/gedit/" target="_blank">gedit</a> and <a href="http://kate-editor.org/" target="_blank">kate</a>, and the native alternative for Windows is Notepad++: a good editor for plain text files, like source code.</p>
<p><a href="http://www.esdrasbeleza.com/wp-content/uploads/2010/10/notepad++.png"><img class="aligncenter size-medium wp-image-252" title="Notepad++" src="http://www.esdrasbeleza.com/wp-content/uploads/2010/10/notepad++-300x179.png" alt="" width="300" height="179" /></a></p>
<p style="text-align: justify;"><strong><a href="http://pidgin.im" target="_blank">Pidgin</a></strong></p>
<p style="text-align: justify;">With support for MSN/Live/whatever network, Google Talk, ICQ, etc. Pidgin is one of the best chat clients. I&#8217;d rather use it than the fancy MSN Live Messenger.</p>
<p style="text-align: justify;"><strong><a href="http://www.winamp.com" target="_blank">Winamp</a></strong></p>
<p style="text-align: justify;">Why use iTunes or the suffering Windows Media Player if you can use Winamp? It has a clean interface, a good way to organise library (although it&#8217;s a little bit <em>iTunesy</em>) and a simple playlist, everything in the same screen. I really love the good and old Winamp.</p>
<p><a href="http://www.esdrasbeleza.com/wp-content/uploads/2010/10/winamp.png"><img class="aligncenter size-medium wp-image-251" title="Winamp" src="http://www.esdrasbeleza.com/wp-content/uploads/2010/10/winamp-300x179.png" alt="" width="300" height="179" /></a></p>
<p style="text-align: justify;"><strong><a href="http://www.videolan.org/">VLC</a></strong></p>
<p style="text-align: justify;">Winamp can play some videos, but I think VLC is a better tool for this job. Besides, it has a great support for a huge range  of video formats and features for users with any needs and all experience levels.</p>
<p><a href="http://www.esdrasbeleza.com/wp-content/uploads/2010/10/vlc.png"><img class="aligncenter size-medium wp-image-250" title="VLC" src="http://www.esdrasbeleza.com/wp-content/uploads/2010/10/vlc-300x262.png" alt="" width="300" height="262" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.esdrasbeleza.com/2010/10/11/cool-tools-to-avoid-suffering-with-windows/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Firefox 4.0 pre-beta released</title>
		<link>http://www.esdrasbeleza.com/2010/07/04/firefox-4-0-pre-beta-released/</link>
		<comments>http://www.esdrasbeleza.com/2010/07/04/firefox-4-0-pre-beta-released/#comments</comments>
		<pubDate>Mon, 05 Jul 2010 02:41:00 +0000</pubDate>
		<dc:creator>Esdras Beleza</dc:creator>
				<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[Beta]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Preview]]></category>

		<guid isPermaLink="false">http://www.esdrasbeleza.com/?p=231</guid>
		<description><![CDATA[Lifehacker shown a screenshot of the new Firefox 4.0 pre-beta for Windows. Here it is (Mozilla names Firefox beta versions &#8220;Minefield&#8221;): Nice, isn&#8217;t it? So, I downloaded the new beta for Linux, and it looks like the screenshot below. I had to set the tabs to be on top; Windows version brings this for default [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Lifehacker <a href="http://lifehacker.com/5575931/firefox-4-pre+beta-candidate-brings-tabs-and-top-and-other-changes-to-the-fox">shown a screenshot of the new Firefox 4.0 pre-beta for Windows</a>. Here it is (Mozilla names Firefox beta versions &#8220;Minefield&#8221;):</p>
<p><img class="aligncenter size-full wp-image-233" title="Lifehacker's Minefield Screenshot" src="http://www.esdrasbeleza.com/wp-content/uploads/2010/06/lifehacker_minefield.jpg" alt="" width="500" height="321" /></p>
<p style="text-align: justify;">Nice, isn&#8217;t it? So, I downloaded the new beta for Linux, and it looks like the screenshot below. I had to set the tabs to be on top; Windows version brings this for default (at least the one that I installed using Wine).</p>
<p><a href="http://www.esdrasbeleza.com/wp-content/uploads/2010/06/firefox-4.0b2pre1.png"><img class="aligncenter size-medium wp-image-235" title="Firefox 4.0 pre-beta on Linux" src="http://www.esdrasbeleza.com/wp-content/uploads/2010/06/firefox-4.0b2pre1-300x220.png" alt="Firefox 4.0 pre-beta on Linux" width="300" height="220" /></a></p>
<p style="text-align: justify;">Compare. The screenshot below is Firefox 3.6.4.</p>
<p><a href="http://www.esdrasbeleza.com/wp-content/uploads/2010/06/firefox-3.6.4.png"><img class="aligncenter size-medium wp-image-234" title="Firefox 3.6.4 on Linux" src="http://www.esdrasbeleza.com/wp-content/uploads/2010/06/firefox-3.6.4-300x203.png" alt="Firefox 3.6.4 on Linux" width="300" height="203" /></a></p>
<p style="text-align: justify;">It&#8217;s a little far from <a href="https://wiki.mozilla.org/Firefox/4.0_Linux_Theme_Mockups">the mockups of Firefox for Linux at Mozilla&#8217;s site</a>. I hope I can see it soon. <img src='http://www.esdrasbeleza.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.esdrasbeleza.com/2010/07/04/firefox-4-0-pre-beta-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VolumeSlider&#8217;s tooltip misbehaviour</title>
		<link>http://www.esdrasbeleza.com/2010/06/29/volumesliders-tooltip-misbehaviour/</link>
		<comments>http://www.esdrasbeleza.com/2010/06/29/volumesliders-tooltip-misbehaviour/#comments</comments>
		<pubDate>Tue, 29 Jun 2010 17:58:20 +0000</pubDate>
		<dc:creator>Esdras Beleza</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Qt]]></category>
		<category><![CDATA[Qt Creator]]></category>

		<guid isPermaLink="false">http://www.esdrasbeleza.com/?p=203</guid>
		<description><![CDATA[I was developing a Qt application that makes use of a Phonon::VolumeSlider object. But after clicking the mute button beside of the VolumeSlider and verifying its tooltip, I noticed it was showing the wrong volume. A video can explain this better than me: www.youtube.com/watch?v=rJcqZ2SVTK0 If you want to reproduce this problem, you can download its source [...]]]></description>
			<content:encoded><![CDATA[<p>I was developing a Qt application that makes use of a Phonon::VolumeSlider object. But after clicking the mute button beside of the VolumeSlider and verifying its tooltip, I noticed it was showing the wrong volume. A video can explain this better than me:</p>
<p style="text-align: center;"><span class="youtube">
<object type="application/x-shockwave-flash" width="320" height="265" data="http://www.youtube.com/v/rJcqZ2SVTK0?color1=3a3a3a&amp;color2=999999&amp;border=0&amp;fs=1&amp;hl=en&amp;modestbranding=1&amp;loop=&amp;showinfo=0&amp;showsearch=0&amp;rel=1">
<param name="movie" value="http://www.youtube.com/v/rJcqZ2SVTK0?color1=3a3a3a&amp;color2=999999&amp;border=0&amp;fs=1&amp;hl=en&amp;modestbranding=1&amp;loop=&amp;showinfo=0&amp;showsearch=0&amp;rel=1" />
<param name="allowFullScreen" value="true" />
<param name="wmode" value="transparent" />
</object>
</span><p><a href="http://www.youtube.com/watch?v=rJcqZ2SVTK0">www.youtube.com/watch?v=rJcqZ2SVTK0</a></p></p>
<p>If you want to reproduce this problem, you can download its <a href="http://www.esdrasbeleza.com/wp-content/uploads/2010/06/VolumeSlider.tar.gz">source code</a> as a Qt Creator project. Please keep in mind that it&#8217;s the source code with errors!  But there&#8217;s a workaround to this problem:</p>
<p>1. In the class where you create the Phonon::AudioOutput whose volume is handled by the VolumeSlider, put this:</p>
<pre class="brush: cpp; title: ; notranslate">
connect(audioOutput, SIGNAL(mutedChanged(bool)), this, SLOT(handleMute(bool)));
connect(audioOutput, SIGNAL(volumeChanged(qreal)), this, SLOT(handleVolume(qreal)));
</pre>
<p>2. Create the slots you used above using the following code:</p>
<pre class="brush: cpp; title: ; notranslate">
void MainWindow::handleMute(bool mute) {
    if (!mute) {
        audioOutput-&gt;setVolume(outputVolume);
    }
}
void MainWindow::handleVolume(qreal volume) {
    outputVolume = volume;
}
</pre>
<p>3. Declare the slots and the outputVolume variable in your header file:</p>
<pre class="brush: cpp; title: ; notranslate">
private:
    qreal outputVolume;

private slots:
    void handleMute(bool mute);
    void handleVolume(qreal volume);
</pre>
<p>You can download the <a href="http://www.esdrasbeleza.com/wp-content/uploads/2010/06/VolumeSliderFixed.tar.gz">fixed source code</a>. I don&#8217;t know if this behaviour is the expected in Qt, but <a href="http://bugreports.qt.nokia.com/browse/QTBUG-11782">I filed a bug for it</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.esdrasbeleza.com/2010/06/29/volumesliders-tooltip-misbehaviour/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fixing problem with Subclipse and svn+ssh repositories</title>
		<link>http://www.esdrasbeleza.com/2010/05/27/fixing-problem-with-subclipse-and-svnssh-repositories/</link>
		<comments>http://www.esdrasbeleza.com/2010/05/27/fixing-problem-with-subclipse-and-svnssh-repositories/#comments</comments>
		<pubDate>Thu, 27 May 2010 21:14:00 +0000</pubDate>
		<dc:creator>Esdras Beleza</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Subclipse]]></category>
		<category><![CDATA[SVN]]></category>
		<category><![CDATA[version control]]></category>

		<guid isPermaLink="false">http://www.esdrasbeleza.com/?p=169</guid>
		<description><![CDATA[I was trying to synchronise a Java project with a SVN repository that runs over a SSH tunnel. It was working right in the command line, but in Subclipse it was showing a &#8220;network connection closed unexpectedly&#8221; error. It was fixed changing the SVN interface from JavaHL to SVNKit in Eclipse preferences (click to zoom):]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">I was trying to synchronise a Java project with a SVN repository that runs over a SSH tunnel. It was working right in the command line, but in Subclipse it was showing a &#8220;network connection closed unexpectedly&#8221; error.</p>
<p style="text-align: justify;">It was fixed changing the SVN interface from JavaHL to SVNKit in Eclipse preferences (click to zoom):</p>
<p><a href="http://www.esdrasbeleza.com/wp-content/uploads/2010/05/eclipse_change_svn_interface.png"><img class="aligncenter size-medium wp-image-170" title="Changing SVN interface in Eclipse" src="http://www.esdrasbeleza.com/wp-content/uploads/2010/05/eclipse_change_svn_interface-254x300.png" alt="Changing SVN interface in Eclipse" width="254" height="300" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.esdrasbeleza.com/2010/05/27/fixing-problem-with-subclipse-and-svnssh-repositories/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to fix ugly fonts in Qt-based applications</title>
		<link>http://www.esdrasbeleza.com/2010/05/20/how-to-fix-ugly-fonts-in-qt-based-applications/</link>
		<comments>http://www.esdrasbeleza.com/2010/05/20/how-to-fix-ugly-fonts-in-qt-based-applications/#comments</comments>
		<pubDate>Thu, 20 May 2010 17:30:48 +0000</pubDate>
		<dc:creator>Esdras Beleza</dc:creator>
				<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Fonts]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Qt]]></category>
		<category><![CDATA[Qt Creator]]></category>
		<category><![CDATA[X11]]></category>

		<guid isPermaLink="false">http://www.esdrasbeleza.com/?p=153</guid>
		<description><![CDATA[I was using Qt Creator and tried to change the editor&#8217;s font to Monaco, 9. But hey, Monaco is not that ugly: So I googled a way to fix for this problem, and found the fix at Arch Linux forums. You&#8217;ll need to create a file called .fonts.conf in your home directory with this content: I [...]]]></description>
			<content:encoded><![CDATA[<p>I was using Qt Creator and tried to change the editor&#8217;s font to <a href="http://en.wikipedia.org/wiki/Monaco_(typeface)">Monaco, 9</a>. But hey, Monaco is not that ugly:</p>
<p><img class="aligncenter size-full wp-image-154" title="Monaco before fix" src="http://www.esdrasbeleza.com/wp-content/uploads/2010/05/monaco-qt-before.png" alt="Monaco before fix" width="150" height="150" /></p>
<p>So I googled a way to fix for this problem, and found the fix at <a href="http://bbs.archlinux.org/viewtopic.php?pid=705548#p705548">Arch Linux forums</a>. You&#8217;ll need to create a file called <em>.fonts.conf</em> in your home directory with this content:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;?xml version='1.0'?&gt;
&lt;!DOCTYPE fontconfig SYSTEM 'fonts.dtd'&gt;
&lt;fontconfig&gt;
   &lt;match target=&quot;font&quot; &gt;
      &lt;edit mode=&quot;assign&quot; name=&quot;rgba&quot; &gt;
         &lt;const&gt;rgb&lt;/const&gt;
      &lt;/edit&gt;
   &lt;/match&gt;
   &lt;match target=&quot;font&quot; &gt;
      &lt;edit mode=&quot;assign&quot; name=&quot;hinting&quot; &gt;
         &lt;bool&gt;true&lt;/bool&gt;
      &lt;/edit&gt;
   &lt;/match&gt;
   &lt;match target=&quot;font&quot; &gt;
      &lt;edit mode=&quot;assign&quot; name=&quot;hintstyle&quot; &gt;
         &lt;const&gt;hintslight&lt;/const&gt;
      &lt;/edit&gt;
   &lt;/match&gt;
   &lt;match target=&quot;font&quot; &gt;
      &lt;edit mode=&quot;assign&quot; name=&quot;antialias&quot; &gt;
         &lt;bool&gt;true&lt;/bool&gt;
      &lt;/edit&gt;
   &lt;/match&gt;
&lt;/fontconfig&gt;
</pre>
<p>I closed Qt Creator and reopened it. The result was this:</p>
<p><img class="aligncenter size-full wp-image-156" title="Monaco after fix" src="http://www.esdrasbeleza.com/wp-content/uploads/2010/05/monaco-qt-after.png" alt="Monaco after fix" width="150" height="150" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.esdrasbeleza.com/2010/05/20/how-to-fix-ugly-fonts-in-qt-based-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why I chose Qt</title>
		<link>http://www.esdrasbeleza.com/2010/05/13/why-i-chose-qt/</link>
		<comments>http://www.esdrasbeleza.com/2010/05/13/why-i-chose-qt/#comments</comments>
		<pubDate>Thu, 13 May 2010 14:14:39 +0000</pubDate>
		<dc:creator>Esdras Beleza</dc:creator>
				<category><![CDATA[Desktop]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[comparison]]></category>
		<category><![CDATA[GTK]]></category>
		<category><![CDATA[gtkmm]]></category>
		<category><![CDATA[Qt]]></category>
		<category><![CDATA[Qt Creator]]></category>

		<guid isPermaLink="false">http://www.esdrasbeleza.com/?p=137</guid>
		<description><![CDATA[A few months ago, I planned to learn some graphic toolkit. As a GNOME user, GTK was my natural choice. Although I&#8217;m a Python lover, I chose C++ because I just wanted to learn a new language and stop being afraid of pointers. So I started to read the gtkmm documentation, like tutorials and API, [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">A few months ago, I planned to learn some graphic toolkit. As a GNOME user, GTK was my natural choice. Although I&#8217;m a Python lover, I chose C++ because I just wanted to learn a new language and stop being afraid of pointers. So I started to read the <a href="http://www.gtkmm.org/">gtkmm</a> documentation, like tutorials and API, and to program a simple music player. I was learning gtkmm and it all seemed okay.</p>
<p style="text-align: center;"><img class="aligncenter" title="Qt" src="http://www.esdrasbeleza.com/wp-content/uploads/2010/05/qt.png" alt="" width="200" height="238" /></p>
<p style="text-align: justify;">But I read a little about Qt and, after talking with some friends about the pros and cons of GTK and Qt, I decided to do with Qt the same things that I&#8217;ve already done with GTK up to that point. So I would know <strong>what choice was better for me</strong>. Notice that I&#8217;m not saying that Qt is better for everybody and that GTK must die, but that Qt looked better <strong>for me and my personal project</strong>. After this disclaimer, and can tell my reasons:</p>
<ul style="text-align: justify;">
<li><strong>Look &amp; feel.</strong> I&#8217;m a look&amp;feel fanatic, and sometimes I move from GNOME to KDE only to check its new features. But I hate how GTK applications look in KDE. You can use <a href="http://code.google.com/p/gtk-qt-engine/">gtk-qt-engine</a>, but you&#8217;ll still notice the differences. You can set GTK to use the excellent <a href="http://kde-look.org/content/show.php/QtCurve+(KDE4,+KDE3,+%26+Gtk2+Theme)?content=40492">QtCurve</a> theme, that have identical versions to Qt and GTK, but you&#8217;ll get tied to a theme. But look what you have if you run a Qt application in GNOME (<a href="http://projects.gnome.org/gedit/">gedit</a> is a GTK-based application and <a href="http://musicbrainz.org/doc/PicardTagger">Picard</a> is a Qt-based application):<br />
<a href="http://www.esdrasbeleza.com/wp-content/uploads/2010/05/gtk_qt_look_and_feel.png"><img class="aligncenter" style="margin-top: 15px; margin-bottom: 15px;" title="GTK vs QT look &amp; feel in GNOME" src="http://www.esdrasbeleza.com/wp-content/uploads/2010/05/gtk_qt_look_and_feel-300x231.png" alt="" width="300" height="231" /></a><br />
Thanks to <a href="http://labs.trolltech.com/blogs/2008/05/13/introducing-qgtkstyle/">QGtkStyle</a>, Qt applications detect if you are in GNOME and your Qt application gets an almost perfect GTK look &amp; feel. And yeah, it includes open and save dialogs.</li>
<li><strong>Documentation. </strong>Qt has a very, very rich and well-organised documentation, with <a href="http://doc.qt.nokia.com/4.6/tutorials.html">tutorials</a>, <a href="http://doc.qt.nokia.com/4.6/index.html">API references</a>, and <a href="http://doc.qt.nokia.com/4.6/examples.html">examples</a>. gtkmm also have all these items, but they didn&#8217;t look very friendly to me. And the documentation of Qt 4.7, still in development, <a href="http://doc.qt.nokia.com/4.7-snapshot/">will be even better</a>.</li>
<li><strong>A simple, but good IDE.</strong> A good programmer must not be dependent on IDEs, but they really help you. I tried to use Anjuta (unstable sometimes), MonoDevelop (very good for .NET platform, but not a good IDE for C/C++ development) and Netbeans as IDE when I was using gtkmm, and I was not satisfied with them. But Qt has its official IDE, <strong>Qt Creator</strong>:<br />
<a href="http://www.esdrasbeleza.com/wp-content/uploads/2010/05/qtcreator.png"><img class="aligncenter size-medium wp-image-139" style="margin-top: 15px; margin-bottom: 15px;" title="Qt Creator" src="http://www.esdrasbeleza.com/wp-content/uploads/2010/05/qtcreator-300x177.png" alt="" width="300" height="177" /></a><br />
Qt Creator is clean, simple, and complete. It has quick access to documentation, breakpoints, project configuration, native support for CVS, Subversion and Git, good code completion, a good GUI designer (like the GTK&#8217;s <a href="http://glade.gnome.org/">Glade</a>), among other features.</li>
<li><strong>Runs well on many platforms.</strong> Qt is smart enough to run well &#8211; and with native look &amp; feel, I really like this &#8211; in Linux, Mac, Windows, and others.</li>
</ul>
<p style="text-align: justify;">But Qt still has some cons:</p>
<ul>
<li>Users should have it installed to run Qt applications, and this is not very usual in Linux environments based on GNOME, neither on Windows systems.</li>
<li>Qt is free only if you&#8217;re using it in a free project. For commercial applications, <a href="http://qt.nokia.com/products/licensing">you must obtain a commercial Qt licence</a>. <strong>Update: </strong>this is not exactly a con. You still can use Qt under LGPL in commercial applications, but if you make any change to Qt you must publish them or purchase a commercial Qt licence <em>(thanks, krok, for the comment)</em>.</li>
</ul>
<p style="text-align: justify;">If you&#8217;re beginning to learn to program for graphical environments or you&#8217;re looking for a good graphical library to use in your project, you really should give Qt a try, implement some examples and feel which option is better for you.</p>
<p style="text-align: justify;"><a href="http://www.esdrasbeleza.com/wp-content/uploads/2010/05/gtk_qt_look_and_feel.png"><br />
</a></p>
<p style="text-align: justify;">
<p style="text-align: justify;">
]]></content:encoded>
			<wfw:commentRss>http://www.esdrasbeleza.com/2010/05/13/why-i-chose-qt/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Conectando o PHP ao Oracle</title>
		<link>http://www.esdrasbeleza.com/2010/04/24/conectando-o-php-ao-oracle/</link>
		<comments>http://www.esdrasbeleza.com/2010/04/24/conectando-o-php-ao-oracle/#comments</comments>
		<pubDate>Sat, 24 Apr 2010 19:02:15 +0000</pubDate>
		<dc:creator>Esdras Beleza</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.esdrasbeleza.com/?p=132</guid>
		<description><![CDATA[Nota: fiz esse tutorial há 3 anos, não garanto que ele continue funcionando! Depois de muito apanhar, aprendi uma maneira fácil de pôr o PHP pra se comunicar com o Oracle. A maioria das soluções que achei envolvia recompilar o PHP, mudar variáveis de ambiente, scripts de inicialização etc. Uma delas até deu certo, mas [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;"><strong><em>Nota:</em></strong><em> fiz esse tutorial há 3 anos, não garanto que ele continue funcionando!</em></p>
<p style="text-align: justify;">Depois de muito apanhar, aprendi uma maneira fácil de pôr o PHP pra se comunicar com o Oracle. A maioria das soluções que achei envolvia recompilar o PHP, mudar variáveis de ambiente, scripts de inicialização etc. Uma delas até deu certo, mas mudar as variáveis de ambiente fez o suporte a LDAP do PHP parar de funcionar, por razões que desconheço.</p>
<p>A solução que explico abaixo faz a mesma coisa, mas sem recompilar pacotes ou fazer gambiarras. Deu certo milagrosamente, após juntar a solução proposta por vários sites. O máximo que será feito é compilar a extensão <em>oci8</em> para o PHP do Debian ou Ubuntu, que é feito automaticamente e em poucos segundos. A parte chata é baixar os arquivos do site do Oracle, que exige criação de conta.</p>
<p>Todos os comandos abaixo são executados como root. Boa sorte! <img src='http://www.esdrasbeleza.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<ol style="text-align: justify;">
<li>No site de <a href="http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxsoft.html" target="_blank">downloads do Oracle para Linux</a>, baixe os arquivos <em>instantclient-basic-linux32-10.2.0.3-20061115.zip</em> e <em>instantclient-sdk-linux32-10.2.0.3-20061115.zip</em>. Você vai precisar criar uma conta no site da Oracle para isso. Após o download, extraia-os para o diretório <em>/usr/local/oracle</em>.</li>
<li>Em <em>/usr/local/oracle</em>, crie o seguinte link: <em># ln -s libclntsh.so.10.1 libclntsh.so</em></li>
<li>Instale os pacotes <em>php5-dev</em> e <em>php5-pear </em>pelo apt-get ou aptitude (<em>aptitude install php5-dev php5-pear</em>). Caso não exista o <em>php5-pear</em>, procure por <em>php-pear</em>.</li>
<li>Agora execute (lembre-se: sempre como root): <em># pecl install oci8</em></li>
<li>Surgirá um prompt perguntando onde estão as bibliotecas do Oracle. Sua resposta será <em>instantclient,/usr/local/oracle </em>, como no exemplo:<em>Please provide the path to ORACLE_HOME dir. Use &#8221;instantclient,/path/to/instant/client/lib&#8221; if you&#8221;re compiling against Oracle Instant Client [autodetect] : instantclient,/usr/local/oracle</em></li>
<li>No diretório<em> /etc/php5/conf.d </em>, crie um arquivo <em>oci8.ini</em>, com o seguinte conteúdo:extension=oci8.so</li>
<li>O PHP deverá estar com suporte a Oracle (extensão oci8). Reinicie o seu servidor web (caso seja o Apache, <em>apache2ctl restart</em>).</li>
</ol>
<p style="text-align: justify;">
Fontes: <a href="http://www.oracle.com/technology/pub/notes/technote_php_instant.html" target="_blank">Installing PHP and the Oracle 10g Instant Client for Linux and Windows</a>; <a href="http://samgerstenzang.com/blog/archives/2006/09/howto-installing-oracle-xe-on-ubuntu-with-php" target="_blank">How to: Installing Oracle XE on Ubuntu with PHP</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.esdrasbeleza.com/2010/04/24/conectando-o-php-ao-oracle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cortando strings muito longas no Android</title>
		<link>http://www.esdrasbeleza.com/2010/04/19/cortando-strings-muito-longas-no-android/</link>
		<comments>http://www.esdrasbeleza.com/2010/04/19/cortando-strings-muito-longas-no-android/#comments</comments>
		<pubDate>Mon, 19 Apr 2010 19:05:37 +0000</pubDate>
		<dc:creator>Esdras Beleza</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Mobile phones]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Smartphones]]></category>

		<guid isPermaLink="false">http://www.esdrasbeleza.com/?p=112</guid>
		<description><![CDATA[Eu estava fazendo uma aplicação para Android quando me deparei com um problema: cortar strings muito longas. Um bom exemplo é a string da figura aí de baixo. Essa é a string na qual vamos nos basear. Ela é gerada pelo código Há duas maneiras de corrigir o problema. Uma delas é o seguinte código: [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Eu estava fazendo uma aplicação para Android quando me deparei com um problema: <strong>cortar strings muito longas. </strong>Um bom exemplo é a string da figura aí de baixo.</p>
<p><img class="aligncenter size-full wp-image-113" title="String não cortada" src="http://www.esdrasbeleza.com/wp-content/uploads/2010/04/Screenshot-5554Device1.png" alt="" width="334" height="494" /></p>
<p style="text-align: justify;">Essa é a string na qual vamos nos basear. Ela é gerada pelo código</p>
<pre class="brush: xml; title: ; notranslate">&lt;TextView
    android:layout_width=&quot;fill_parent&quot;
    android:layout_height=&quot;wrap_content&quot;
    android:text=&quot;@string/hello&quot;
    android:textSize=&quot;20px&quot;/&gt;</pre>
<p style="text-align: justify;">Há duas maneiras de corrigir o problema. Uma delas é o seguinte código:</p>
<pre class="brush: xml; title: ; notranslate">&lt;TextView
    android:layout_width=&quot;fill_parent&quot;
    android:layout_height=&quot;wrap_content&quot;
    android:text=&quot;@string/hello&quot;
    android:textSize=&quot;20px&quot;
    android:singleLine=&quot;true&quot;/&gt;</pre>
<p style="text-align: justify;">Porém, a diretiva <em>android:singleLine</em> é descrita na IDE como em desuso (<em>deprecated</em>). Um código que surte o mesmo efeito é</p>
<pre class="brush: xml; title: ; notranslate">&lt;TextView
    android:layout_width=&quot;fill_parent&quot;
    android:layout_height=&quot;wrap_content&quot;
    android:text=&quot;@string/hello&quot;
    android:textSize=&quot;22px&quot;
    android:ellipsize=&quot;end&quot;
    android:scrollHorizontally=&quot;true&quot;
    android:lines=&quot;1&quot;/&gt;</pre>
<p style="text-align: justify;">O resultado é este:</p>
<p><img class="aligncenter size-full wp-image-114" title="Ellipsize" src="http://www.esdrasbeleza.com/wp-content/uploads/2010/04/Screenshot-5554Device1-ellipsize.png" alt="" width="334" height="494" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.esdrasbeleza.com/2010/04/19/cortando-strings-muito-longas-no-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.463 seconds -->

