Lately I have been learning some Design Patterns. And I was wondering where all its used in Qt.
For example,
1. Observer Pattern in Signals and Slots.
2. Iterator in QList.
Could anyone tell me about other patterns.
Lately I have been learning some Design Patterns. And I was wondering where all its used in Qt.
For example,
1. Observer Pattern in Signals and Slots.
2. Iterator in QList.
Could anyone tell me about other patterns.
The Keyboard Is Mightier Than The Sword!
Not really sure about the observer, but i just finished reading up on iterators for QList...
QList has an STL-style iterator, accessible like so:
Qt Code:
QList<Type> list; //the list QList<Type>::iterator i; for (i = list.begin(); i != list.end(); i++) Type item = *i;To copy to clipboard, switch view to plain text mode
There is also a QListIterator-class which is more Java-style...like so:
Qt Code:
QList<Type> list; //the list QListIterator<Type> i(list); while (i.hasNext()){ Type item = i.next(); }To copy to clipboard, switch view to plain text mode
All of Interview is written using the Model - View pattern. There are quite a few patterns out there and signals/slots makes it easy to interconnect Qt classes according to different patterns with minimal fuzz.
Originally Posted by bits
Signals/Slots is more of a Publish/Subscribe pattern ... using an intermediary ... such that there is no coupling between the sender and receiver. The Observer pattern requires the sender and receiver to know more about each other.
bits (29th June 2006)
Apropos this topic, there is a new Qt book coming out in September called "An Introduction to Design Patterns in C++ with Qt 4", by Alan and Paul Ezust.
Thanks for the info. I assume it will be a great book to start with.Originally Posted by Brandybuck
I think that this book will definitely help us make our designs better.
The Keyboard Is Mightier Than The Sword!
I couldn't find much information over this Publish/Subscribe pattern.Originally Posted by brcain
Can any one recommend any link where we can find more about this?
The Keyboard Is Mightier Than The Sword!
http://www.eventhelix.com/RealtimeMa...e_patterns.htmOriginally Posted by bits
We can't solve problems by using the same kind of thinking we used when we created them
bits (30th June 2006)
is the ebook of "Introduction to Design Patterns in C++ with Qt 4" available?
Rajesh Kumar Singh
Bangalore, India.
Qt Search
Must Watch:
See how we can connect digital world objects to our day to day life….
wysota,
the link you given is a hard copy of book, I dont think that is e-book.
have any one read "Introduction to Design Patterns in C++ with Qt 4"?
is this book are really good?
I read sample chapter 9.
Rajesh Kumar Singh
Bangalore, India.
Qt Search
Must Watch:
See how we can connect digital world objects to our day to day life….
Oh, I missed the 'e' character in your post You can access parts of the books online, AFAIR, but not all of it.
Bookmarks