April 29, 2017

Well, 9 months is a long time. For a baby is the time to be born. For Atelier was the time to mature. For you that are here for the first time, let me tell you what Atelier is. Atelier is the name of a KDE project, with the goal to control 3DPrinters(And CNC's). It [...]


On his spare time, Elad Lahav (a kernel developer at BlackBerry) built an experimental Qt-based desktop environment to try and see if he could use QNX as a desktop operating system. And it works!

Anyone up to porting KDE to QNX for desktop use?

More at https://membarrier.wordpress.com/2017/04/12/qnx-7-desktop/

Explicar las bondades de las aplicaciones de la Comunidad KDE es una de las tareas más importantes que tenemos entre las manos aquellos que no somos programadores. Por ello me parece importante compartir con todos vosotros el vídeo de los Dolphin Service Menu que se ha publicado en youtube y que explica qué son y como funcionan. Espero que os guste.

Vídeo de los Dolphin Service Menu

De la mano de Average Linux User nos llega un vídeo que cumple una función muy necesaria para el desarrollo de las aplicaciones KDE: la difusión de funciones avanzadas pero sencillas y que nos ayudan a trabajar de forma más eficientemente con nuestro ordenador.

Así que en menos de 6 minutos, Average Linux User nos explica que son los Dolphin Service Menu, como instalarlos y nos realiza un repaso por algunos de los que él utiliza (Quick backup and restore files, Kompare menu, Export Libreoffice & Office documents to PDF, Show and hide multiple files, Set as Wallpaper)

Para finalizar, nos muestra algunos otros Dolphin Service Menu interesantes.

Como es habitual, si os gusta el vídeo dadle al “Like” y comparte. El autor lo agradecerá.

¿Qué son los Dolphin Service Menu?

La configurabilidad de KDE está más que demostrada y prueba de ello son los Dolphin Service Menu, que no son más que la posibilidad de disponer un menú auxiliar en el gestor de archivos Dophin o en Konqueror que se activa con el botón derecho del ratón.
Con ellos tendremos nuevas acciones como:

Y muchos más como hemos explicado en varias ocasiones en el blog. Puedes encontrar estos servicios se pueden encontrar en la sección Dolphin Service Menu en la Store de KDE.

April 28, 2017

Kirigami UI lets you easily design and create convergent apps that work on desktop and mobile environments. Platforms supported by Kirigami UI include Windows, Android, and Linux. Kirigami is especially indicated for KDE's Plasma Desktop and the upcoming Plasma Mobile platform, KDE's graphical environment for mobile devices. Apps developed with Kirigami will probably also work on MacOS X and iOS with minimal tweaking, although these platforms are not officially supported yet.

In fact, today's release has benefited from the feedback from the Subsurface Mobile community -- the most prominent users of Kirigami outside of KDE at the moment. The Subsurface app, originally created by Linux creator Linus Torvalds, has successfully been ported to both iOS and MacOS X.

Several new components have been added to today's release:



The new Discover, KDE's graphical utility for searching and installing for apps, displays a customized ListView with a background picture.

  • ItemViewHeader is the standardized title for ListViews and can be customized with a background picture that will scroll with a nice parallax effect when the header adjusts. You can configure it to follow several different behaviours.
  • ApplicationItem is a root element for the QML application. You can use it in applications that are a hybrid of QWidgets and QML. The main view for these applications will be either QQuickView or a QQuickWidget.
  • PageRow is now a public element and you can use it directly in any application and in any context.

Developers have also engaged in a comprehensive bug stomping campaign, correcting among other things:

  • The bug that affected the behaviour of the central scrollable column view
  • Spacing and margins, improving the sizing for bottom action buttons and drawer handles

Other fixes specific to applications running on a desktop system include:

  • The Desktop mode bar has been rewritten, improving the behavior of the pages when loaded on a desktop app.
  • Improvements to icon management for icons coming from the system-wide icon theme when the application is running on a desktop system
  • Better mouse wheel support in the main item views
  • Bugfixes in the behaviour of the central scrollable column view

To find out more about this release and learn more about Kirigami in general, visit our KDE techbase website. If you would like to get started developing your apps with Kirigami, visit the Kirigami2 API overview.

You can also talk directly to the developers and become a part of the future of desktop/mobile convergence by visiting our forum, joining in the conversation on the Plasma IRC channel, or hanging out in our Telegram group.

The Latin America KDE Summit, LaKademy, just started today in Belo Horizonte, Minas Gerais, Brazil. The country is in the middle of a general strike, which I’m supporting, but the LaKademy couldn’t stop. We’ve been organizing this meeting for a year.

The event will last until May 1, Internacional Worker’s Day. This year LaKademy is celebrating its 5th edition. It’s a special time to celebrate our activities here in Latin America and keep up the work to attract more contributors to community.

DSC04524

LaKademy stickers.

This edition we have 6 new people attending to LaKademy, it’s a great number considering that the summit have 16 people in total. We hope all of them can keep contribute with community and also bring more people too ��

DSC04506

Almost everyone gathered, some will still arrive.

In these raining days here in BH (how people lovingly call the city), I intend to finish the LaKademy website and work with some translations stuffs. I also plan to do my usual work, which is to think in ways to spread the KDE word to the world :).

Stay tuned, I will post more news about the event soon.

 


Q: With some free software phone projects ending, what does Plasma Mobile's future look like?

A: The future is rosy. While it is true that Plasma Mobile used to be built on the Ubuntu Phone codebase, that was superseded some time ago. The recent events at Ubuntu and other mobile communities have not modified the pace of the development (which is pretty fast) or the end goal, which is to build frameworks that will allow convergence for all kinds of front-ends and apps on all kinds of devices.



The "converged" KAlgebra app running on an Android phone.

That framework for apps already exists. It is called Kirigami. Usually an operating system gains traction because of its apps. Think back when Android was the underdog to iOS, what did Google do? Lower the bar and put in place incentives for developers to create apps for Android.

The plan is that Kirigami will make the underlying platform irrelevant. If developers can port their apps with minimal hassle, and users can run their apps the same on all platforms, including the desktop, the possibility of having a shot at grabbing a slice of the mobile market becomes much more realistic. Even for new players, the main hurdle at the point of entry, i.e. having a well-stocked app store, disappears.

In the last couple of weeks Plasma Mobile developers have been working with some other mobile communities and has now announced the Halium project. This project aims to develop a common free, open and community-backed base-layer for all GNU/Linux-based mobile operating systems, including Ubuntu Phone which lives on through the UBports project. This interface will allow all operating systems to interact with the Android subsystems that control hardware and other low level components.

As you can see, the Plasma Mobile developers are working on bringing a common framework both to the UI side front and to the base layer. Interestingly, they are doing this, not only for the benefit of Plasma Mobile, but, in true Free Software fashion, for every community with a mobile project. This was already the goal before what happened at Ubuntu, by the way.

So, as I said at the beginning, the future for Plasma Mobile is bright.

Dot Categories:

A bit later than planned, but here are the 2017 Krita Survey results! We wanted to know a lot of things, like, what kind of hardware and screen resolution are most common, what drawing tablets were most common, and which ones gave most trouble. We had more than 1000 responses! Here’s a short summary, for the full report, head to Krita User Survey Report.

  • About 55% of respondents use Windows, about 40% Linux, about 10% MacOS. Web-traffic, wise, 75% browses krita.
  • Almost half of respondents have an NVidia graphics card, less than 25% AMD: the rest is Intel.
  • The most common amount of RAM is 8GB
  • The most common screen resolution 1920×1080
  • The most common tablet brand is Wacom, the next most common Huion; the tablet brand that gives people most trouble is, unsurprisingly, Genius
  • The most common image sizes are 1920×1080, then A4 at 300 DPI: 2480×3508
  • And finally, most people wish that Krita were a bit faster — something we suspect will be the case forever!

And we’ve also learned (as if we didn’t know!) that Krita users are lovely people. We got so many great messages of support in the write-in section!

Estamos ante una nueva primavera llena de eventos libres que cumplen la doble función de compartir conocimientos y cohesionar las Comunidades. A casi una semana de su inicio me complace anunciar la Opensouthcode 2017 de Málaga donde la Comunidad KDE estará presente en forma de mesa informativa. Si estás por la zona, no te lo pierdas.

Opensouthcode 2017 de Málaga

Opensouthcode 2017 de MálagaEl próximo 5 y 6 de mayo, en la activa ciudad de Málaga se celebra la Opensouthcode 2017, un evento para promocionar y dar a conocer las tecnologías abiertas: software/hardware libre y opensource.

El evento se celebra en La Térmica (Avda. Los Guindos, ) y se divide en dos tiempos muy diferenciados: el viernes se dedica a reuniones de grupos de desarrolladores centradas en temáticas específicas (java, Linux, Python o WordPress) y el sábado se dedica a la celebración de ponencias.

De esta forma, el día 6 nos encontramos con más de 15 charlas donde se puede aprender nociones de Nubes de Contenedores, Raspberry Pi, Java, JavaScript, openSUSE Build, Angular, etc.

Así que si te interesa no te lo pierdas y regístrate, es gratis, no te cuesta nada, y tienes a tu disposición 35 charlas, 2 Talleres y 5 Meetups. Si te gusta el mudo del Conocimiento Libre ¿qué más se puede pedir?

KDE en Opensouthcode 2017

Además, si sois seguidores de la Comunidad KDE debéis saber que la Comunidad KDE española estará presente en forma de pequeño stand donde se podrá ver un ordenador mostrando las bondades del escritorio y sus aplicaciones, además de flyers, pagatinas y la presencia física de dos miembros, como minimo, de la Comunidad: el presidente actual de KDE España, Antonio Larrosa (que además presenta una ponencia “Lo que nadie te contó sobre zypper y openSUSE Build Service”) y de Agustín Benito, ex-tesorero de KDE e.V.

Más información: Opensouthcode 2017 de Málaga

Akademy, KDE's annual conference, requires a place and team for the year 2018. That's why we are looking for a vibrant, enthusiastic spot in Europe that can host us!

A Bit About Akademy

Akademy is KDE's annual get-together where our creativity, productivity and love are at their peak. Developers, users, translators, students, artists, writers - pretty much anyone who has been involved with KDE will join Akademy to participate and learn. Contents will range from keynote speeches and a two-day dual track session of talks by the FOSS community, to workshops and Birds of a Feather (BoF) sessions where we plot the future of the project. Friday is scheduled for the KDE e.V. General Assembly and a pre-Akademy party/welcoming event. Saturday and Sunday covers the keynotes, talks and lightning talks. The remaining four days are used for BoFs, intensive coding sessions and workshops for smaller groups of 10 to 30 people out of which one day is reserved for a Day Trip of the attendees around the local touristic sights. Hosting Akademy is a great way to contribute to a movement of global collaboration. You get a chance to host one of the largest FOSS community in the world with contributors from over the world and be a witness to a wonderful inter-cultural fusion of attendees in your home town. You'll also get great exposure to Free Software. It is a great opportunity for the local university students, professors, technology enthusiasts and professionals to try their hand at something new.

What You Need to Do

Akademy requires a location in Europe, with a nice conference venue, that is easy to reach, preferably close to an international airport. Organizing Akademy is a demanding and a resource intensive task but you’ll be guided along the entire process by people who’ve been doing this for years. Nevertheless, the local team should be prepared to spare a considerable amount of time for this. For detailed information, please see the Call for Hosts. Questions and applications should be addressed to the Board of KDE e.V. or the Akademy Team. Please indicate your interest in hosting Akademy to the Board of KDE e.V. by June 1st. Full applications will be accepted until 15th June. We look forward to your enthusiasm in being the next host for Akademy 2018!

KDevelop, your cross-platform IDE, since version 5.1 has initial OpenCL language support.

If you are into OpenCL and interested, we need your help for some improvement to that:

What is the mimetype name to use for OpenCL C files?

Due to KDevelop needs some weeks ago a mimetype for OpenCL has already been added to the shared-mime-info database, with text/x-opencl-src as mimetype name.
Though if we reflect, that entry was quickly requested and made without consulting a lot of OpenCL users. It currently reads:

<mime-type type="text/x-opencl-src">
    <_comment>OpenCL source code</_comment>
    <acronym>OpenCL</acronym>
    <expanded-acronym>Open Computing Language</expanded-acronym>
    <sub-class-of type="text/x-csrc"/>
    <glob pattern="*.cl"/>
</mime-type>

For one, “OpenCL source code” should be rather “OpenCL C source code”. Because there are now both C and C++ variants (see below) which would need to be reflected in the name.

Next, text/x-opencl-src was made up and seems to be not used by anyone before. Asking your search engine, you will see that people in their desperation had already started to use all kind of other mimetype names before, e.g.:

  • text/x-opencl
  • text/x-clsrc
  • text/x-opencl_c
  • application/x-opencl_c

So text/x-opencl-src might not have been the best choice. Even more as again the C and C++ variants need to be reflected in the name.

Is there no-one at the Khronos Group who had time to look at deciding on a mimetype name and registering that with IANA as MIME type (or now Media type)?

Can you poke them, or hint us whom to talk to?

OpenCL C++

And then there is OpenCL C++ (since OpenCL 2.1), yet to reach the masses.
What mimetype name shall it have? What will the file extension(s) be?


April 27, 2017

QtWS17 CfPBuild for Tomorrow – Deliver Today

The Qt World Summit 2017 in Berlin, Germany this October is where the Qt community comes together from all around the world. This year, the theme of the event is “Build for Tomorrow – Deliver Today”.

The Call for Presentations is Now Open!

However please read through this guide before running off to submit your presentation.

Key Dates

  • The call is open now!
  • The call will close on 30.5.2017.
  • The authors of accepted topics will be informed in early June.
  • The list of accepted topics will be publicly available in mid June.
  • Full presentations / slide submissions must be made by 15.9.2017

Themes and Focus areas

As the theme for Qt World Summit 2017 suggests, the focus of the event will be on the future of software. Recently, Qt received a significant contribution from NVIDIA, and the Qt3D module has seen a lot of improvement. In line with this, we are emphasizing 3D graphics and user interfaces as one main area in our call for presentations.

In the past year Qt has seen strong growth in the automotive segment and embedded devices overall. We are also looking for presentations that dive into all the phases of an embedded devices’ life-cycle, and we would like to hear your views on how Qt is a part of the innovation happening across a variety of industries.

Qt is a cross platform framework, we are also excited about what you have to say about application development, a strong area for Qt. The tooling and SDK in Qt has always been an important part of our story, so that is included in the call.

Software ecosystems are still an important trend in development. Qt can be used to enable your ecosystem or as part of your SDK.

In addition, other areas of interest include automation systems, medical systems and multi-screen applications.

To summarize the above, we are calling for presentations on:

  • Future of software with Qt
  • 3D User interfaces and Graphics, including AR and VR
  • Automotive solutions
  • Application development and Qt enabling application ecosystems
  • Tools, methods and processes for the embedded device life-cycle
  • Automation systems

Did we miss something? The latest advancements and improvements in Qt are also welcome as always. You can also submit presentations on any topic related to Qt.

Business track

This year we will be hosting a business track, with presentations that demonstrate the business aspects of Qt in software development.

  • Cases and examples of Qt in use
  • Time to market
  • Software life-cycle
  • Development team setup and composition
  • Ecosystems from the business aspect

Program committee and selection criteria

The Program committee includes members from The Qt Company and Qt Partners. The committee will review all submissions and jointly select presentations for the Qt World Summit.

There are many ways to write an abstract, but here are some tips for an easy to read, easy to understand abstract that is sure to win a slot on the Qt World Summit agenda:

  • Show a clear intent and purpose
  • Make clear what the value to the intended audience is
  • Keep in mind the summit’s themes and focus
  • Offer something unique and unexpected, yet relevant is to the event’s focus areas

The committee will make their decision based on the outlined themes of the event. The committee will also make sure that the selected presentations support a varied and overall diverse spectrum of interesting presentations – both in terms of technical level and focus areas to provide value for event participants.

Session Length

You may propose either a 25 or 50 minute session.

Audience

Topics should be of interest to all attendees. The Qt World Summit attracts people from all corners of the Qt community. This year, we can expect technology directors, developers and engineers, as well as business decision makers, product and project managers will be attending the event.

Speaker Benefits

As a speaker, you will receive a Free Access -pass to the Qt World Summit. This is a great opportunity to spread your mindshare and have a community of industry leaders and important software developers hear your message. We will be recording the presentations; speaking at the Qt World Summit will give you an audience that goes beyond the crowd attending your presentation in Berlin. The material from your talk will also be made available to all of the attendees after the event.

We will share your contact and professional details on the Qt World Summit web pages, giving you a large platform to network with anyone interested in your expertise and/or offering.

Submit Your Talk Today!

https://www.surveymonkey.com/r/QtWS17

For more information of if you have any questions, please contact qtws@qt.io.

The post Qt World Summit 2017 Call for Presentations appeared first on Qt Blog.

We recently added a new toy to The Qt Project, and I wanted to give an overview on what it is and how it can be used.

Grafana showing results of running benchmarks

Grafana showing results of running benchmarks

qmlbench testing

The new toy is automated performance testing, and the background (long story short) is that in order to avoid regressions in performance, automated testing is required. This is no different from avoiding regressions in functionality, and it may sound obvious. But while we have many benchmarks in Qt, we have unfortunately only been running them manually, and, as a result, regressions have snuck into the released product from time to time.

This year, The Qt Company decided to invest into fixing the problem, and I was given the task to set up performance testing of Qt Quick and the scene graph. The plan is to add benchmarks for all areas of Qt to the same system, but in order to get the infrastructure in place first, we decided to use Qt Quick as the pilot project.

I decided to go with the tool that Robin Burchell and Gunnar Sletta wrote for this, recently contributed to The Qt Project: qmlbench.

The tool is designed to measure the performance of Qt Quick primitives and functionality, and it has a suite of QML files that are intended for automated testing.

To be able to see how performance evolves over time and to detect even smaller regressions, we decided to go with a graph approach that we manually monitor for changes. While we are still working to reduce it as much as possible, there will always be a bit of noise and fluctuation in the benchmarks, due to the hardware and operating systems themselves not being 100% predictable.

The resulting graphs can be seen in testresults.qt.io.

And the news are good: Qt 5.9 is a great improvement on Qt 5.6 (I expect around 15% on average when it is released) and the tool has already detected performance regressions which we have subsequently fixed. Lets go into some more detail.

How to use the UI

When you first look at the page linked above, there will be a lot of information at once, but luckily it is easy to change the view to only show what you are interested in.

Say for instance that I only want to see the results of a single benchmark, e.g. “changing_over_isolated_with_clip_rotated”. I can do that by using the “benchmark” selector in the top left corner.

select benchmark

In the same row, you can also select which machine you want to see results for. The currently available ones are “eskil_linux_foucault”, which is a Ubuntu desktop machine with an NVIDIA Quadro graphics card, and “eskil_linux_tx1” which is an arm-based NVIDIA Jetson TX1, also running Ubuntu.

In the view of the graphs themselves, you can turn on and off data sources by clicking on the labels (hold shift to select multiple). By default, you will see the benchmark results and the coefficient of variation for each branch. On desktop, it is currently running for 5.6, 5.8, 5.9, dev and v5.8.0. The last one is there as a control, to be able to exclude changes to qmlbench itself as well as OS and hardware related issues. On the TX1, we are only running for 5.6 and 5.9 at the moment, given the time it takes for a single test run on that hardware.

selectsources

In the screenshot above, I have disabled everything except the 5.6 and 5.9 benchmark results.

Finally: In the top right corner, you can select the time resolution of the current view. You can also zoom in on an area of a graph by clicking and dragging over the area. All the different tables and graphs will adapt automatically to the currently selected time interval.

This was just a very quick overview of Grafana. Consult the full documentation for more information.

How to use the graphs

The main way to use the graphs is to monitor them and look for changes that persist over time. Note that higher is better for these benchmarks, as they are counting how many frames can be drawn during a predefined time period (20 seconds) for a predefined test size. There is also a table that shows the median in the current interval, for an easy way to compare branches and detect regressions/improvements.

Also note that the rendering caps at 60 fps, so the maximum result we can get is 1200 frames per 20 seconds. So graphs will cap at this level and we will not get much useful information from them before we increase the complexity of the scenes they are rendering.

In addition to the performance data, you also have access to the “coefficient of variation” for each test run. The scale of the CoV is on the right side of the graph view. When running the benchmark, we will do five runs in sequence and report the average of this to the database. This is to avoid always running on cold data and it decreases the fluctuations in the graphs. The CoV is based on the standard deviation of these datasets of five results. It can give you an idea of the stability of the test results, though there are some very stable test that still report a high CoV, such as the “sum10k.qml” test. For some reason which we have yet to figure out, the first run will always be around 230 frames on that particular machine and then all the subsequent runs will be 440. So the average is stable, but the CoV is through the roof. Since this is not reproducible anywhere else, Robin suggested the machine is haunted, which is so far our best guess.

If you look at each of the graphs, you will see that for most of them the “5.9” line is above the “5.6” line, which is good, since it means performance is improving. On average, I expect that Qt 5.9 will give approximately 15% better performance than Qt 5.6. If you look specifically at any of the layout tests, you will see that you can get around 50% performance improvement on your Qt Quick layouts just by upgrading to Qt 5.9 from Qt 5.6.

Graphs showing 53% performance improvement on creation of column layouts.

Graphs showing 53% performance improvement on creation of column layouts in Qt 5.9 compared to Qt 5.6.

The main objective of having this tool, however, is to detect and fix regressions, and there was one test that worried us: the “changing_over_isolated_with_clip_rotated” test case.

This test verifies that we can isolate a subtree in the scene graph by using a clip node even if the clip is rotated, so that it is put into its own batch in the renderer. Thus changing it does not affect the other parts of the scene graph. If you look at the graph in Grafana, you will see that until very recently, we had a significant regression in that area. On April 25th, the regression was fixed, so it will never be released to users.

changing_over_isolated_with_clip_rotated

Now, if I saw this graph and wanted to find out what happened, there is another helpful tool which I haven’t yet talked about. You can enable it by checking the “annotations” checkbox on the top of the page. This will show, as events in the graphs, the SHA1s for the different modules we are testing at any given time. Note that this is still a bit of a work in progress: To avoid cluttering the graphs too much, we are only reporting the SHA1s for the eskil_linux_foucault machine. If there are several events at the same time, you will also have to zoom in a bit to be able to separate them. So the UI isn’t perfect, but it works when you need to dig for information.

If I do zoom in on the first result where performance has been improved, I will see that one of the updates was to Qt Declarative. I can hover over the event to see the SHA1 of the update.

annotation

By going to the git repository, I can easily find the diff between the two commits listed. If I do, I will see that one of them is Fix a performance regression noted by qmlbench by Robin Burchell.

So the system is working. If regressions pop up while the tool is running, we will be able to find the offending commit just as easily.

The future

What’s next you ask? We will of course continue to improve the qmlbench test set as well as the tool itself. We may also add more platforms to the farm when the need arises.

In addition, there are several other people in The Qt Company who are working on getting benchmarks for other parts of Qt into the same system. In the time to come, we will get unit benchmarks for different parts of Qt, startup time measurements, Qt Creator performance testing, QML engine testing, etc. into the same system. Look for updates here and on the main benchmark home page.

The post Performance regression testing of Qt Quick appeared first on Qt Blog.

Este mes de abril suele un ser en el que la Wikipedia pone un banner, cada año más grande, pidiendo ayuda financiera para que su extraordinario proyecto siga funcionando (¡donad, malditos donad!). Evidentemente, este sistema es tan válido como otro cualquiera y, en mi caso, efectivo. Y creo que este hecho fue el origen de una pregunta aparecida en el grupo de Telegram de “KDE-Cañas y bravas” y que me ha inspirado al realizar el presente artículo “3 formas de colaborar económicamente con KDE”, una de las más sencillas para aquellas personas que no tienen tiempo o creen que no tienen habilidad para hacer otro tipo de colaboración.

3 formas de colaborar económicamente con KDE

Donaciones directas

A lo largo de todo el año, la Comunidad KDE está abierta a recibir donaciones de cualquier cantidad. Para ello se puede ver en la página principal kde.org, en su pie de página, un pequeño campo numérico donde se envían las donaciones vía Paypal, una de las formas más extendidas de realizar pagos en la red.

Si no se desea realizar donaciones vía Paypal, tenéis que saber que también se puede realizar transferencias bancarias o cheques nominativos, aunque la misma página de “otras formas de realizar donaciones” de KDE nos alertan sobre los posibles recargos debidos a leyes internacionales.

Join the game

El segundo modelo viene siendo algo más “oficial” ya que se trata en participar en “Join the game” una suerte de mecenazgo con el que os comprometéis a convertiros en un miembro de apoyo de KDE por solo 100 € al año.

De esta forma, la Comunidad KDE se asegura unos ingresos mínimos garantizados provenientes de personas que demuestran de esta forma su compromiso con el proyecto. Además, creo que se recibe una plaquita que inmortaliza la pertenencia al programa. Si queréis más información os invito a leer el artículo que dediqué a Join the game en el 2011.

 

Fundraising

La tercera forma es una especial que se suele realizar a finales de año. Se trata de la recaudación “KDE End of Year Fundraising” con el que se anima a la gente a aportar económica de forma especial aprovechando el final de año y con el añadido de que según la cuantía aportada se les manda un detalle, el cual suele ser unas postales especiales de la Comunidad KDE como la que vemos en la imagen inferior.

Recaudación de fondos KDE fin de año 2014

En la página de la recaudación del año pasado se puede encontrar tanto lo que se consiguió en el 2016, una breve explicación de cómo se reparte este dinero y la lista de los contribuyentes.

Transparencia económica

En aras de aportar mayor seguridad de que este dinero no se invierte en cosas que no tocarían, en cada edición del boletín KDE e.V. Community Report (como en este del 2015) se realiza un resumen tanto de los ingresos como de los gastos. Y estoy seguro que si se solicita una versión ampliada de los mismos, el tesorero de la Junta Directiva no tendría muchos problemas para ofrecerla.

April 26, 2017

So after a long hiatus I chose the Plasma QuickShare applet (which is sort of the Plasma5 replacement for the old Pastebin Plasmoid) as my point of re-entry into KDE code work. There was after all a deal of itches there I wanted scratched. It’s been quite a bit of fun figuring out the various interesting frameworks QuickShare is connected to at the backend. Anyways, some days ago I got a rudimentary Nextcloud plugin past review and pushed it, which should mean it’ll soon be coming to a 5.10-powered desktop near you :)

  • Let’s you upload files/text snippets/clipboard data onto your Nextcloud directly from your Plasma Desktop!
  • Uploads to the root folder by default “/”, but it’s possible to specify another folder by typing.
  • Supports all types of files/contents that the QuickShare applet currently supports, though raw clipboard data (like image data) don’t work too well because it doesn’t get the right file extension on server.
  • Automatically appends numbers to the filename to avoid overwriting an identically named file in the target location

It uses the KAccounts framework so you’ll need to create an ‘owncloud’ account in the “Online Accounts” settings module in order to use it (you can click the button on the applet to open the settings module). So far it’s been tested to work with a Nextcloud 11 instance, though it’s mostly WebDAV so it should work for previous versions as well.

Uploaded items should be private by default for now as it does not create shares out of them. This is probably what I’ll look into working on next.

If you’re not familiar with QuickShare, it’s a Plasma Applet that sits on your desktop and lets you share/move a file, or multiple files, or arbitrary clipboard contents, to various places (eg Pastebin, your mobile device via KDE Connect, Imgur, Youtube – and now Nextcloud!). You could either drag and drop the items you want shared onto the applet, or you could copy and paste.

Apart from fixing some crash situations and HiDPI hijinks with the applet, I also improved QuickShare’s keyboard navigation support, so it should be overall more friendly come 5.10. Notably, the keyboard shortcut setting actually does activate the plasmoid now, and the plugin list is now navigable with keyboard arrow keys.

To share a file from Dolphin, say, it is now possible to, with the file selected on Dolphin, ctrl+c, hit QuickShare’s keyboard shortcut binding to show the share plugin list, choose one with the keyboard arrow keys, and select by hitting enter.

1486
Rate this post
Thanks!
An error occurred!

In KDE neon‘s constant quest of raising the quality bar of KDE software and neon itself, I added a new tool to our set of quality assurance tools. CMake Package QA is meant to ensure that find_package() calls on CMake packages provided by config files (e.g. FooConfig.cmake files) do actually work.

The way this works is fairly simple. For just about every bit of KDE software we have packaged, we install the individual deb packages including dependencies one after the other and run a dummy CMakeLists.txt on any *Config.cmake file in that package.

As an example, we have libkproperty3-dev as a deb package. It contains KPropertyWidgetsConfig.cmake. We install the package and its dependencies, construct a dummy file, and run cmake on it during our cmake linting.

cmake_minimum_required(VERSION 3.0)
find_package(KPropertyWidgets REQUIRED)

This tests that running KPropertyWidgetsConfig.cmake works, ensuring that the cmake code itself is valid (bad syntax, missing includes, what have you…) and that our package is sound and including all dependencies it needs (to for example meet find_dependency macro calls).

As it turns out libkproperty3-dev is of insufficient quality. What a shame.

Idea and concept

See the previous blog post LibreOffice the better Office.

Have a look

Test it!

Download

  • dev-builds.libreoffice.org/daily/master/

Configure

  • LO Writer -> Tools -> Options -> Advanced: Enable experimental features
  • View -> Toolbar Layout -> enable Notebookbar
  • View -> Notebookbar -> enable Groupedbar Full

Open Bugs

  • Icon size: The layout follow the settings in Tools -> Options -> View -> Notebookbar icon size style in general but a view icons are (for now) fixed size so change the Notebookbar icon size to Large TDF#107259
  • Background color: it is possible to theme the toolbar with a firefox theme Tools -> Options -> Personalization -> Select Theme -> https://addons.mozilla.org/de/firefox/addon/libreoffice-groupbar-full/ In the future background theming should be possible to. TDF#107128
  • Different sizes: The toolbar is defined for 1400 to 1700 px in width in the future it will be possible to make the toolbar available for width. We love google summer of code

Feedback

There are way more issues, bugs, missing features, please comment, make a bug report or report to the Contextual Group Toolbar bug TDF#106035


April 25, 2017

Once 1.5.0 was release I thought the next release would be a small one, it started with a bunch of bug fixes, Simon Wilper made a contribution to Utils::Sql, basically when things get out to production you find bugs, so there were tons of fixes to WSGI module.

Then TechEmpower benchmarks first preview for round 14 came out, Cutelyst performance was great, so I was planning to release 1.6.0 as it was but second preview fixed a bug that Cutelyst results were scaled up, so our performance was worse than on round 13, and that didn’t make sense since now it had jemalloc and a few other improvements.

Actually the results on the 40+HT core server were close to the one I did locally with a single thread.

Looking at the machine state it was clear that only a few (9) workers were running at the same time, I then decided to create an experimental connection balancer for threads. Basically the main thread accepts incoming connections and evenly pass them to each thread, this of course puts a new bottleneck on the main thread. Once the code was ready which end up improving other parts of WSGI I became aware of SO_REUSEPORT.

The socket option reuse port is available on Linux >3.9, and different from BSD it implements a simple load balancer. This obsoleted my thread balancer but it still useful on !Linux. This option is also nicer since it works for process as well.

With 80 cores there’s still the chance that the OS scheduler put most of your threads on the same cores, and maybe even move them when under load. So an option for setting a CPU affinity was also added, this allows for each work be pinned to one or more cores evenly. It uses the same logic as uwsgi.

Now that WSGI module supported all these features preview 3 of benchmarks came out and the results where still terrible… further investigation revealed that a variable supposed to be set with CPU core count was set to 8 instead of 80. I’m sure all this work did improve performance for servers with a lots of cores so in the end the wrong interpretation was good after all ��

Preview 4 came out and we are back to the top, I’ll do another post once it’s final.

Code name “to infinity and beyond” came to head due scalability options it got ��

Last but not least I did my best to get rid of doxygen missing documentation warnings.

Have fun https://github.com/cutelyst/cutelyst/archive/v1.6.0.tar.gz


April 24, 2017

Since we recently wired up the KDE release tool releaseme with KDE neon’s git-build technology I had the opportunity to spend some quality time on the code and managed to sneak in a load of both quality and speed improvements as well as some new features.

CI States

For quite a while I’ve been considering to pull CI data into releaseme. It makes all sorts of sense. You want to release high-quality software, so whenever possible you’d want to make sure CI is green. But to do that you’d have to open a browser, navigate to build.kde.org, and find the right jobs. Yet, there is absolutely no reason why a human would have to do that. So now releaseme does it for you before getting started on assembling the sources.

Help

Unfortunately, the release process itself is often a bit convoluted and it is not clear what to do once you have a tarball. To help people with publishing their new tarball releaseme will now print a handy help suggesting common steps to take once you have a tarball. It also points to the relevant location for publishing tarballs on KDE infrastructure and even gives you a handy link with a sysadmin ticket template to quickly file a publishing request.

Git Builds

Aleix Pol worked on adding a cool new feature to the extra-cmake-modules frameworks, enabling everyone who builds from git to fetch translations as well. This is currently slated to release with KDE Frameworks 5.34. Once landed you’ll be able to run make fetch-translations with just about any git clone of KDE software and grab the latest translations into your build directory.

QZXing is a very useful library: It provides an easy to use Qt integration API around the barcode scanning library ZXing (zebras crossing).

Because it is so easy to setup QZXing in a Qt application, we and most of our customers end up using it when they need to scan images for barcodes. There is, or rather was, a big problem though: When you want to analyze a live camera video stream, e.g. from a phone camera, the latency can …

The post Efficient barcode scanning with QZXing appeared first on KDAB.

April 23, 2017

One of the best things about making software collaboratively is the translations.  Sure I could make a UML diagramming tool or whatever all by my own but it’s better if I let lots of other people help out and one of the best crowd-sourcing features of open community development is you get translated into many popular and obscure languages which it would cost a fortune to pay some company to do.

When KDE was monolithic is shipping translation files in separate kde-l10n tars so users would only have to install the tar for their languages and not waste disk space on all the other languages.  This didn’t work great because it’s faffy for people to work out they need to install it and it doesn’t help with all the other software on their system.  In Ubuntu we did something similar where we extracted all the translations and put them into translation packages, doing it at the distro level makes more sense than at the collection-of-things-that-KDE-ships level but still has problems when you install updated software.  So KDE has been moving to just shipping the translations along with the individual application or library which makes sense and it’s not like the disk space from the unused languages is excessive.

So when KDE neon came along we had translations for KDE frameworks and KDE Plasma straight away because those are included in the tars.  But KDE Applications still made kde-l10n tars which are separate and we quietly ignored them in the hope something better would come along, which pleasingly it now has.  KDE Applications 17.04 now ships translations in the tars for stuff which uses Frameworks 5 (i.e. the stuff we care about in neon). So KDE neon User Editions now include translations for KDE Applications too.  Not only that but Harald has done his genius and turned the releaseme tool into a library so KDE neon’s builder can use it to extract the same translation files into the developer edition packages so translators can easily try out the Git master versions of apps to see what translations look missing or broken.  There’s even an x-test language which makes xxTextxx strings so app developers can use it to check if any strings are untranslated in their applications.

The old kde-l10n packages in the Ubuntu archive would have some file clashes with the in-tar translations which would often break installs in non-English languages (I got complaints about this but not too many which makes me wonder if KDE neon attracts the sort of person who just uses their computer in English).  So I’ve built dummy empty kde-l10n packages so you can now install these without clashing files.

Still plenty to do.  docs aren’t in the Developer Edition builds.  And System Settings needs some code to make a UI for installing locales and languages of the base system, currently that needs done by hand if it’s not done at install time  (apt install language-pack-es).  But at last another important part of KDE’s software is now handled directly by KDE rather than hoping a third party will do the right thing and trying them out is pleasingly trivial.

 

 

 

Facebooktwittergoogle_pluslinkedinby feather

Back in February the fifteenth SUSE Hack Week took place. As always this was a week of free hacking, to learn, to innovate, to collaborate, and to have a lot of fun. I didn't have the full time, so I worked on a couple of small things and a few projects I maintain. I did want to summarize that, so here you go.

The first project remained unfinished. I wanted to fill out Tim Urban's Life Calendar (you might have seen that on his excellent blog "Wait But Why"), but realized that it's not trivial to map dates to weeks in your life. So I wrote a small tool to calculate that, stopped after I had a failing test and had a rough feeling for how to put the dots on the life calendar.

The second project was something I always wanted to do, implement Conway's Game of Life. I had once started an implementation in 68000 assembler on the Amiga many years ago, but never finished it. Technology has advanced, so I decided to do at as ASCII pixel art. Who needs high resolution? The result turned out to be a bit more generic, as a command line tool to manipulate pixel matrices stored in text files, the Pixelist. While I was at it, I also implemented Langton's Ant and a simulation of diffusion limited aggregation.

GivenFilesystem is a Ruby gem I maintain for writing unit tests dealing with files on disk. It's quite convenient, if you test code, which writes files on disk and you want to have a well-defined environment without side effects for testing this code. There were some open pull requests. I reviewed and merged them and released given_filesystem 0.2.0.

I already wrote about Inqlude, where I used Hack Week to finally publish the new Inqlude web site, which is based on the work Nanduni did during last year's Google Summer of Code. It's a great improvement. I also did some cleanup work, including reviewing the open issues. So we have a nice roadmap now. There is some interesting work to do. People who want to help with that are always welcome.

Trollolo is another side project I work on from time to time. We use it for supporting our Scrum work flows at SUSE in Trello, such as generating burndown charts. I didn't get around to write code, but I consolidated some of the ideas floating around and put them into issues. This also is a nice opportunity, if you want to have some fun with writing a bit of Ruby code for a small project. Issues are up for takers.

Finally I worked a bit on the next iteration of my attempt to make git support multiple authors. This would make life with git in a pair programming situation much nicer. Based on the feedback I got on my first iteration and at the Git Merge conference, I started to work on a version which puts the data into the trailers of the commit messages. This is less intrusive and with a bit of tooling it achieves similar results as the version which worked directly on the commit headers. I have something working, but it needs a rework of the trailer handling code. I'll continue to work on that when I find some more time to do that.

April 21, 2017

We were just a bunch of nice-looking guys and girls :) hanging wifi routers over the windows and trying not being intimidated by an unceasing rain when we had the Brazilian KDE Summit (Akademy-BR) in Praia do Forte (BA) back in 2010. This was somehow the birth of LaKademy (Latin-American KDE Summit), started in 2012 and now having its fifth edition taking place in Belo Horizonte (Minas Gerais) from 29th April to 1st May.

LaKademy is an effort to promote the culture of FLOSS, hacking sessions, and collaborative work inside the Latin-American KDE community. It is also a way to let people know about the Brazilian/Latin-American KDE community, the sort of work we usually do, and how newcomers can start their journeys into the free software world. And, of course, is the place to strengthen relationships, make new friends, and let people fall in love about such an amazing FLOSS community <3.

Sixteen contributors will attend LaKademy 2017, interested in contributions to translation, promo, artwork, Atelier, Umbrello, KDE-Edu, Dolphin, KDE Games, KDevelop, and Kdenlive. The traditional LaKademy promo meeting will happen on 30th morning, where we make a retrospect of 2016 actions and start thinking about what we want to do for 2017/2018.

See you in Belo Horizonte and stay tuned for LaKademy 2017 news and photos :)

butterfly

The spring has arrived, so we took our brooms and swept the bugs from under the carpets and out of the door.

We meticulously noted down all the classes, orders, families, species, and other details of what we found and removed, which you can look up in our spring cleaning log.

Get Qt Creator 4.2.2

The opensource version is available on the Qt download page, and you find commercially licensed packages on the Qt Account Portal. Qt Creator 4.2.2 is also available through an update in the online installer. Please post issues in our bug tracker. You can also find us on IRC on #qt-creator on chat.freenode.net, and on the Qt Creator mailing list.

The post Qt Creator 4.2.2 released appeared first on Qt Blog.

It is five days left until foss-north 2017, so it is high time to get your ticket! Please notice that tickets can be bought all the way until the night of the 25th (Tuesday), but catering is only included is you get your ticket on the 24th (Monday), so help a poor organizer and get your tickets as soon as possible!

And just to reiterate what’s on the menu. This is a full day conference with two tracks and many interesting speakers from many projects, including Debian, Wikimedia, KDE, systemd, PulseAudio, Nextcloud, PostgreSQL, OpenRISC, flatpak, AsteroidOS and more.

Last year, over 30% of the tickets was sold in the last 48h. This year, we cannot provide catering for the ones buying tickets the last 24h, so hopefully the peak will come earlier. For now, we have 93 persons on the visiting list, but there are chairs for 100 more!

We release 17.04 with a redesigned profile selection dialog to make it easier to set screen size, framerate, and other parameters of your film. Now you can also play your video directly from the notification when rendering is finished. Some crashes that happened when moving clips around on the timeline have been corrected, and the DVD Wizard has been improved.

Please note that while this major release may seem to have few features development is at full throttle in the refactoring branch. You can monitor the progress here.

Since we missed by a whisker getting updated PIM (kontact, kmail, akregator, kgpg etc..) into Zesty for release day, and we believe it is important that our users have access to this significant update, packages are now available for testers in the Kubuntu backports landing ppa.

While we believe these packages should be relatively issue-free, please bear in mind that they have not been tested as comprehensively as those in the main ubuntu archive.

Testers should be prepared to troubleshoot and hopefully report issues that may occur. Please provide feedback on our mailing list [1], IRC [2], or optionally via social media.

After a period of testing and verification, we hope to move this update to the main backports ppa.

You should have some command line knowledge before testing.
Reading about how to use ppa purge is also advisable.

How to test KDE PIM 16.12.3 for Zesty:

Testing packages are currently in the Kubuntu Backports Landing PPA.

sudo add-apt-repository ppa:kubuntu-ppa/backports-landing
sudo apt-get update
sudo apt-get dist-upgrade

1. Kubuntu-devel mailing list: https://lists.ubuntu.com/mailman/listinfo/kubuntu-devel
2. Kubuntu IRC channels: #kubuntu & #kubuntu-devel on irc.freenode.net

April 20, 2017

Today KDE Applications 17.04 was released.

It includes Okular 1.1, it contains a nice set of features:
* Add annotation resize functionality
* Add support for auto-calculation of form contents via JavaScript
* Allow to rotate the page view using two-finger pinches on a touchscreen
* Change pages in presentation mode by swiping on touch screen
* Added support for Links that change the Optional Content visibility status
* Allow to disable automatic search while typing
* Allow to create bookmarks from the Table Of Contents

This release was brought to you by Albert Astals Cid, Oliver Sander, Luigi Toscano, Martin T. H. Sandsmark, Tobias Deiminger, Antonio Rojas, Burkhard Lück, Christoph Feck, Elvis Angelaccio, Gilbert Assaf, Heiko Becker, Hrvoje Senjan, Marco Scarpetta, Miklós Máté, Pino Toscano, Yuri Chornoivan.

April 18, 2017

First I would like to answer a few questions that I had on my latest entry:

1 – KActionRunner is *not* a unified-menu, and it does not tries to be. It shouldn’t be used to display the menu of the application in a unified way.

2 – Somebody told me that this looked like the Eclipse “Quick Access” feature, and that’s exactly what this is.

Changes in the code currently on my machine, *not merged yet*:

  • Enabled in every K-App that uses KXmlGui
  • ctrl + alt + space triggers the Action Runner
  • Search for the action you wanna trigger
  • Trigger it.

Obligatory Screenshoot running on KDevelop:

I certainly need to iron out a few things before trying to merge this, so I’m not doing a review again this soon (my older review was shut down pretty fast ��

  • Prettier delegate displaying more information about the Action
  • Display the list of actions when you type (currently it completes inline)
  • don’t crash on exit

I’m using it on all my KDE applications locally and this is starting to behave the way I want.

 

This is a guest post by 2016 Qt Champion Ben Lau.

Ben has a long history with Qt, and many interesting projects on GitHub.

Here’s an idea from him on making multithreading simpler in some cases.

The Basics

Multithreading programming may not be difficult at the first glance. You have to pay attention to your shared data to avoid race conditions/deadlocks. So you learn mutex and semaphore and do it carefully. The result works perfectly on your machine.

But one day, your program hangs. You spend an hour to trace out the problem and find out the order of code execution is not same as your expectation. So you add a few mode condition checking and fix the problem.

After a few week of development, the program is getting more complicated. And it begins to crash randomly. This time even after a day you still can’t figure out what is wrong and admit that it is totally out of control.

Does that sound like a familiar story? It is not rare to find complaints about random crashes/hangs due to misuse of a thread. Is it really difficult to write multithreaded programs?

The answer is yes and no. It depends on your software requirement and architecture.

In this article, it is going to introduce a lock-free multithreaded programming method by using QtConcurrent and AsyncFuture. These make multithreaded programming easier.

Let’s take an example. The code below shows an asynchronous ImageReader class. The readImageWorker function will be executed on another thread that won’t block the UI. QFuture represents the result of computation and reports the status change.

class ImageReader : public QObject {
public:
    QFuture<QImage> read(const QString& fileName);
};

QFuture<QImage> ImageReader::read(const QString &fileName)
{
    auto readImageWorker = [](const QString &fileName) {
        QImage image;
        image.load(fileName);
        return image;
    };
    return QtConcurrent::run(readImageWorker, fileName);
}

Example of use

ImageReader reader;

QFuture future = reader.read(INPUT);

QFutureWatcher *watcher = new QFutureWatcher();

connect(watcher, &QFutureWatcher::finished,
 [=]() {
 setImage(future.result());
 });

watcher->setFuture(future);

Multithreaded programming with QtConcurrent is pretty easy. It just takes an input, then produce an output later. QtConcurrent handles all of the low-level threading primitives.

But it is limited to the condition that the concurrent function does not access shared data with other threads. If that happens, it may still need a lock in order to maintain a critical session. That will fall back to the old traditional way.

Make it support Image caching

The above example is quite an ideal case. And of course, a real world problem is usually not that simple. Let’s change the requirement – Make it support image caching.

QFuture ImageReader::read(const QString &fileName)
 {
 auto readImageWorker = [](const QString &fileName) {
 QImage image;
 image.load(fileName);
 return image;
 };

QFuture future = QtConcurrent::run(readImageWorker, fileName);

QFutureWatcher *watcher = new QFutureWatcher(this);

auto updateCache = [=]() {
 m_cache[fileName] = future.result();
 watcher->deleteLater();
 };

connect(watcher, &QFutureWatcher::finished, updateCache);
 watcher->setFuture(future);
 return future;
 }

The class declaration:

class ImageReader : public QObject {
 public:
 bool isCached(const QString& fileName) const;
 QImage readCache(const QString& fileName) const;
 QFuture read(const QString& fileName);
 private:
 QMap<QString,QImage> m_cache;
 };
 bool ImageReader::isCached(const QString &fileName) const
 {
 return m_cache.contains(fileName);
 }

QImage ImageReader::readCache(const QString &fileName) const
 {
 return m_cache[fileName];
 }

Before getting an image, you have to query is the cache available:

if (reader.isCached(INPUT)) {
 setImage(reader.readCache(INPUT));
 return;
 }
 QFuture future = reader.read(INPUT);

This solution works, but the API is not ideal. Because it would violate the “Tell, don’t ask” principle. The best way is to combine readCache() and read() into a single function that always returns a QFuture object. But there is a problem, QFuture/QtConcurrent can only obtain a result from a thread. It is quite odd to start a thread but the data is already available. To get rid of this problem, we need a 3rd party library.

AsyncFuture

AsyncFuture is a C++ library that could converts a signal into a QFuture type and uses it like a Promise object in Javascript. It provides a unified interface for asynchronous and concurrent tasks. The library only contains a single header file, so that it is very easy to bundle in your source tree. Or you may install it by qpm.

Project Site:
https://github.com/benlau/asyncfuture

Let’s rewrite the above function with AsyncFuture:

QFuture ImageReader::read(const QString &fileName)
 {
 if (m_cache.contains(fileName)) {
 // Cache hit. Return an already finished QFuture object with the image
 auto defer = AsyncFuture::deferred();
 defer.complete(m_cache[fileName]);
 return defer.future();
 }

if (m_futures.contains(fileName)) {
 // It is loading. Return the running QFuture
 return m_futures[fileName];
 }

auto readImageWorker = [](const QString &fileName) {
 QImage image;
 image.load(fileName);
 return image;
 };

auto updateCache = [=](QImage result) {
 m_cache[fileName] = result;
 m_futures.remove(fileName);
 return result;
 };

QFuture future = AsyncFuture::observe(QtConcurrent::run(readImageWorker, fileName)).context(this, updateCache).future();
 m_futures[fileName] = future;
 return future;
 }

This time it is almost perfect. The deferred object provides an interface to complete/cancel a QFuture manually. That could replace readCache() by returning an already finished future object.

Moreover, it has added a new feature to avoid duplicated image reading. In case you have made requests to load the same image twice before it is cached, the original design would start two threads which are totally wasting CPU power. This version solves it by keeping all the running future in a future pool and return that future for duplicated read.

Make the example more complicated

Currently the example is very simple. Let’s try to make it more complicated.

Requirements:

  1. Add a readScaled(fileName, size) function that returns an image which is scaled to specific size
  2. Code reuse is a must
  3. The scaling must be done in another thread to emulate a high CPU usage function
  4. Load cached image if available
  5. But scaled image do not need to keep in cache

The most optimistic solution is to make use of the result of read() directly. That mean you have to create a thread that depends on the result of another thread. That is a bit hard to get it works with only QtConcurrent and probably it needs to use a lock. But it can be easy to be done with AsyncFuture’s future chaining feature.

QFuture ImageReader::readScaled(const QString &fileName, const QSize &size)
 {
 auto scaleImageWorker = [=](QImage input) {
 return input.scaled(size);
 };
 auto callback = [=](QImage result) {
 return QtConcurrent::run(scaleImageWorker, result);
 };
 QFuture input = read(fileName);
 QFuture output = AsyncFuture::observe(input).context(this, callback).future();
 return output;
 }

First of all, it calls read() function to obtain an image from QFuture. It doesn’t care about the caching mechanism as it is already handled by the read() function.

Then it creates a new future object to represent the whole work flow of the chain:

QFuture output = AsyncFuture::observe(input).context(this, callback).future();
                                                                     ^^^^^^^^^

A chain begins with a observe() function, then followed by an observer function to bind the callback to the observed future, and that will create a new future object to represent the result of the callback.

auto callback = [=](QImage result) {
 return QtConcurrent::run(scaleImageWorker, result);
 };

You may wonder if it is alright to run another worker function within the callback function. In fact, this is a feature of AsyncFuture. It provides a chainable API that works like a Promise object in JavaScript. If the callback returns a QFuture object, it will be added to the chain. Then the final output future will depend on the returned future. Therefore, the output future is in fact represents the result of read() , callback() and scaleImageWorker(). The flow could be visualised by this diagram:

sequence-diagram_promises

Diagram: The workflow of readScaled() – it shows how it uses a single QFuture to represent the result of a multiple steps task.

Conclusion

Using QtConcurrent without sharing data between threads could make multithreaed programming easier because it doesn’t need to manage an access lock. But real world problems are usually more complicated. A task may not be able to complete without interaction from other threads. In this case, it may still need an access lock to protect critical session. But once you have used it, it will fall back to the old traditional way, and probably it may get the same problem mentioned at the beginning.

In this article an alternative solution is presented: Use Concurrent API together with asynchronous callback then chain them into a sequence by a promise like API. It works by breaking down a task into multiple steps. Whanever a concurrent function seeks for extra information from another thread, it should just terminate itself and pass the control back to the main thread. So that it doesn’t need an access lock that may raise issues like deadlocks and race conditions.

The whole workflow could be represented by a QFuture object, a unified interface for all kind of asynchronous workflow.

However, this doesn’t mean we get rid of locks completely. They are still necessary for some scenarios. So choose your solution case by case.

The post Multithreaded Programming with Future & Promise appeared first on Qt Blog.

In a previous blog post we introduced clazy, a clang plugin which makes the compiler understand Qt semantics, allowing you to get compile-time warnings about Qt best practices ranging from unneeded memory allocations to misuse of API, including fix-its for automatic refactoring.

Today we’ll do a round-up and present the checks related to connect statements, Qt containers (including QString) and misc Qt facilities.

Connects

1. old-style-connect

Finds connect() statements still using the old SIGNAL()/SLOT() syntax. The Qt …

The post Uncovering 32 Qt best practices at compile time with clazy appeared first on KDAB.


Older blog entries


Planet KDE is made from the blogs of KDE's contributors. The opinions it contains are those of the contributor. This site is powered by Rawdog and Rawdog RSS. Feed readers can read Planet KDE with RSS, FOAF or OPML.