SDAA259 January   2026 AM623 , AM625 , AM625-Q1 , AM625SIP , AM62P , AM62P-Q1

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction
  5. 2Detailed Description
    1. 2.1 Launching Qt Creator
    2. 2.2 Running The First Project on PC
    3. 2.3 Creating a Button
      1. 2.3.1 Modifying the Property of a Button
    4. 2.4 Creating a C++ Back-End Component
      1. 2.4.1 Defining the Scope of the Project
      2. 2.4.2 Connecting Your C++ Application to Your QML Application
    5. 2.5 Connecting to the EVM
    6. 2.6 Building and Deploying Your Application For Your Embedded Platform
      1. 2.6.1 Build the Application
      2. 2.6.2 Transfer Executable to the Board
    7. 2.7 Running the Application
  6. 3Summary
  7. 4References

Creating a Button

In Qt QML, a button is created using the Button component, which is part of the QtQuick.Controls module. A component in QML is simply a reusable building block, such as a window, label, button, image, or a custom UI element that is defined.

Components encapsulate both behavior and appearance, making the components simple to use and organize in a UI layout. For custom components, see the following list by QT: The QML Reference | Qt Qml | Qt 6.10.2

 Adding a ButtonFigure 2-9 Adding a Button

The id gives the button a unique reference so the program can refer back to the button. For example, handling signals, checking the state, or modifying the properties.

The text property sets the label that appears on the button.

When a user clicks Run, the following is visible:

 Modified Window with Blink ButtonFigure 2-10 Modified Window with Blink Button

There is now a button within a window called Blink.