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!

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!

Qt Mobile Demos in extras-devel

A small post.

In the first season, the focus was S60 devices. After the holidays, the new season is about Maemo. =)

Qt Mobile Demos are in Maemo 5 extras-devel, so now it’s easier to check them in a N900 near you. First, you need to enable the extras-devel repository/catalogue and the demos should appear if you search for “qtmobile”.

The packages are:

hyperui -> qtmobiledemo-hyperui

mybudget -> qtmobiledemo-mybudget

shoplist -> qtmobiledemo-shoplist

weather -> qtmobiledemo-weather

Future? Well, soon QAbstractKineticScroller will replace our kinetic list implementation. (Read the comments).

And yes, we have a list of known issues to solve in our free time…

The code still in the same place, http://qt.gitorious.org/qt-labs/mobile-demos

That’s all for today.

PS: Thanks to Etrunko, who helped a lot with packaging stuff =)

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 =)

Latinoware 2009

Na próxima Quinta-feira, 22 de Outubro, começa a edição deste ano da Conferência Latino Americana de Software Livre – Latinoware 2009, e nós estaremos lá! =)

Cerca de 3800 pessoas estão inscritas para o evento e acredito que será um grande encontro com outros desenvolvedores, pessoas que conheço apenas por IRC ou e-mail, chance de conseguir parceiros para o  Qt Labs Americas em outros países da América Latina, e claro, aprender e conhecer novas coisas.

Aprender e também ensinar! =) Se você olhar a programação do evento, notará que alguns colegas farão apresentações lá. Entre eles, Artur de Souza (MoRpHeuz) apresentará uma atualizada versão de sua palestra sobre Plasma Netbook (incluindo uma demonstração bem legal =). Já Caio Marcelo e Eduardo Fleury tratarão sobre novas possibilidades para o desenvolvimento de interfaces gráficas em Qt e KDE. Ainda temos nosso colega importado Kenneth Christiansen, que falará sobre QtWebkit.

No último dia  (Sábado, 24 de Outubro) Jesus Sanchez-Palencia e eu ministraremos um minicurso sobre o que há de novidade no Qt 4.6. Assim, pessoas interessadas no desenvolvimento com Qt e também KDE terão uma grande oportunidade de aprendizado, pois existem outros 2 cursos no programa, ministrados pelos colegas do Live Blue, além é claro de poder ter contato com outros membros da comunidade KDE que estarão por lá =)

Além dos já mencionados, destaco também a apresentação que Ana Cecília (annieC) fará sobre um estudo de usabilidade em projetos de software livre.

Aos que forem para o Latinoware, nos vemos lá! Aos que não puderem comparecer, fiquem atentos que em breve teremos notícias.

Latinoware 2009

Next Thursday, October 22nd begins the 6th edition of the Latin American Free Software Conference – Latinoware and we are going to be there =)

About 3900 people are already registered for the event and personally I expect a great opportunity to meet people, some of them I only know from IRC or mailing lists, maybe new partners for Qt Labs Americas in other countries of Latin America =) and also a chance  to learn new things.

Learn and teach a little! =) If you take a look in the conference’s program you will see that some colleages are going to speak there. Artur de Souza (MoRpHeuz) will present an updated version of his talk about Plasma Netbook (including a cool demonstration =). In Caio Marcelo‘s and Eduardo Fleury’s talk, the attendants will see what are the new possibilities in graphical interfaces development with Qt (and for KDE). Another openBossa speaker is Kenneth Christiansen with a presentation about QtWebkit.

People interested in learn how to develop with Qt and KDE will have a great opportunity because there are 2 courses by the guys of Live Blue. In the last day (Saturday October,24th) Jesus Sanchez-Palencia and me are going to head a course on the new Qt 4.6 APIs .

Besides the mentioned ones, Ana Cecília (annieC) will talk about an usability study on FOSS.

So, if you are going to Foz do Iguaçú, see you there! =) And if you won’t go, stay tuned for the news.

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!