Lovin’ it!

Every night in my dreams, I see you, I feel you…. 😀

Yeah, that has been happening to me since last week. I have had dreams of widgets flying here and there. Well, this is psychological! Though for the time I was in college, we were like we would do it, but deep inside I got tensed since we were stuck at the same point for consecutive 4 days.

Then I took on reading the basic UI part from the book and I am glad I did that. After reading very first few chapters and trying a few tutorials, I got more confidence. I got myself acquainted with the things how they exactly were working. Books are always awesome. And yes, in two days July 9 and 10, we successfully implemented the very basic features in the UI. 😀 These included:

  1. Adding graphics view, which serves as the drawing area for entities
  2. Painting different entities which had static dimensions
  3. Painting entities on mouse clicks by the user in graphics view
  4. Zooming and panning of the graphics view

Though it brought in so much struggle, we were elated on accomplishing the same. Time for correcting a few things, including the dimensions of drawing area and the bounding rectangles particularly. Working on the same! Also had taste of gtk. I did not use IDE and working in vim gave me an innate buddy-buddy feeling (since been on IDE lately).

I am also trying to improve my time management. Studied Permutations and Combinations too today morning.

This UI part is just so awesome! I look at UI design of everything around me. I am lovin’ it. 🙂

"The only way to do great work is to love what you do." ~Steve Jobs

Application Development in Qt

In Qt, basically 5 types of applications can be developed. Depending on your purpose, you choose the one and all the environment for developing the application is provided by the framework. They are namely:

  • Qt Widgets Application
  • <li>Qt Quick Application</li>
    <li>Qt Quick UI Application</li>
    <li>HTML5 Application</li>
    <li>Qt Console Application</li>

In this post, I will be telling you about the first three.

Qt Widgets Application
Widgets form the basic building up entity of a user interface application. Talking in context to any CAD software’s UI, you see a button, a menubar, anything on the user interface, that is a widget. You are able to access the functionalities, the services provided by the software by means of these. These all are widgets.

When you choose to develop this type of application, whatever you do is in C++. This is what the framework provides by default. The thing would be different if you add some QML files in the resources folder of the app. Will be telling you about QML ahead. In this app, we have a UI file by default which is created in design mode of QtCreator. UI files are centred to widget based approach only.

Huh, now coming to the two modes of QtCreator. They are: edit mode and design mode. In edit mode, you do the coding part while in design mode, you have the actual look of the window. You can select any component say a toolbutton or any other component and place it on the window at the place where you want. The associated functionality of the component added in design mode is implemented by means of slots. Well, that is a different concept. Signal-slot mechanism is the soul behind the working of UI apps in Qt. Will be telling some other time.

Just manipulate the code in edit mode and see the components you added in action.

Qt Quick UI Application
This application is developed using the QML(acronym for Qt Modeling Language). It is Javascript based language and centred mainly for user interfaces’ applications. In this type of application, only QML is in action. QML is part of Qt Quick which is a UI-creation kit. You can work in edit mode or design mode here also. Well, working in design mode makes things so easy. The functioning is added in edit mode just like QtWidgets application.

Qt Quick Application
This application is a combination of the previous two. You can have C++ and QML both working in the same project. The rest things are the same as the previous two types of applications.

Well, this was all for someone entirely dummy in application development in Qt, covering some simple things yet important.

And what I see is a book!

Huh! I got my hands a little bit on QML, Qt Meta Language. It is easy to use. Basically it is a language centred for the creation of UIs. The task is to create UI for LCv3 and subsequently for GD CAD.

De novo, I began with exploring demos and examples provided in Qt documentation. Tried a few of them. The very first one making use of concept of states and transitions. It was a simple one. Coming to the UI part, the basic design was prepared and it was not a matter of an hour to see the menu bar and the sub-menus running as a Qt Quick UI application.

Since only the UI, what is visible to the user to be more specific, only bars and buttons was not the concern, the functionality has also to be incorporated for eacch of them. We shifted from Qt Quick UI application to Qt Quick Application. The difference between them being that the latter provides brace for making use of C++ in your application while the former does not. Well, this was all similar. Then reached the functionality part, got stuck at linking QML with C++.

On probing, I was able to use functions created in C++ files of the application in the QML file. Voila! What was needed was exactly the opposite. Never mind, I got something to learn. 😀

Ensuing more exploration and discussions, here I sit just with the root of the application to create UI that would be based on widgets. Things are known but I am not well acquainted to them. I am getting confused at very little things. -_- And what I see is a book that would help me understand things, help me revive them, imprinting in my mind the very basic concepts.

Hits and trials do not take you longer distances. Beginning with foundations of Qt development! Well here I go…