Qt4: Interesting and nice widgets. Part 1

    Qt4 is one of the most popular GUI tools on which you can create anything you want. Each program that uses Qt4 as a graphical interface has a set of custom widgets. Custom - means that the programmer modifies the standard Qt4 class, while creating most often a unique widget. The rules of good programming force developers to create widgets independent of the situation where they are used. Therefore, you can use the once-written class in several programs.

    image

    I bring to your attention some widgets written by me and other members of the Vialinx organization that I used in programs.


    Menu title (made by Liksys and Assuri)


    You may have seen what menu all KDE programs have in the system tray. Pay attention to its title. I once became very interested in this heading and did not understand how it can be implemented. A good friend of mine found the required code in the KDE source code and I created the “Menu” class, in which it is possible to place a similar header. In the screenshots, the headers differ only because of the versions of Qt used by the programs. Download menu sources
    imageimage




    Sidebar of the program (made by Assuri)


    Pay attention to the left side of the program. Widgets that can be located on the panel can be completely different, the main thing is that they are derivatives of the QWidget class. You can also change the position of this panel: top, bottom, left or right. The class has not yet been finalized, but the framework has already been implemented. Download Sidebar Sources
    image




    Settings dialog and button with display and color selection (made by Assuri)


    Almost every serious program has its own settings and their number cannot be fit into the menu, so you have to create a settings dialog. In fact, settings are the least-used part of any program, because when a user sets up a system for himself, he will do it again. At least rarely. But I believe that if a user logs in at least once, then everything should already be beautiful and clear. I like the FireFox settings dialog, because the tabs contain not only text, but also icons, and images, as you know, are faster perceived and remembered than text. At least that's what TurboMilk designers say . I tried to recreate the interface of the FireFox settings dialog on Qt and this is what happened:
    image
    I created the TabsView class, which provides a similar kind of tabs. Of course, there is also work to do here, and I will continue to develop it.

    Download TabsView Sources Download Button Sources
    with Color

    Navigation in QTextBrowser (made by Liksys)


    One of my favorite widgets that allows me to create a set of actions floating on top of a QTextBrowser. Actions can be completely different. But, most often, they are used for navigation. Naturally, it is possible to change the location of the widget, add various actions, etc. Download navigation sources in QTextBrowser In the future I will upload the new widgets I created - this was only the first part. Anyone who wants to lay out their widgets can continue this topic and name their topic in the same way, but with part 2,3,4 ... N.
    image






    PS


    I would like to encourage all GUI developers to create independent widgets so that other developers do not do double work. And also do not think that users will like your program if it has an absolutely not thought out interface, even if it has very useful functionality. They will immediately want to find a replacement for your program. I say this not as a developer, but as an ordinary user who is based on their experience.

    I think that Qt is worthy of having your own personal blog, or at least be part of the toolkit GUI blog. I propose to create a blog "Qt Software".

    Thanks for attention


    Also popular now: