Ciao
Sto provaddo ad utilizzare le Q UI per gestire la mia estensionre ParallelLines.js per QCAD, ho creato il file ParallelLines.ui tramite QT Creator su Linux e prendendo spunti da Cross.ui, ho inserito 2 QPushButton oltre alttri oggetti
Quale evento restituisce il clik su questi pulsanti?
translation
Hello
I'm provaddo to use Q UI to manage my estensionre ParallelLines.js for QCAD, I created the file through ParallelLines.ui QT Creator on Linux and taking cues from Cross.ui, I inserted two QPushButton objects over others it
What event returns clik on these buttons?
What event returns clik on QPushButton?
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
-
- Full Member
- Posts: 81
- Joined: Fri Apr 17, 2015 6:40 am
- Location: http://creativitainformaticart.altervista.org
Re: What event returns clik on QPushButton?
In Qt, you can use signals and slots to easily react to events:
QPushButton button = new QPushButton(parent); button.clicked.connect(function() { print("button clicked"); });You can also connect to a member function:
button.clicked.connect(this, "myMemberFunction");Or to a static or global function:
button.clicked.connect("MyClass.myFunction");
-
- Full Member
- Posts: 81
- Joined: Fri Apr 17, 2015 6:40 am
- Location: http://creativitainformaticart.altervista.org
Re: What event returns clik on QPushButton?
Sono riuscito a fare qualcosa con QPushButton ma ora in modo simile non riesco a rilevare le variazioni di una QComboBox
Allego i file per maggior chiarezza
Translation by Google
I could do something with QPushButton but now similarly can not detect changes in a QComboBox
I attach files for clarity
Allego i file per maggior chiarezza
Translation by Google
I could do something with QPushButton but now similarly can not detect changes in a QComboBox
I attach files for clarity
- Attachments
-
- ParallelLines.ui
- (4.16 KiB) Downloaded 635 times
-
- ParallelLines.js
- (9.71 KiB) Downloaded 619 times
Re: What event returns clik on QPushButton?
Combo boxes trigger signals in the same way as push buttons and other user interface components. Since there are two signals for currentIndexChanged (one with index, one with text as argument), you have to use a slightly different syntax to connect the signal:
var combo = new QComboBox(...); ... combo['currentIndexChanged(int)'].connect(...);