"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "kdbg/testprogs/qt.cpp" between
kdbg-3.0.0.tar.gz and kdbg-3.0.1.tar.gz

About: KDbg is a graphical user interface to GDB, the GNU debugger (requires KDE, the K Desktop Environment).

qt.cpp  (kdbg-3.0.0):qt.cpp  (kdbg-3.0.1)
#include <qmap.h> #include <QtCore/QString>
#include <qvaluelist.h> #include <QtCore/QRect>
#include <qvaluevector.h>
#include <qstring.h>
#include <qrect.h>
#include <iostream> #include <iostream>
template<typename T>
void test_sharing(const T& input)
{
// a copy should increase the share counter
T copy = input;
// a const interator should not detach the copy
typename T::const_iterator cit = copy.constBegin();
std::cout << *cit << std::endl;
// a non-const iterator should detach the copy
typename T::iterator it = copy.begin();
std::cout << *it << std::endl;
}
int main() int main()
{ {
QMap<QString,int> str2int; QString str;
str2int["foo"] = 42; str = QLatin1String("A test string");
test_sharing(str2int);
QValueList<int> ints;
ints.push_back(42);
test_sharing(ints);
QValueVector<double> vals(6, 47.11);
vals.push_back(42);
test_sharing(vals);
QRect r(10,20, 130, 240); QRect r(10,20, 130, 240);
QPoint p = r.topLeft(); QPoint p = r.topLeft();
QPoint q = r.bottomRight(); QPoint q = r.bottomRight();
str = QLatin1String("New text");
std::cout << r.width() << r.height() << p.x() << q.y() << std::endl; std::cout << r.width() << r.height() << p.x() << q.y() << std::endl;
} }
 End of changes. 4 change blocks. 
31 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)