Today (or Thursday) Qt Thursday Quiz SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder 1 SE3910 Week 6, Lab
GUI Toolkits Java AWT Swing SWT Java FX C# WPF Windows Forms Silverlight GTK# C/C++ Qt FLTK GTK Motif MFC SE Dr. Josiah Yoder Slide style: Dr. Hornick Much Material: Dr. Schilling 2
What makes a good toolkit? SE Dr. Josiah Yoder Slide style: Dr. Hornick Much Material: Dr. Schilling 3
Qt Features Fully object-oriented Consistent interfaces Rich set of widgets (controls) Have native look and feel Drag and drop Customizable appearance Utility classes OpenGL support Network support Database support Plugin support Unicode/Internationali zation support GUI builder SE Dr. Josiah Yoder Slide style: Dr. Hornick Much Material: Dr. Schilling 4
Qt Widgets Java Swing Qt SE Dr. Josiah Yoder Slide style: Dr. Hornick Much Material: Dr. Schilling 5
Example QT Widgets SE3910 Real Time Systems
QT Built in Dialog Boxes File dialog Font dialog Color dialog Printer dialog SE3910 Real Time Systems
Layouts Java FlowLayout GridLayout BorderLayout BoxLayout Qt FlowLayout (ex) QGridLayout BorderLayout (ex) QHBoxLayout QVBoxLayout SE Dr. Josiah Yoder Slide style: Dr. Hornick Much Material: Dr. Schilling 8
Layouts in Java and Qt Layouts in Java (in JFrame) setLayout(layout) add(button) Layouts in Qt (in QMainWindow) layout->add(button) widget->setLayout(layout) setCentralWidget(widget) SE Dr. Josiah Yoder Slide style: Dr. Hornick Much Material: Dr. Schilling 9
Events/Signals Java Event E.g. ActionEvent Event Listener E.g. ActionListener How does Java initiate an event? Qt Signal E.g. clicked() Slot E.g. on_pushButton_clicked emit SE Dr. Josiah Yoder Slide style: Dr. Hornick Much Material: Dr. Schilling 10
Custom Events in Java How do you register an event with an event source in Java? How do you create your own event in Java? How do you fire an event in java? SE Dr. Josiah Yoder Slide style: Dr. Hornick Much Material: Dr. Schilling 11
Custom Events in QT How do you register an event with an event source in QT? connect(button, SIGNAL(clicked()), qApp, SLOT(quit())); How do you create your own event in QT? signals: void clicked(); How do you fire an event in QT? emit progressNotification(1000 * seconds); SE Dr. Josiah Yoder Slide style: Dr. Hornick Much Material: Dr. Schilling 12
Qt command-line tools… moc – Program to convert.h files to moc_....cpp files [You don’t need to run this directly] qmake - Program that automatically creates a makefile to run moc and gcc at the correct time make – Program that reads makefile and runs all correct programs as needed 13
Quiz practice: Analog to digital bandwidth SE Dr. Josiah Yoder Slide style: Dr. Hornick Much Material: Dr. Schilling 14
Quiz Practice: C/C++ Circle the link-time errors. Box the compile- time syntax error point.m:40: error: ‘mypoint’ undeclared (first use in this function) collect2: ld returned 1 exit status /usr/lib/crt1.o(.text+0x18): undefined reference to `main ' parse error before `...‘ undefined reference to `filterText' warning: implicit declaration of function `...' SE-2811 Dr.Yoder 15
Other Quiz Subjects Creating a signal from sine waves Frequency content of a signal Analog bandwidth Stroboscopic effect Why some cables can carry more data than others Even more outcomes on outcomes page, if desired SE-2811 Dr.Yoder 16
Muddiest Point Wait for the slides, or follow this link to answer both questions at once: SE-2811 Dr.Yoder 17
Muddiest Point Wait for the slides, or follow this link to answer both questions at once: SE-2811 Dr.Yoder 18
SE-2811 Dr. Josiah Yoder 19
SE-2811 Dr. Josiah Yoder 20
References EB: Derek Malloy, Exploring Beaglebone, Wiley, duction_to_gcc/gccintro_95.html theory.co.uk/docs/gccintro/gccintro_95.html c-compile-errors-in-an-basic-example-objc- program duction_to_gcc/gccintro_94.html SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder 21