Qt Visual Studio Signal Slot

Overview

QT Libraries for Visual Studio and the QT Add-in VisualGDB 4.1 or later We will create a basic QT application using the QT wizard, modify the main window, port the application to Linux and demonstrate the use of the cross-platform API provided by QT by listing files in the current directory.

This program demonstrates how QML and C++ can be connected through Qt signalsand slots. It does this through embedding C++ code as a context property in QMLrather than explicitly connecting signals and slots.

When the program is started, the C++ part send a signal to QML, including aparameter. This signal is only sent once. When the user clicks on the windowarea, a signal is sent from QML to a C++ slot.

Visual

Watch the console output to see if it works.

Installation

Slot

Download Qt For Visual Studio

This program requires a working Qt5 installation. It was tested with version 5.3 and 5.4.

Install qt for visual studio

Qt Visual Studio Tools

In order to compile and run the program, execute the following commands.

Qt Visual Studio Code

Alternatively, the project can be loaded into Qt Creator and started from there.

More Documentation

This source code belongs to an article on our website.