CMPE 135: Object-Oriented Analysis and Design November 21 Class Meeting Department of Computer Engineering San Jose State University Fall 2017 Instructor:

Slides:



Advertisements
Similar presentations
Months of the year December January November October February
Advertisements

Which season do you like best? 1106 Grade 8 Unit 9.
CS 174: Web Programming April 28 Class Meeting
CS 185C: The History of Computing August 24 Class Meeting Department of Computer Science San Jose State University Fall 2011 Instructor: Ron Mak
QT Intro. 김기형
An Overview of Qt - asankar1. Agenda About Qt –A brief intro of Qt Qt development tools –Tools used for building Qt application Qt Architecture –The underlying.
Oct ROOT 2002, CERN, Geneva Qt-Based Implementation of Low Level ROOT Graphical Layer By V.Fine.
Qt Igor November 8, 2002 Friday’s HENP Group Meeting.
CS 151: Object-Oriented Design December 5 Class Meeting Department of Computer Science San Jose State University Fall 2013 Instructor: Ron Mak
CS 157B: Database Management Systems II March 18 Class Meeting Department of Computer Science San Jose State University Spring 2013 Instructor: Ron Mak.
CS 152: Programming Language Paradigms April 9 Class Meeting Department of Computer Science San Jose State University Spring 2014 Instructor: Ron Mak
CS 235: User Interface Design November 3 Class Meeting Department of Computer Science San Jose State University Fall 2014 Instructor: Ron Mak
CS 149: Operating Systems April 7 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak
WORD JUMBLE. Months of the year Word in jumbled form e r r f b u y a Word in jumbled form e r r f b u y a february Click for the answer Next Question.
WEATHER BY: JENNIFER FAUTH KINDERGARTEN.
CMPE 226 Database Systems November 18 Class Meeting Department of Computer Engineering San Jose State University Fall 2015 Instructor: Ron Mak
QT Programming QT Programming Ruku Roychowdhury. Background QT is a cross platform application framework. Widely used to develop GUI applications. Originally.
CMPE 226 Database Systems October 28 Class Meeting
. The ideas behind Qt and a live demo Qt in Education.
2011 Calendar Important Dates/Events/Homework. SunSatFriThursWedTuesMon January
Introduction to Objective-C Spring Goals An introduction to Objective-C As implemented by the Apple LLVM Compiler 4.0 (a.k.a. Clang) Only the basics…
CS 153: Concepts of Compiler Design November 18 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
CS 151: Object-Oriented Design October 29 Class Meeting Department of Computer Science San Jose State University Fall 2013 Instructor: Ron Mak
CS 235: User Interface Design April 28 Class Meeting Department of Computer Science San Jose State University Spring 2015 Instructor: Ron Mak
CS 174: Web Programming November 16 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
CS 154 Formal Languages and Computability April 19 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
CS 160 and CMPE/SE 131 Software Engineering May 12 Class Meeting Department of Computer Science Department of Computer Engineering San José State University.
1. 2 Qt Toolkit ● C++ toolkit for cross-platform GUI application development – GUI functions (GUI = graphical user interface) – Data access components,
Introduction to Computers
Mobile Application Development with MeeGo™ - Touch Apps & UI Design
Done By: Ashlee Lizarraga Ricky Usher Jacinto Roches Eli Gomez
CMPE Data Structures and Algorithms in C++ September 14 Class Meeting
Jonathan Riddell Canonical Kubuntu Ubuntu KDE
OpenWells Cross-Platform Mobile Application
CMPE Data Structures and Algorithms in C++ December 7 Class Meeting
QT graphical user interface framework
CMPE Database Systems Exercise #1 Solutions
CMPE 152: Compiler Design ANTLR 4 and C++
Mobile Application Development with MeeGo™ - Programming with SDK
Qt Programming.
TIMELINES PHOTOS This is an example text
TIMELINES PHOTOS This is an example text
McDonald’s Kalender 2009.
McDonald’s Kalender 2009.
McDonald’s Kalender 2009.
CMPE 135: Object-Oriented Analysis and Design December 6 Class Meeting
CMPE 135: Object-Oriented Analysis and Design November 29 Class Meeting Department of Computer Engineering San Jose State University Fall 2018 Instructor:
CMPE 152: Compiler Design December 6 Class Meeting
CMPE Database Systems Exercise #3 Solutions
CMPE 152: Compiler Design August 28/30 Lab
CMPE 152: Compiler Design November 29 Class Meeting
CMPE 135: Object-Oriented Analysis and Design November 29 Class Meeting Department of Computer Engineering San Jose State University Fall 2018 Instructor:
Problem Gambling Clicks to Opgr.org
McDonald’s calendar 2007.
CMPE/SE 131 Software Engineering May 9 Class Meeting
A multi-platform GUI-building program
Calendar.
Circle Chart Template Process Name.
Take a walk down the canal and see the changes that happen as each month comes and goes. SAMPLE SLIDE Random Slides From This PowerPoint Show
MONTHS OF THE YEAR January February April March June May July August
CMPE 135: Object-Oriented Analysis and Design March 14 Class Meeting
CS 144 Advanced C++ Programming April 25 Class Meeting
CMPE419 Mobile Application Development
CMPE 152: Compiler Design April 25 Class Meeting
McDonald’s calendar 2007.
A multi-platform GUI-building program
CMPE 152: Compiler Design May 2 Class Meeting
2015 January February March April May June July August September
Four Seasons! By izabelle.
CS/SE 157B Database Management Systems II April 24 Class Meeting
Presentation transcript:

CMPE 135: Object-Oriented Analysis and Design November 21 Class Meeting Department of Computer Engineering San Jose State University Fall 2017 Instructor: Ron Mak www.cs.sjsu.edu/~mak

Unofficial Field Trip Computer History Museum in Mt. View http://www.computerhistory.org/ Provide your own transportation to the museum. Saturday, December 9, 11:30 – closing time Special free admission. Do a self-guided tour of the Revolution exhibit. See a life-size working model of Charles Babbage’s Difference Engine in operation, a hand-cranked mechanical computer designed in the early 1800s. Experience a fully restored IBM 1401 mainframe computer from the early 1960s in operation.

Unofficial Field Trip, cont’d See the extensive Revolution exhibit! Walk through a timeline of the First 2000 Years of Computing History. Historic computer systems, data processing equipment, and other artifacts. Small theater presentations. Hollerith Census Machine Atanasoff-Berry Computer

Unofficial Field Trip, cont’d IBM 1401 computer, fully restored and operational. A small transistor-based mainframe computer. Extremely popular with small businesses in the late 1950s through the mid 1960s Maximum of 16K bytes of memory. 800 card/minute card reader (wire brushes). 600 line/minute line printer (impact). 6 magnetic tape drives, no disk drives.

Unofficial Field Trip, cont’d Information on the IBM 1401: General info: http://en.wikipedia.org/wiki/IBM_1401 My summer seminar: http://www.cs.sjsu.edu/~mak/1401/ Restoration: http://ed-thelen.org/1401Project/1401RestorationPage.html

Design Patterns We’ve Covered Strategy Observer Decorator Factory Method Abstract Factory Singleton Adapter Facade State Iterator Composite Template Method

Design Patterns and Qt Qt is a multiplatform desktop applications and GUI development toolkit. Mac, Linux, Windows, mobile, ... Uses standard C++ with extensions. Notable users KDE Plasma desktop environment Tesla Model S Adobe Photoshop Google Earth Skype

Design Patterns and Qt, cont’d Uses design patterns? Composite Abstract Factory Singleton Facade Iterator Observer Strategy

Extensions to Standard C++ Qt extends standard C++ new data types (classes) new macros new cross-platform GUI library

Example: QStringList and Iteration #include <QStringList> #include <QDebug> int main() {     QString winter = "December, January, February";     QString spring = "March, April, May";     QString summer = "June, July, August";     QString fall = "September, October, November";     QStringList list;     list << winter;     list += spring;     list.append(summer);     list << fall;     qDebug() << "The spring months in a QStringList: " << list[1] ; lists-examples.cpp Different ways to append to the list. The spring months in a QStringList:  "March, April, May"

Example: QStringList and Iteration, cont’d     qDebug() << "\nAll the months in a joined QString:";     QString allmonths = list.join(", ");     qDebug() << allmonths; Convert from the list to a string. All the months in a joined QString: "December, January, February, March, April, May, June, July, August, September, October, November"     qDebug() << "\nThe four seasons using the Qt foreach:";     foreach (const QString &str, list)     {         qDebug() << QString(" [%1] ").arg(str);     } foreach is a Qt macro. The four seasons using the Qt foreach: " [December, January, February] " " [March, April, May] " " [June, July, August] " " [September, October, November] " A Qt implementation of the iterator design pattern.

Example: QStringList and Iteration, cont’d     qDebug() << "\nThe four seasons using an STL iterator:";     for (QStringList::iterator it = list.begin(); it != list.end(); ++it)     {         QString current = *it;         qDebug() << "[[" << current << "]]";     } The four seasons using an STL iterator: [[ "December, January, February" ]] [[ "March, April, May" ]] [[ "June, July, August" ]] [[ "September, October, November" ]]

Example: QStringList and Iteration, cont’d     qDebug() << "\nThe months using a Qt iterator:";     QListIterator<QString> itr (list2);     while (itr.hasNext())     {         QString current = itr.next();         qDebug() << "{" <<  current << "}";     }     return 0; } Java-style Qt iterator. The months using a Qt iterator: { "December" } { "January" } { "February" } { "March" } { "April" } { "May" } { "June" } { "July" } { "August" } { "September" } { "October" } { "November" } Another Qt implementation of the iterator design pattern.

Abstraction of the GUI Qt uses the native style APIs of the different platforms that it runs on. Qt GUI apps look like native GUI apps. Example: Qt on Linux-based systems. By Shmuel Csaba Otto Traian, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=27799196

Qt Tools moc metaobject compiler Reads the sources of a Qt program. Generates added C++ code to provide programming features not available natively in C++. qmake cross-platform build script generator Generates makefiles to develop applications across different platforms. Qt Creator cross-platform IDE for C++ Includes a drag-and-drop editor to create GUIs.

Qt Creator https://commons.wikimedia.org/w/index.php?curid=36219689

Qt Signals and Slots A Qt language construct for communication between objects. GUI widgets send signals containing event information. Other controls receive the signals using special functions known as slots. Implement the observer design pattern.

Download and Install Qt Download from https://www1.qt.io/download-open-source/?hsCtaTracking=f977210e-de67-475f-a32b-65cec207fd03%7Cd62710cd-e1db-46aa-8d4d-2f1c1ffdacea#section-2 Mac: After installing, you must build the library. Follow the instructions in 5.9.2/Src/qtbase/lib/README Install the include files in /usr/local/qt5/include Install the library files in /usr/local/qt5/lib

Download and Install Qt, cont’d Windows Download and install MinGW along with Qt. Trying to use a previous installation of MinGW doesn’t seem to work.

Example Qt Program: Simple simple.cpp #include <QApplication> #include <QWidget> int main(int argc, char *argv[]) {         QApplication app(argc, argv);     QWidget window;     window.resize(250, 150);     window.setWindowTitle("Simple example");     window.show();     return app.exec(); }

Example Qt Program: Simple, cont’d To build the example: Generates file qt.pro: qmake -project ###################################################################### # Automatically generated by qmake (3.1) Sun Nov 19 15:22:01 2017 TEMPLATE = app TARGET = qt INCLUDEPATH += . # The following define makes your compiler warn you if you use any # feature of Qt which has been marked as deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the # deprecated API in order to know how to port your code away from it. DEFINES += QT_DEPRECATED_WARNINGS # You can also make your code fail to compile if you use deprecated APIs. # In order to do so, uncomment the following line. # You can also select to disable deprecated APIs only up to a certain version of Qt. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs # deprecated before Qt 6.0.0 # Input SOURCES += simple.cpp QT += widgets

Example Qt Program: Simple, cont’d Run qmake again to generate a makefile, and then make the app: Run the app: qmake make

Example Qt Program: Factorials #include <QApplication> #include <QInputDialog> #include <QMessageBox> #include <QTextStream> int main (int argc, char* argv[]) {     QApplication app(argc, argv);     QTextStream cout(stdout);     int answer = 0;     do {         int n = QInputDialog::getInt(0, "Factorial Calculator",                                         "Factorial of:", 1);                  int i = 2;         int nfact = 1;         while (i <= n) nfact *= i++;         QString response = QString("The nfactorial of %1 is %2.\n%3")                                 .arg(n).arg(nfact)                                 .arg("Compute another nfactorial?");         answer = QMessageBox::question(0, "Play again?", response,                                        QMessageBox::Yes | QMessageBox::No);     } while (answer == QMessageBox::Yes);          return EXIT_SUCCESS; }

Example Qt Program: Factorials, cont’d qmake -project ###################################################################### # Automatically generated by qmake (3.1) Sun Nov 19 22:48:25 2017 TEMPLATE = app TARGET = factorial INCLUDEPATH += . DEFINES += QT_DEPRECATED_WARNINGS # Input SOURCES += factorial.cpp QT += widgets qmake make

Example Qt Program: Factorials, cont’d

Qt Creator A cross-platform, complete integrated development environment (IDE) for application developers. Create applications for multiple desktop, embedded, and mobile device platforms. Linux, Mac OS, and Windows Android and iOS Drag-and-drop editor to create GUIs.

Example: Text Finder Project A app that searches for matches in some text.

Example: Text Finder Project, cont’d

Example: Text Finder Project, cont’d

Example: Text Finder Project, cont’d

Example: Text Finder Project, cont’d

Example: Text Finder Project, cont’d

Example: Text Finder Project, cont’d

Example: Text Finder Project, cont’d

Example: Text Finder Project, cont’d

Example: Text Finder Project, cont’d

Example: Text Finder Project, cont’d

Example: Text Finder Project, cont’d

Example: Text Finder Project, cont’d

Example: Text Finder Project, cont’d

Example: Text Finder Project, cont’d

Example: Text Finder Project, cont’d

Example: Text Finder Project, cont’d

Example: Text Finder Project, cont’d

Who’s in Control? Standard text-based program Your program is in control. Your program determines the application flow. Interactive GUI-based program Inversion of control. Your program waits for events to occur. Your program reacts to events when they occur. The GUI framework that interacts with the user is in control.