









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










Loop forever: { read input respond to input }
Method #2 Interrupt-driven Processing
interrupt is received, at which point
What advantages/disadvantages does this have?
btnJava.addActionListener(this); btnWishJava.addActionListener(this); btnNoJava.addActionListener(this);
public void actionPerformed(ActionEvent e) { Object source = e.getSource(); lblInstructionLabel.setText("Got it!"); if (btnJava.equals(source)) lblFeedback.setText("Yes"); else if (btnWishJava.equals(source)) lblFeedback.setText("No"); else if (btnNoJava.equals(source)) lblFeedback.setText("Maybe so"); }//end action performed
Signals and Slots
clicked_method()
#include <qapplication.h> #include <qpushbutton.h> int main(int argc, char *argv[]) { QApplication app(argc, argv); QPushButton *button = new QPushButton("Quit", 0); QObject::connect(button, SIGNAL(clicked()), &app, SLOT(quit())); app.setMainWidget(button); button->show(); return app.exec(); }
(requires qt-mtnc321.dll) Docsity.com