2 years ago
Well such difficult can be in creation of a screenshot? It would seem — call the function which is kindly provided by an OS and receive the ready picture. For certain many of you did it not once, and, nevertheless, it is impossible to take and zaskrinshotit just like that full-screen directx or opengl the application. To be exact — it is possible, but as a result you receive not a screenshot of this application, but the rectangle which is filled in black.
2 years, 1 month ago
Today's article inspired me to share the method of pronouncement of databases in separate rubs. The method is suitable not only for a DB, but also for any interactions described by a pattern "in a separate flow there lives some object, it is necessary to ask it something and with it to do something". Besides, the method is good the fact that he tries to be tipobezopasny and expanded: any stringly-typed QMetaObject::invokeMethod(), any transfers of results of yanking of object in a flow through signals. Only a direct call of functions, only QFuture!
2 years, 1 month ago
When writing multithreaded applications on Qt many faced that implementation of QtSql strictly one-line. That it is worse, in it there is no uniform method for background execution of request. And if the request big or just long, execution it in the main flow tightly suspends the interface.
What irritates even more, there is no viable implementation of such, apparently, necessary thing anywhere. A maximum which can be found — the pool of connections working quite synchronously. Well, time passes, everything changes.
It is very often necessary to structure models as follows — at one level of model with one structure, and at other level the structure of model changes. For example we will take task in which it is required to display the list of devices, each device has groups of settings, and each group of settings has list of settings of different types. For simplicity we will believe that the device has only name and the list of groups. The group has only name and the list of settings. Setup has only name and type — chekboks, text box or slider.
This pattern has been systematized on the basis of article. Further there is description of pattern, GoF is similar.
The pattern structuring use of difficult models in C ++ with use of QML. Facilitates use of the enclosed lists of models for formation of hierarchical structure. Thus, for use in QML, complexity does not increase.
Use pattern, when:
it is necessary to provide hierarchy of models, in which at the different levels different types of models
I want to share easy way of optimization of the working hours when developing QML applications for Android/iOS/Embedded.
Perhaps, told by me to someone will seem bayan, but so far about such elementary method did not read anywhere.
Problem essence — when developing, debugging or prototyping of any mobile application we as a rule are always held the same stages in any language: editing of code, warm, start. And so indefinitely. In case with mobile development, the stage deploya code can stretch for impressive time — from 2 to 10 minutes during which there is nothing to be engaged in general. Perhaps for someone it and is good, but definitely not for those who appreciates the time. Generally, I think, not only I am vybeshivat by such state of affairs ;-)
The situation is aggravated for native development tools, for example, under Android where to us always, without options it is necessary to recompile Java-code before next run on the device.
Qt at first sight possesses the same problem — everyone new bild the project also deploitsya on the device long time. Here only there is one feature — we after all can write applications not on Qt/C ++, and on pure QML. In this case, if we do not change logic in C ++ parts of application, we need to compile nothing under target platform. So — it would be abruptly simple to update the qml set of application files and to restart application on the device. After all the economy on the 10th time of starts would make not less than an hour!
Well, time is potentiality — sin not to use it. Read under cat that at me it has turned out.
Lately I am engaged in studying of the Morse alphabet by means of this program. But it is expected studying of codes of Cyrillic letters that is irrelevant in modern radio communication (all use the latin alphabet, except our valorous army).
Such situation did not suit me, and the decision to write the program for generation of sound Morse code from some text with setup of speed and possibility of adding of codes dynamically has been made. The solution has turned out rather original and flexible (IMHO, of course). And I have decided to share the program with the public: perhaps, it will be useful to someone or will seem to the interesting.
As the instrument of implementation of idea has been selected With ++ together with Qt.
In brief. Not so long ago on Habré there was article about crossing of AdMob and Qt by implementation of cross-platform library. Here only there was there no opportunity to integrate library with QML application. Recently, having decided to build in AdMob the small new Qt Quick application, I have faced this problem and have implemented small wrapper. But, as I have decided to build in advertizing, also the analytics was necessary for me.
Has rummaged, has found the relevant library for embedding of GAnalytics, has connected, all ok. Has published annex — has started looking for ways of advance. Has understood that it the crushed business and India to the developer will be quite difficult to promote for a long time without good investments.
But suddenly I have come across interesting cross-promoution service — StartAd.mobi. Its essence that in the first month the network free of charge gives you many times more traffic, than is given by you. It became interesting, has implemented also this service in the project to check statistics and to try the luck.
As you understand, integration of each of these solutions has turned small into hell because in the project there were three external dependences with which it is not clear how to manage.
As a result, I have looked at code of the project and have understood that Frankenstein who needs to be refaktorit urgently has started turning out. And if we refaktorit — that we will select all code which is responsible for interaction with suppliers of advertizing and analytics in subproject, we will make its opensorsy, we will write the program interface and we will try to facilitate as much as possible its implementation in any new Qt the project.
The basic that I wanted to reach — to do as little as possible gestures for integration of such functionality into future projects.
2 years, 4 months ago Have sent me as that test task. It is necessary to write chess on Qt with use of C ++ and QML. QML did not study before, only heard and read about it therefore has solved that I will write only with use of C ++ and Qt libraries. Has written, has sent, return and ask graphic part to copy on QML. There is nothing to do, has sat down at studying of this miracle and has copied graphic part. Now I want to share the gained experience.
I will not describe all process of writing of chess, I will describe only process of comprehension of QML. I think this article will be for the aid to beginners in QML.
At solution of different analytical tasks Real-time creation of diagrams where function depends on time can be demanded. In this article I will share the experience solutions of problem of animation of diagrams in Qt, using QCustomPlot.
Now the augmented reality is one of the most interesting directions. Therefore I have also undertaken its studying, and own implementation of cross-platform bezmarkerny augmented reality on Qt became result of it. The speech in this article will go how it has been implemented (or as to implement it most). Under cat it is possible to find demo and the reference to the project on gitkhaba.