C++

Qt signals & slots

Në shqip: Sinjalet dhe slot-et në Qt

ShpjegimiSQ

Në Qt, objektet komunikojnë me „sinjale“ dhe „slot-e“: butoni lëshon sinjalin clicked(), dhe ti e lidh me një funksion (slot) që ekzekutohet. Si ngjarjet në gjuhë të tjera.

EnglishEN

In Qt, objects communicate with “signals” and “slots”: a button emits the clicked() signal, and you connect it to a function (slot) that runs. Like events in other languages.

Si ta mendosh

Si zilja e derës e lidhur me altoparlantin e kuzhinës.

Lexoje në anglisht

Like a doorbell wired to the kitchen speaker.

Shembull kodicpp

QObject::connect(butoni, &QPushButton::clicked, [&] {
    etiketa->setText("U klikua!");
});

Terma të lidhur