Friday, July 17, 2020

Build your first 'Qt for MCUs' application


Qt for MCUs is a complete graphics framework and toolkit with everything you need to design, develop, and deploy GUIs on MCUs. Run your application on bare metal or a real-time operating system.

Join this tutorial to learn how to build your first MCU application.

More info: https://www.qt.io/product/develop-software-microcontrollers-mcu


Friday, October 30, 2015

Hello World Qt, hand made from Empty qmake Project

This video show how to create Empty qmake Project in Qt Creator, create .cpp and edit .pro to make a Hello World application.


main.cpp

#include <QApplication>
#include <QPushButton>

int main(int argc, char *argv[]){
    QApplication app(argc, argv);
    QPushButton qPushButton("Hello Qt");
    qPushButton.show();
    return app.exec();
}


You will be reported with error of:
QApplication: No such file or directory
QPushButton: No such file or directory

To fix it: Edit HelloQt.pro to add the code QT+=widgets.
QT+=widgets
SOURCES += \
    main.cpp


libGL error: core dri or dri2 extension not found and failed to load driver: vboxvideo

In case you install QtCreator on Ubuntu under VirtualBox, and QtCreator cannot run caused by:
libGL error: core dri or dri2 extension not found
libGL error: failed to load driver: vboxvideo

Try to close Ubuntu, disable 3D Acceleration of Setting > Display in VirtualBox, and restart Ubuntu again.


Wednesday, October 28, 2015

Chage Qt5 Example of Calendar to set today

The Qt Creator Examples: Qt5 Calendar preset date to 2014 January 1. By default, the date of Calendar is today.

To change the data of Qt Calendar Example, edit qml/main.qml, simple comment the code selectedDate: new Date(2014, 0, 1)




Monday, October 26, 2015

Qt Creator Examples - Qt Quick Controls Gallery


This example project demonstrates the various UI components provided by Qt Quick Controls.

error: qtquickcontrolsapplication.h: No such file or directory

If you try to build Qt Creator Examples and reported error of qtquickcontrolsapplication.h: No such file or directory.

Most probably you install Qt with sudo, the default install location is /opt, a user un-writable location. When you build Qt Creator Examples, you have to copy the project to another user writable location, it break the links and lost the shared directory.

May be you have to un-install Qt. Re-install to another user writable location, or re-install WITHOUT sudo (the default location is your HOME). Such that you need not copy the project when create examples.



How to uninstall Qt

To unstall Qt:

open terminal, go to the installed directory, run MaintenanceTools:

$ ./MaintenanceTool