Qt 5 UiHelpers

In my previous post I mentioned one of the experiments we are currently working on.
Now it is time to introduce the Qt 5 playground project called UiHelpers – Fortunately, this name will change ;)
Those who follow the Qt development mailing list already read about it, the idea about this post is to reach more people from the community in general.

Context

If you are already familiar with the structure of Qt 5 code, feel free to jump to the next section.

In Qt 4, the whole source code is in the same git repository. The traditional widgets derived from QWidget are part of the QtGui module and represent a central piece for the GUI application development.

In Qt 5, things changed. Qt code were splitted in many repositories which group Qt libraries depending on their functionalities.
Examples of repositories are qtbase, qtdeclarative, qtjsbackend, qtxmlpatterns, qtsvg, qttools, etc.
As you may know, QtQuick 2 became a first class citizen in Qt 5, which means qtdeclarative is one of the main repositories, house of QtQuick and QtQml classes.

But, there are classes that provide the base for QtQuick 2 work properly – they are part of the qtbase repo. There you find QtCore,
QtGui, QtNetwork, QtOpenGL, QtPlatformSupport, QtXml, QtWidgets, etc.

Wait: What’s the difference between QtGui and QtWidgets?

As part of the changes of Qt 5, QtGui is now focused in the basic infrastructure for GUI work on different platforms. For example, it is the place for the platform abstraction layer, window management, image handling, etc.

QtWidgets, as you can conclude based on its name, contains the children of QWidget: QPushButton, QSpinBox, QMainWindow, etc. Also, there are non-widgets classes in QtWidgets, some of them because they are internally too coupled to QWidget classes.

Origins

In this thread it was mentioned the case of QUndoStack, QUndoCommand that are in QtWidgets but can be useful in other contexts where developers do not want to link against QtWidgets just because of this kind of helper classes.
Later, in the change 15857 (with the help of ogoffart), we discussed about moving QUndo* out of QtWidgets. First, we moved these classes to QtGui what as not considered correct given the new motivation of this lib. Then, another idea was to move the classes to a new lib, inside qtbase. It was not considered ideal and the decision was to create a separated repo for these classes, leaving QtWidgets untouched (since the Qt community do not want to introduce new bugs in this lib).

Current status

We set a wiki page where it is possible to check the classes made available out of QtWidgets. Also, there are instructions about where to download the source code, build, test and contact us.

Besides moving classes out of QtWidgets, some prototypes of convenience APIs were created for QtQuick 2 developers and we are very interested in receiving feedback about them. It’s worth mentioning the QML API for UndoStack and the CompletionModel which is based on the internals of QCompleter and was made available in a QML friendly way.

The following example shows a possible use case for the CompletionModel. Improving the models supported by sourceModel is part of the ToDo list. The ListView is going to show the updated list that currently satisfies what is written in the TextInput.

TextInput {
    id: input
}

CompletionModel {
    id: completionModel
    sourceModel: ["Ascension Island", "Andorra", "Afghanistan"]
    completionPrefix: input.text
    caseSensitivity: Qt.CaseInsensitive
}

ListView {
    model: completionModel
    delegate: Text { text: modelData }
}

The two examples bellow show the UndoStack and two items that represent commands. The idea of UndoPropertyCommand is to enable track the changes of some properties. In the example, we are going to track x and y when myRect is moved.

UndoStack {
    id: stack
    undoLimit: 5
}

UndoPropertyCommand {
    id: moveCommand
    properties: ["x", "y"]
}

Rectangle {
    id: myRect

    (...)

    MouseArea {
        (...)
        drag.target: parent
        onPressed: stack.push(moveCommand, myRect);
    }
}

UndoCommand is another element used to represent commands. The difference here is that it allows the customization of the actions onUndo and onRedo the command.

UndoCommand {
    id: aCommand

    onUndo: doAThing(target);
    onRedo: undoAThing(target);
}

Button {
    onClicked: stack.push(aCommand, target);
}

Future

Maybe one day this playground project gets promoted and become a Qt Add-on, but there is no expectation it will happen before 5.0. In the meanwhile, there is a ToDo list with some topics we consider important to handle, like better examples, more tests, docs, etc.

We are looking forward receiving more opinions about this work and, as always, contributors are welcome!

Working in the open again

Long time since my last post (it’s sad to realize how often I start posts writing this).
Since last year’s Qt Contributors’ Summit, our team at INdT worked on a closed source project – the main reason of the low activity here. At least, I could write some posts for the Qt Labs Blog Brazil, most of them introducing basic concepts about Qt programming and the Qt ecossystem (buzzword++).
The good part is: This project we were working on was developed using Qt and QML for a desktop application. Besides promoting Qt among Brazilian developers and companies, this project helped us to think about improvements for future releases of QtQuick aiming desktop applications. I am looking forward to see a release of this product soon! (However, when it is going to happen is a client decision).

Then, after the end of this project, I finally managed to contribute to Qt5! :-)

Also, in the end of the last year some coworkers started a kind of pet project: It’s called Iceberg, a fork of the Icecream Monitor.

“Why a fork?” Here we use icecream for distributed compilation, many colleagues used to complain about icemon depending on kdelibs. In fact, the code did not use the additional features compared to the equivalent Qt classes. Then, after hugopl started the project, we fixed some issues and added new stuff. The code is here.

I am writing another post to introduce one of our current research projects, which is also part of the proposal I sent to Akademy 2012.

Qt Contributors’ Summit

I'm going to the Qt Contributors' Summit

 

We are in Berlin, attending the Qt Contributor’s Summit. 265 people are discussing very important (and interesting) topics for Qt 5 and the open governance. You can follow what’s happening here using the hash code #qtcs on several social networks. And of course, you can check the wiki page of the event.

Personally, I am attending sessions related with QML, Qt-Components, DevNet and open governance.

And yesterday was Thursday, also known as the “Yellow Day”:

Ok, Ademar was not wearing yellow t-shirt. Well, imagine him as the goalkeeper of the team ;)

 

Meego Conf 2011 – San Francisco

I am in San Francisco (again! =), now for the MeeGo Conference 2011.

The event is about to begin with the keynote “The Future of MeeGo Starts Now” presented by the president of Linux Foundation, Jim Zemlin.

This time, I’m going to present a talk in the event too! The talk is today and the topic is “Writing applications for multiple MeeGo devices”.

There are other talks by openBossa/INdT guys, check the schedule!

MeeGo Conference and the Mobile Sprint

Then November became a very busy month.

After the Qt Dev Days San Francisco, I went quickly to Natal to present a talk about Qt and KDE on mobile devices. It’s time to say thank you for the ENSL organizers – As always, I am late with my posts…

So, last week we went to Dublin, for the MeeGo Conference 2010. As more people already posted, it was a really nice event. The good surprise was the limit of the number of Intel and Nokia people, leaving space for the growing community meet – more than a thousand people attended, very well accommodated in the place chosen (the conference rooms in the Aviva Stadium) with a good work of the organization which managed to keep things working nicely.

Although the short time of the presentations, it was good to have a whole ideaof how the project is being conduced, and it looks promising. Unfortunately I left Dublin on Wednesday morning, so I lost the last day which was reserved for the ‘unconference‘ sections and the football match, but I managed to go to the Guinness Storehouse in Tuesday night, a really good choice for the conference after hours.

With the Lenovo ideapad received from the MeeGo Conference guys (thanks! :-)) in my backpack, I traveled to Berlin for the KDE Mobile Sprint, kindly hosted by KDAB in its office.

I must say, we had fun with the new devices. :-)
During the sprint, interesting discussions about MeeGo, new opportunities, QML and Qt-components. Some of the guys dedicated their time to KDE packaging for MeeGo while in parallel other ones worked in QML based widgets for plasma, tested how some applications work on the ideapad’s touchscreen, and tested plasma-mobile and plasma-tablet shells on it. The results of this sprint are being listed in this wiki page.

The first steps :-)

Check the videos in Marco’s and Artur’s posts about the sprint. Also, Till Adam showing Kontact Mobile on MeeGo.

Of course there is more work to do, but considering how things worked without special attention to this device (and for MeeGo), we can expect good news in the future.

And here a screenshot of the gallery to test the Plasma QML widgets, with a FlashingLabel, some BusyWidgets and a PushButton. It’s just the beginning.

I know, the gallery is, let's say, weird... :-P

“If you’re going to San Francisco…”

“…You’re gonna meet some gentle people there”
This part of the Scott Mackenzie’s famous song is definitely true. I’m in San Francisco since last Friday and I’m enjoying the city.
The true reason for this trip is the Qt Developer Days, which started yesterday with the training sections and the demo area, where I could see different kind of applications, products and ideas using Qt or created to ease the development with Qt.
It’s just a short post, in a few minutes there will be the first keynote and I have to go downstairs. :-)
This is my first DevDays, special thanks to the Qt Developer Network guys who decided to bring some of the contributors!
The Golden Gate Bridge

Qt 4.6 & mobile-demos also on desktop

You may have seen these posts about mobile demos , this nice video showing the making of the weather demo and also the last video released yesterday.

To celebrate the new version of Qt, the first with the S60 port, we thought it would be nice if people could also check those demos on desktop platforms. You know, Qt is everywhere =)

As the release was yesterday, probably there are people without Qt 4.6 installed in their desktops yet… so we prepared binaries with Qt 4.6.0 statically linked =)

Linux version

Windows version

Mac version (Unfortunately I don’t have a Mac available here right now. Contributions are welcome =)

It’s worth a mention. The source code for all platforms is basically the same, the only difference are due to different screen sizes, different connections methods.  This code is still available in the same place: http://gitorious.org/qt-labs/mobile-demos

And again, owners of  either S60 devices or N900 find packages at: http://qtlabs.openbossa.org/mobile-demos .

TODO: Fix the bug in the weather demo when there’s no connection…

PS1: As an extra activity, support for keypads is work in progress (I have a N85 =P )

PS2:  Now that Qt 4.6.0 is out, it’s a good moment to make it work again

PS3: Hello planet KDE! o/

Qt 4.6 & mobile-demos (pt_BR)

Hoje foi lançado o Qt 4.6.0! Também lançada a versão 1.3 do Qt Creator. Downloads em http://qt.nokia.com/downloads

Além das novidades desta versão, confira também os mobile-demos! (Código Aqui)

Pausa!

“O que é Qt?” -> Veja um resumo aqui (embora esse artigo em português da Wikipedia precise dumas atualizações).

Qt Creator?” -> É uma IDE para desenvolvimento em Qt.

mobile-demos? Tá, esse explico aqui =)

São alguns conceitos de aplicações criados pelos designers e desenvolvedores do openBossa visando principalmente dispositivos de telefonia móvel (vulgo ”celulares’) Symbian / S60 – Plataforma que move cerca de vários celulares em todo o mundo, notoriamente (mas não exclusivamente) aparelhos Nokia.

Se você tem um celular S60 5th edition (N97, 5800), você encontra os pacotes em: http://qtlabs.openbossa.org/mobile-demos/

Quem tem celulares S60 3rd (por exemplo N95, N85), também podem rodar esses demos! Claro que com restrições, já que eles foram pensados para telas sensíveis a toque. Existem alguns branchs no gitorious com algum suporte ao teclado, quem sabe num futuro próximo teremos novidades =)

Se você já é um dos felizes proprietários de um N900, também temos pacotes para você!

Se você está querendo ver do que se trata isso tudo, está rodando Windows e não quer se envolver com compilação, instalação de bibliotecas, etc, aguarde que se possível ainda hoje haverá algo para você veja os links abaixo do vídeo =)

Enquanto isso, confira o vídeo:

Update:

Aqui estão as versões para você que quer brincar com os demos no seu desktop. São binários com Qt 4.6.0 linkados estaticamente, para você que ainda está com uma versão anterior do Qt ou nem tem instalado.

Versão para Linux

Versão para Windows

Mac: Estou sem mac no momento, contribuições são bem-vindas =)

fisl10

OBS: Este post deveria ter sido publicado em 1 de Julho mas não ficou pronto a tempo. Só consegui terminá-lo hoje, 5 de Julho. Acabei publicando sem estar todo terminado para não perder de vez o contexto.

—-

De 24 a 27 de junho aconteceu a décima edição do Fórum Internacional de Software Livre – fisl, em Porto Alegre-RS. Foi a primeira vez que compareci ao evento e tive a oportunidade de colaborar com o pessoal da Qt Software no estande no evento, montado em conjunto com o openBossa/INdT.

Houve bastante interesse (e também curiosidade) a respeito do framework Qt. Muitas pessoas procurando informações técnicas, treinamentos, esclarecendo dúvidas sobre o uso do Qt, sobre licenças, o que mudou desde que a Nokia comprou a Trolltech (agora Qt Software) e sobre as novidades que estarão disponíveis, ainda este ano, com o lançamento da versão 4.6.

Claro que também foi um trabalho de divulgação para os que não conheciam a ferramenta. Curiosamente alguns destes são usuários do KDE, que é o grande exemplo de uso do Qt (por ser bem maior e mais complexo que Skype, Google Earth, entre outros).

O desafio Qt/openBossa, realizado pouco antes e durante o evento, teve como vencedor Paulo Cesar Ferreira com o projeto QuickSocial – já fazendo uso de uma das novidades em desenvolvimento no Qt, a Declarative UI, disponível nos repositórios em qt.gitorious.org. O primeiro colocado ganhou um Internet Tablet Nokia N810, um exemplar do livro “C++ GUI Development with Qt4“ além de uma viagem de uma semana para o Recife onde participará de um pequeno treinamento de Qt no INdT. Também ganharam exemplares deste livro o segundo colocado, Rafael Floriano da Silva (PyRSS) e o terceiro Caio Ariede (Qtaxy).

Houve também o encontro da comunidade KDE Brasil. Muitas idéias foram levantadas, espero que consigamos aumentar a integração dos usuários e desenvolvedores brasileiros e melhorar a divulgação.

De volta ao Recife, uma certa pressa para concluir algumas tarefas antes de partirmos para o Gran Canaria Desktop Summit, evento que reunirá pela primeira vez aKademy (evento anual do KDE) e  GUADEC (evento do GNOME) e acontecerá em Las Palmas de Gran Canária, na Espanha. Será uma grande experiência junto aos desenvolvedores do KDE assim como teremos novamente a chance de conversar pessoalmente com os desenvolvedores da Qt Software que também estarão lá. Meus colegas de trabalho (um tanto “Silvio Santos” essa frase) Artur (aka MoRpHeUz) , Caio Marcelo e Eduardo Fleury (estes em dupla) tiveram palestras aceitas e falarão sobre o desenvolvimento de interfaces voltadas para netbooks e sobre como o uso de diferentes  layouts podem enriquecer a experiência dos usuários de software, respectivamente.

gcds_summit_badge.serendipityThumb

Agora algumas horas de vôo pela frente =)

PS: Sim, virei um semi-analfabeto com as mudanças na Língua Portuguesa. Velha ortografia++.

Canola2 menu layout with Qt Kinetic

Welcome back dear readers. This is my second post of the day talking about what is happening in the development of animated layouts in Qt Kinetic.

As I said in my previous post, we discussed about new good examples that could show use cases of this new API. In the end, only one example was created, but it’s really cool =) .

Maybe some of you will recognize this interface, it looks like canola2‘s main menu, another software developed by INdT for Nokia internet tablets (e.g. N810) – and as you can read here, an old bug was fixed and canola2 is now a free software, released under GPLv3. In this post you can read more about the development of that interface.

So, we wrote an example based on that concept. During the development we had nice discussions regarding the algorithm for the engine that controls the icons distribution on the screen.

Check it out:

http://www.youtube.com/watch?v=eJcTBJaPRZg

The source code is not available yet, but it will be published soon in a git repository near you, then you will be able to check how animated layouts were used and also see that algorithm I’ve just mentined. So, stay tuned!