• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 4 out of 92 pages
Exam (elaborations)

COS2614 Summary (Programming: Contemporary Concepts)

Document preview thumbnail
Preview 4 out of 92 pages

COS2614 Summary (Programming: Contemporary Concepts) c++ general summary: Creating class in QT: Right click on your project, say add new, then chose class. Then just type in class name and header and cpp file will automatically be created for you. Also, right click on a function and go refactor, then go add definition in .cpp file then it will create an auto implementation for you. General theory: Partial overriding: To implement an overridden function using partial overriding that means we call the overridden function in the overwriting function to calculate something. E.g. say calculateRental() was overridden double Video::calculateRental(int num) const{ double rental = Film::calculateRental(num); //calling the overridden function return (rental - (rental * discount / 100)) ; } Features of QMainWindow that allows for QAction objects: QMenu and QToolBar setCentralWidget(QWidget *wt) Note this function takes a QWidget object, but you can add view classes object inside as argument since the view class derived from QDialog or QMainWindow and those classes derive from QWidget. You can also put widgets like button as central widget since buttons derive from Viewclass which derive from QDialog which derives from QWidget. 3 visible features that can be added to QAction(sub menus) Text, icon, shortcut, tooltip Destructor when QMap and QList are data members Both fooLsit and fooMap point to Foo objects. The 1st statement deallocate the memory occupied by the objects. Now the 2nd statement tries to deallocate the Foo objects, but since they have already been deallocated a runtime error will occur. Sollution is to remove one of the statements. Implicit sharing application of Qt containers(lists) When a copy of a Qt container is made, the data values stored in the container are not copied unless a change is made to one or more elements of either container. Implicit sharing saves memory, and delays the process of copying containers until it is necessary Abstract class An abstract class is a class that is designed to be specifically used as a base class. An abstract class contains at least one pure virtual function which will get overridden by an inheriting class. Coutn function to check if there are repeated numbers in a list: foreach(int i, result){ if((i) 1){ //here we use count function, count returns number on instances of argument in the list, result is the list message = "Input contains repetitions.";


Connected book
 image
Jasmin Blanchette, Mark Summerfield C++ GUI Programming with Qt4
Publisher: 2008 ISBN: 9780132703000 Edition: Unknown

Document information

Uploaded on
January 10, 2022
Number of pages
92
Written in
2021/2022
Type
Exam (elaborations)
Contains
Questions & answers
$16.59

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Sold
97
Followers
82
Items
773
Last sold
10 months ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions

Whoops! We can’t load your doc right now. Try again or contact support.