Changeset 846 for trunk/demos
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 319 edited
- 238 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/demos/affine/main.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/affine/xform.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/affine/xform.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/arthurplugin/plugin.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/books/bookdelegate.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/books/bookdelegate.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/books/bookwindow.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 65 65 model->setTable("books"); 66 66 67 // Reme ber the indexes of the columns67 // Remember the indexes of the columns 68 68 authorIdx = model->fieldIndex("author"); 69 69 genreIdx = model->fieldIndex("genre"); -
trunk/demos/books/bookwindow.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/books/initdb.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/books/main.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/boxes/basic.fsh
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/boxes/basic.vsh
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/boxes/dotted.fsh
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/boxes/fresnel.fsh
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/boxes/glass.fsh
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/boxes/glbuffers.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/boxes/glbuffers.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/boxes/glextensions.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/boxes/glextensions.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/boxes/gltrianglemesh.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/boxes/granite.fsh
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/boxes/main.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/boxes/marble.fsh
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/boxes/qtbox.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/boxes/qtbox.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/boxes/reflection.fsh
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/boxes/refraction.fsh
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/boxes/roundedbox.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/boxes/roundedbox.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/boxes/scene.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/boxes/scene.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/boxes/trackball.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/boxes/trackball.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/boxes/wood.fsh
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/browser/autosaver.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/browser/autosaver.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/browser/bookmarks.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/browser/bookmarks.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/browser/browserapplication.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/browser/browserapplication.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/browser/browsermainwindow.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 434 434 QMenu *toolsMenu = menuBar()->addMenu(tr("&Tools")); 435 435 toolsMenu->addAction(tr("Web &Search"), this, SLOT(slotWebSearch()), QKeySequence(tr("Ctrl+K", "Web Search"))); 436 #ifndef Q_CC_MINGW437 436 a = toolsMenu->addAction(tr("Enable Web &Inspector"), this, SLOT(slotToggleInspector(bool))); 438 437 a->setCheckable(true); 439 #endif440 438 441 439 QMenu *helpMenu = menuBar()->addMenu(tr("&Help")); … … 673 671 " new cookies are not stored, current cookies can't be accessed," \ 674 672 " site icons wont be stored, session wont be saved, " \ 675 " and searches are not add ded to the pop-up menu in the Google search box." \673 " and searches are not added to the pop-up menu in the Google search box." \ 676 674 " Until you close the window, you can still click the Back and Forward buttons" \ 677 675 " to return to the webpages you have opened.").arg(title); -
trunk/demos/browser/browsermainwindow.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/browser/chasewidget.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/browser/chasewidget.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/browser/cookiejar.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/browser/cookiejar.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/browser/data/browser.svg
r651 r846 277 277 <dc:rights> 278 278 <cc:Agent> 279 <dc:title>Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).</dc:title>279 <dc:title>Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).</dc:title> 280 280 </cc:Agent> 281 281 </dc:rights> -
trunk/demos/browser/downloadmanager.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 283 283 .arg(timeRemaining) 284 284 .arg(timeRemainingString); 285 info = QString(tr("%1 of %2 (%3/sec) %4"))285 info = tr("%1 of %2 (%3/sec) %4") 286 286 .arg(dataString(m_bytesReceived)) 287 287 .arg(bytesTotal == 0 ? tr("?") : dataString(bytesTotal)) -
trunk/demos/browser/downloadmanager.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/browser/edittableview.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/browser/edittableview.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/browser/edittreeview.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/browser/edittreeview.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/browser/history.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/browser/history.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/browser/main.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/browser/modelmenu.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/browser/modelmenu.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/browser/networkaccessmanager.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/browser/networkaccessmanager.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/browser/searchlineedit.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/browser/searchlineedit.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/browser/settings.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 90 90 QSettings settings; 91 91 settings.beginGroup(QLatin1String("MainWindow")); 92 QString defaultHome = QLatin1String("http:// qt.nokia.com");92 QString defaultHome = QLatin1String("http://doc.qt.nokia.com"); 93 93 homeLineEdit->setText(settings.value(QLatin1String("home"), defaultHome).toString()); 94 94 settings.endGroup(); -
trunk/demos/browser/settings.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/browser/squeezelabel.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/browser/squeezelabel.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/browser/tabwidget.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 68 68 this, SLOT(contextMenuRequested(QPoint))); 69 69 70 QString alt = QLatin1String("Alt+%1");70 QString ctrl = QLatin1String("Ctrl+%1"); 71 71 for (int i = 1; i <= 10; ++i) { 72 72 int key = i; 73 73 if (key == 10) 74 74 key = 0; 75 QShortcut *shortCut = new QShortcut( alt.arg(key), this);75 QShortcut *shortCut = new QShortcut(ctrl.arg(key), this); 76 76 m_tabShortcuts.append(shortCut); 77 77 connect(shortCut, SIGNAL(activated()), this, SLOT(selectTabAction())); -
trunk/demos/browser/tabwidget.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/browser/toolbarsearch.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/browser/toolbarsearch.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/browser/urllineedit.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/browser/urllineedit.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/browser/webview.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 261 261 { 262 262 if (100 != m_progress) { 263 qWarning() << "Rec ieved finished signal while progress is still:" << progress()263 qWarning() << "Received finished signal while progress is still:" << progress() 264 264 << "Url:" << url(); 265 265 } -
trunk/demos/browser/webview.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/browser/xbel.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/browser/xbel.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/chip/chip.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/chip/chip.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/chip/main.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/chip/mainwindow.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/chip/mainwindow.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/chip/view.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/chip/view.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/composition/composition.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/composition/composition.h
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/composition/main.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/deform/main.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 51 51 QApplication app(argc, argv); 52 52 53 bool smallScreen = false; 54 for (int i=0; i<argc; i++) 55 if (QString(argv[i]) == "-small-screen") 56 smallScreen = true; 53 bool smallScreen = QApplication::arguments().contains("-small-screen"); 57 54 58 55 PathDeformWidget deformWidget(0, smallScreen); -
trunk/demos/deform/pathdeform.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/deform/pathdeform.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/demos.pro
r769 r846 1 1 TEMPLATE = subdirs 2 3 !contains(QT_CONFIG, no-gui) { 2 4 SUBDIRS = \ 3 5 demos_shared \ … … 39 41 demos_sub-attaq 40 42 41 contains(QT_CONFIG, opengl):!contains(QT_CONFIG, opengles1):!contains(QT_CONFIG, opengles 1cl):!contains(QT_CONFIG, opengles2):{43 contains(QT_CONFIG, opengl):!contains(QT_CONFIG, opengles1):!contains(QT_CONFIG, opengles2):{ 42 44 SUBDIRS += demos_boxes 43 45 } 44 46 45 47 mac*: SUBDIRS += demos_macmainwindow 46 wince*|symbian|embedded|x11: SUBDIRS += embedded48 wince*|symbian|embedded|x11: SUBDIRS += demos_embedded 47 49 48 50 !contains(QT_EDITION, Console):!cross_compile:!embedded:!wince*:SUBDIRS += demos_arthurplugin … … 56 58 contains(QT_CONFIG, phonon):!static:SUBDIRS += demos_mediaplayer 57 59 contains(QT_CONFIG, webkit):contains(QT_CONFIG, svg):!symbian:SUBDIRS += demos_browser 58 contains(QT_CONFIG, multimedia):SUBDIRS += demos_spectrum 60 contains(QT_CONFIG, declarative):SUBDIRS += demos_declarative 61 contains(QT_CONFIG, multimedia):!static:SUBDIRS += demos_spectrum 59 62 60 63 # install … … 67 70 demos_chip.subdir = chip 68 71 demos_embeddeddialogs.subdir = embeddeddialogs 72 demos_embedded.subdir = embedded 73 # Because of fluidlauncher 74 demos_embedded.depends = demos_deform demos_pathstroke 69 75 demos_shared.subdir = shared 70 76 demos_deform.subdir = deform … … 84 90 demos_qtdemo.subdir = qtdemo 85 91 demos_mediaplayer.subdir = qmediaplayer 92 demos_declarative.subdir = declarative 86 93 87 94 demos_browser.subdir = browser … … 100 107 demos_pathstroke.depends = demos_shared 101 108 } 109 } -
trunk/demos/embedded/anomaly/anomaly.pro
r769 r846 27 27 TARGET.UID3 = 0xA000CF71 28 28 include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri) 29 HEADERS += $$QT_SOURCE_TREE/examples/network/qftp/sym_iap_util.h30 LIBS += -lesock -lcommdb -linsock # For IAP selection31 29 TARGET.CAPABILITY = NetworkServices 32 30 TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 -
trunk/demos/embedded/anomaly/src/AddressBar.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 45 45 #include <QtGui> 46 46 47 class LineEdit: public QLineEdit48 {49 public:50 LineEdit(QWidget *parent = 0): QLineEdit(parent) {}51 52 void paintEvent(QPaintEvent *event) {53 QLineEdit::paintEvent(event);54 if (text().isEmpty()) {55 QPainter p(this);56 int flags = Qt::AlignLeft | Qt::AlignVCenter;57 p.setPen(palette().color(QPalette::Disabled, QPalette::Text));58 p.drawText(rect().adjusted(10, 0, 0, 0), flags, "Enter address or search terms");59 p.end();60 }61 }62 };63 64 47 AddressBar::AddressBar(QWidget *parent) 65 48 : QWidget(parent) 66 49 { 67 m_lineEdit = new LineEdit(parent); 50 m_lineEdit = new QLineEdit(parent); 51 m_lineEdit->setPlaceholderText("Enter address or search terms"); 68 52 connect(m_lineEdit, SIGNAL(returnPressed()), SLOT(processAddress())); 69 53 m_toolButton = new QToolButton(parent); -
trunk/demos/embedded/anomaly/src/AddressBar.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/embedded/anomaly/src/BookmarksView.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 56 56 m_iconView->addItem("www.google.com"); 57 57 m_iconView->addItem("qt.nokia.com/doc/4.5"); 58 m_iconView->addItem("news.bbc.co.uk/ text_only.stm");58 m_iconView->addItem("news.bbc.co.uk/2/mobile/default.stm"); 59 59 m_iconView->addItem("mobile.wikipedia.org"); 60 60 m_iconView->addItem("qt.nokia.com"); -
trunk/demos/embedded/anomaly/src/BookmarksView.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/embedded/anomaly/src/BrowserView.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 52 52 #include "ZoomStrip.h" 53 53 54 #if defined (Q_OS_SYMBIAN)55 #include "sym_iap_util.h"56 #endif57 58 54 BrowserView::BrowserView(QWidget *parent) 59 55 : QWidget(parent) … … 71 67 m_zoomLevels << 100; 72 68 m_zoomLevels << 110 << 120 << 133 << 150 << 170 << 200 << 240 << 300; 69 70 QNetworkConfigurationManager manager; 71 if (manager.capabilities() & QNetworkConfigurationManager::NetworkSessionRequired) { 72 // Get saved network configuration 73 QSettings settings(QSettings::UserScope, QLatin1String("Trolltech")); 74 settings.beginGroup(QLatin1String("QtNetwork")); 75 const QString id = 76 settings.value(QLatin1String("DefaultNetworkConfiguration")).toString(); 77 settings.endGroup(); 78 79 // If the saved network configuration is not currently discovered use the system 80 // default 81 QNetworkConfiguration config = manager.configurationFromIdentifier(id); 82 if ((config.state() & QNetworkConfiguration::Discovered) != 83 QNetworkConfiguration::Discovered) { 84 config = manager.defaultConfiguration(); 85 } 86 87 m_webView->page()->networkAccessManager()->setConfiguration(config); 88 } 73 89 74 90 QTimer::singleShot(0, this, SLOT(initialize())); … … 101 117 m_webView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); 102 118 m_webView->setFocus(); 103 #ifdef Q_OS_SYMBIAN104 QTimer::singleShot(0, this, SLOT(setDefaultIap()));105 #endif106 119 } 107 120 … … 174 187 m_zoomStrip->move(width() - zw, (height() - zh) / 2); 175 188 } 176 #ifdef Q_OS_SYMBIAN177 void BrowserView::setDefaultIap()178 {179 qt_SetDefaultIap();180 m_webView->load(QUrl("http://news.bbc.co.uk/text_only.stm"));181 }182 #endif183 189 184 190 void BrowserView::navigate(const QUrl &url) -
trunk/demos/embedded/anomaly/src/BrowserView.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 64 64 void zoomIn(); 65 65 void zoomOut(); 66 #ifdef Q_OS_SYMBIAN67 void setDefaultIap();68 #endif69 66 70 67 private slots: -
trunk/demos/embedded/anomaly/src/BrowserWindow.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/embedded/anomaly/src/BrowserWindow.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/embedded/anomaly/src/ControlStrip.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/embedded/anomaly/src/ControlStrip.h
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/embedded/anomaly/src/HomeView.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/embedded/anomaly/src/HomeView.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/embedded/anomaly/src/Main.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/embedded/anomaly/src/TitleBar.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/embedded/anomaly/src/TitleBar.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/embedded/anomaly/src/ZoomStrip.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/embedded/anomaly/src/ZoomStrip.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/embedded/anomaly/src/flickcharm.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/embedded/anomaly/src/flickcharm.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/embedded/anomaly/src/webview.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/embedded/anomaly/src/webview.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/embedded/desktopservices/contenttab.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 126 126 { 127 127 Q_UNUSED(item); 128 QMessageBox::warning(this, tr("Operation Failed"), tr("Unk own error!"), QMessageBox::Close);128 QMessageBox::warning(this, tr("Operation Failed"), tr("Unknown error!"), QMessageBox::Close); 129 129 } 130 130 -
trunk/demos/embedded/desktopservices/contenttab.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/embedded/desktopservices/desktopservices.pro
r561 r846 25 25 26 26 wince*{ 27 music.path = "\ My Documents\My Music"28 image.path = "\ My Documents\My Pictures"27 music.path = "\\My Documents\\My Music" 28 image.path = "\\My Documents\\My Pictures" 29 29 DEPLOYMENT += music image 30 30 } -
trunk/demos/embedded/desktopservices/desktopwidget.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 74 74 // Links 75 75 LinkTab* othersTab = new LinkTab(tabWidget);; 76 // Given icon file will be overrid en by LinkTab76 // Given icon file will be overridden by LinkTab 77 77 othersTab->init(QDesktopServices::PicturesLocation, "", ""); 78 78 tabWidget->addTab(othersTab, tr("Links")); -
trunk/demos/embedded/desktopservices/desktopwidget.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/embedded/desktopservices/linktab.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/embedded/desktopservices/linktab.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/embedded/desktopservices/main.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/embedded/digiflip/digiflip.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/embedded/embedded.pro
r561 r846 5 5 SUBDIRS += embeddedsvgviewer \ 6 6 desktopservices 7 fluidlauncher.subdir = fluidlauncher 8 fluidlauncher.depends = styledemo desktopservices raycasting flickable digiflip lightmaps flightinfo 7 9 !vxworks:!qnx:SUBDIRS += fluidlauncher 8 10 } … … 18 20 } 19 21 22 contains(QT_CONFIG, declarative) { 23 # Qml demos require DEPLOYMENT support. Therefore, only symbian. 24 symbian:SUBDIRS += qmlcalculator qmlclocks qmldialcontrol qmleasing qmlflickr qmlphotoviewer qmltwitter 25 } 26 20 27 # install 21 28 sources.files = README *.pro -
trunk/demos/embedded/embeddedsvgviewer/embeddedsvgviewer.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/embedded/embeddedsvgviewer/embeddedsvgviewer.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/embedded/embeddedsvgviewer/main.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/embedded/flickable/flickable.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/embedded/flickable/flickable.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/embedded/flickable/main.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/embedded/flightinfo/flightinfo.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 44 44 #include <QtNetwork> 45 45 46 #if defined (Q_OS_SYMBIAN)47 #include "sym_iap_util.h"48 #endif49 50 46 #include "ui_form.h" 51 47 … … 101 97 QDate m_searchDate; 102 98 QPixmap m_map; 99 QNetworkAccessManager m_manager; 100 QList<QNetworkReply *> mapReplies; 103 101 104 102 public: … … 116 114 117 115 setWindowTitle("Flight Info"); 118 QTimer::singleShot(0, this, SLOT(delayedInit()));119 116 120 117 // Rendered from the public-domain vectorized aircraft … … 128 125 connect(searchYesterdayAction, SIGNAL(triggered()), SLOT(yesterday())); 129 126 connect(randomAction, SIGNAL(triggered()), SLOT(randomFlight())); 127 connect(&m_manager, SIGNAL(finished(QNetworkReply*)), 128 this, SLOT(handleNetworkData(QNetworkReply*))); 130 129 #if defined(Q_OS_SYMBIAN) 131 130 menuBar()->addAction(searchTodayAction); … … 141 140 142 141 private slots: 143 void delayedInit() {144 #if defined(Q_OS_SYMBIAN)145 qt_SetDefaultIap();146 #endif147 }148 149 142 150 143 void handleNetworkData(QNetworkReply *networkReply) { 151 144 if (!networkReply->error()) { 152 // Assume UTF-8 encoded 153 QByteArray data = networkReply->readAll(); 154 QString xml = QString::fromUtf8(data); 155 digest(xml); 145 if (!mapReplies.contains(networkReply)) { 146 // Assume UTF-8 encoded 147 QByteArray data = networkReply->readAll(); 148 QString xml = QString::fromUtf8(data); 149 digest(xml); 150 } else { 151 mapReplies.removeOne(networkReply); 152 m_map.loadFromData(networkReply->readAll()); 153 update(); 154 } 156 155 } 157 156 networkReply->deleteLater(); 158 networkReply->manager()->deleteLater();159 }160 161 void handleMapData(QNetworkReply *networkReply) {162 if (!networkReply->error()) {163 m_map.loadFromData(networkReply->readAll());164 update();165 }166 networkReply->deleteLater();167 networkReply->manager()->deleteLater();168 157 } 169 158 … … 186 175 ui.flightStatus->hide(); 187 176 ui.flightName->setText("Enter flight number"); 177 ui.flightEdit->setFocus(); 178 #ifdef QT_KEYPAD_NAVIGATION 179 ui.flightEdit->setEditFocus(true); 180 #endif 188 181 m_map = QPixmap(); 189 182 update(); … … 225 218 } 226 219 227 QNetworkAccessManager *manager = new QNetworkAccessManager(this); 228 connect(manager, SIGNAL(finished(QNetworkReply*)), 229 this, SLOT(handleNetworkData(QNetworkReply*))); 230 manager->get(QNetworkRequest(m_url)); 220 m_manager.get(QNetworkRequest(m_url)); 231 221 } 232 222 … … 249 239 QString airport = regex.cap(1); 250 240 m_url.addEncodedQueryItem("dpap", QUrl::toPercentEncoding(airport)); 251 QNetworkAccessManager *manager = new QNetworkAccessManager(this); 252 connect(manager, SIGNAL(finished(QNetworkReply*)), 253 this, SLOT(handleNetworkData(QNetworkReply*))); 254 manager->get(QNetworkRequest(m_url)); 241 m_manager.get(QNetworkRequest(m_url)); 255 242 return; 256 243 } … … 288 275 if (xml.name() == "img" && inFlightMap) { 289 276 QString src = xml.attributes().value("src").toString(); 290 src.prepend("http://mobile.flightview.com ");277 src.prepend("http://mobile.flightview.com/"); 291 278 QUrl url = QUrl::fromPercentEncoding(src.toAscii()); 292 QNetworkAccessManager *manager = new QNetworkAccessManager(this); 293 connect(manager, SIGNAL(finished(QNetworkReply*)), 294 this, SLOT(handleMapData(QNetworkReply*))); 295 manager->get(QNetworkRequest(url)); 279 mapReplies.append(m_manager.get(QNetworkRequest(url))); 296 280 } 297 281 } -
trunk/demos/embedded/flightinfo/flightinfo.pro
r769 r846 9 9 TARGET.UID3 = 0xA000CF74 10 10 include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri) 11 HEADERS += $$QT_SOURCE_TREE/examples/network/qftp/sym_iap_util.h12 LIBS += -lesock -lcommdb -linsock # For IAP selection13 11 TARGET.CAPABILITY = NetworkServices 14 12 } -
trunk/demos/embedded/fluidlauncher/config_s60/config.xml
r769 r846 22 22 <example filename="qmediaplayer" name="Media Player" image="screenshots/mediaplayer.png" args="-small-screen"/> 23 23 <example filename="spectrum" name="Spectrum Analyzer" image="screenshots/spectrum.png" args="-small-screen"/> 24 <example filename="qmlcalculator" name="Qml Calculator" image="screenshots/qmlcalculator.png"/> 25 <example filename="qmlclocks" name="Qml Clocks" image="screenshots/qmlclocks.png"/> 26 <example filename="qmldialcontrol" name="Qml Dial Control" image="screenshots/qmldialcontrol.png"/> 27 <example filename="qmleasing" name="Qml Easing Curves" image="screenshots/qmleasing.png"/> 28 <example filename="qmlflickr" name="Qml flickr" image="screenshots/qmlflickr.jpg"/> 29 <example filename="qmlphotoviewer" name="Qml Photo Viewer" image="screenshots/qmlphotoviewer.jpg"/> 30 <example filename="qmltwitter" name="Qml twitter" image="screenshots/qmltwitter.jpg"/> 24 31 </demos> 25 32 <slideshow timeout="60000" interval="10000"> -
trunk/demos/embedded/fluidlauncher/demoapplication.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/embedded/fluidlauncher/demoapplication.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/embedded/fluidlauncher/fluidlauncher.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 155 155 DemoApplication* newDemo = new DemoApplication( 156 156 filename.toString(), 157 name.isEmpty() ? "Un amed Demo" : name.toString(),157 name.isEmpty() ? "Unnamed Demo" : name.toString(), 158 158 image.toString(), 159 159 args.toString().split(" ")); -
trunk/demos/embedded/fluidlauncher/fluidlauncher.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/embedded/fluidlauncher/fluidlauncher.pro
r769 r846 3 3 DEPENDPATH += . 4 4 INCLUDEPATH += . 5 VERSION = $$QT_VERSION 5 6 6 7 # Input … … 58 59 symbian { 59 60 load(data_caging_paths) 61 include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri) 62 RSS_RULES = # Clear RSS_RULES, otherwise fluidlauncher will get put into QtDemos folder 60 63 61 64 TARGET.UID3 = 0xA000A641 62 ICON = $$QT_SOURCE_TREE/src/s60installs/qt.svg 65 66 defineReplace(regResourceDir) { 67 symbian-abld|symbian-sbsv2 { 68 return($${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/$$basename(1)) 69 } else { 70 return($${QT_BUILD_TREE}/$$1) 71 } 72 } 73 74 defineReplace(appResourceDir) { 75 symbian-abld|symbian-sbsv2 { 76 return($${EPOCROOT}$${HW_ZDIR}$${APP_RESOURCE_DIR}/$$basename(1)) 77 } else { 78 return($${QT_BUILD_TREE}/$$1) 79 } 80 } 63 81 64 82 executables.sources = \ 65 styledemo.exe \66 deform.exe \67 pathstroke.exe \68 wiggly.exe \69 qftp.exe \70 saxbookmarks.exe \71 desktopservices.exe \72 fridgemagnets.exe \73 softkeys.exe \74 raycasting.exe \75 flickable.exe \76 digiflip.exe \77 lightmaps.exe \78 flightinfo.exe83 $$QT_BUILD_TREE/demos/embedded/styledemo/styledemo.exe \ 84 $$QT_BUILD_TREE/demos/deform/deform.exe \ 85 $$QT_BUILD_TREE/demos/pathstroke/pathstroke.exe \ 86 $$QT_BUILD_TREE/examples/widgets/wiggly/wiggly.exe \ 87 $$QT_BUILD_TREE/examples/network/qftp/qftp.exe \ 88 $$QT_BUILD_TREE/examples/xml/saxbookmarks/saxbookmarks.exe \ 89 $$QT_BUILD_TREE/demos/embedded/desktopservices/desktopservices.exe \ 90 $$QT_BUILD_TREE/examples/draganddrop/fridgemagnets/fridgemagnets.exe \ 91 $$QT_BUILD_TREE/examples/widgets/softkeys/softkeys.exe \ 92 $$QT_BUILD_TREE/demos/embedded/raycasting/raycasting.exe \ 93 $$QT_BUILD_TREE/demos/embedded/flickable/flickable.exe \ 94 $$QT_BUILD_TREE/demos/embedded/digiflip/digiflip.exe \ 95 $$QT_BUILD_TREE/demos/embedded/lightmaps/lightmaps.exe \ 96 $$QT_BUILD_TREE/demos/embedded/flightinfo/flightinfo.exe 79 97 80 98 executables.path = /sys/bin 81 99 82 100 reg_resource.sources = \ 83 $$ {EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/styledemo_reg.rsc\84 $$ {EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/deform_reg.rsc\85 $$ {EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/pathstroke_reg.rsc\86 $$ {EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/wiggly_reg.rsc\87 $$ {EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/qftp_reg.rsc\88 $$ {EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/saxbookmarks_reg.rsc\89 $$ {EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/desktopservices_reg.rsc\90 $$ {EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/fridgemagnets_reg.rsc\91 $$ {EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/softkeys_reg.rsc\92 $$ {EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/raycasting_reg.rsc\93 $$ {EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/flickable_reg.rsc\94 $$ {EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/digiflip_reg.rsc\95 $$ {EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/lightmaps_reg.rsc\96 $$ {EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/flightinfo_reg.rsc101 $$regResourceDir(demos/embedded/styledemo/styledemo_reg.rsc) \ 102 $$regResourceDir(demos/deform/deform_reg.rsc) \ 103 $$regResourceDir(demos/pathstroke/pathstroke_reg.rsc) \ 104 $$regResourceDir(examples/widgets/wiggly/wiggly_reg.rsc) \ 105 $$regResourceDir(examples/network/qftp/qftp_reg.rsc)\ 106 $$regResourceDir(examples/xml/saxbookmarks/saxbookmarks_reg.rsc) \ 107 $$regResourceDir(demos/embedded/desktopservices/desktopservices_reg.rsc) \ 108 $$regResourceDir(examples/draganddrop/fridgemagnets/fridgemagnets_reg.rsc) \ 109 $$regResourceDir(examples/widgets/softkeys/softkeys_reg.rsc) \ 110 $$regResourceDir(demos/embedded/raycasting/raycasting_reg.rsc) \ 111 $$regResourceDir(demos/embedded/flickable/flickable_reg.rsc) \ 112 $$regResourceDir(demos/embedded/digiflip/digiflip_reg.rsc) \ 113 $$regResourceDir(demos/embedded/lightmaps/lightmaps_reg.rsc) \ 114 $$regResourceDir(demos/embedded/flightinfo/flightinfo_reg.rsc) 97 115 98 116 contains(QT_CONFIG, phonon) { 99 reg_resource.sources += $$ {EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/qmediaplayer_reg.rsc117 reg_resource.sources += $$regResourceDir(demos/qmediaplayer/qmediaplayer_reg.rsc) 100 118 } 101 119 102 120 contains(QT_CONFIG, multimedia) { 103 reg_resource.sources += $$ {EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/spectrum_reg.rsc121 reg_resource.sources += $$regResourceDir(demos/spectrum/app/spectrum_reg.rsc) 104 122 } 105 123 … … 108 126 109 127 resource.sources = \ 110 $$ {EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/styledemo.rsc\111 $$ {EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/deform.rsc\112 $$ {EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/pathstroke.rsc\113 $$ {EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/wiggly.rsc\114 $$ {EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/qftp.rsc\115 $$ {EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/saxbookmarks.rsc\116 $$ {EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/desktopservices.rsc\117 $$ {EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/fridgemagnets.rsc\118 $$ {EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/softkeys.rsc\119 $$ {EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/raycasting.rsc\120 $$ {EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/flickable.rsc\121 $$ {EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/digiflip.rsc\122 $$ {EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/lightmaps.rsc\123 $$ {EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/flightinfo.rsc128 $$appResourceDir(demos/embedded/styledemo/styledemo.rsc) \ 129 $$appResourceDir(demos/deform/deform.rsc) \ 130 $$appResourceDir(demos/pathstroke/pathstroke.rsc) \ 131 $$appResourceDir(examples/widgets/wiggly/wiggly.rsc) \ 132 $$appResourceDir(examples/network/qftp/qftp.rsc)\ 133 $$appResourceDir(examples/xml/saxbookmarks/saxbookmarks.rsc) \ 134 $$appResourceDir(demos/embedded/desktopservices/desktopservices.rsc) \ 135 $$appResourceDir(examples/draganddrop/fridgemagnets/fridgemagnets.rsc) \ 136 $$appResourceDir(examples/widgets/softkeys/softkeys.rsc) \ 137 $$appResourceDir(demos/embedded/raycasting/raycasting.rsc) \ 138 $$appResourceDir(demos/embedded/flickable/flickable.rsc) \ 139 $$appResourceDir(demos/embedded/digiflip/digiflip.rsc) \ 140 $$appResourceDir(demos/embedded/lightmaps/lightmaps.rsc) \ 141 $$appResourceDir(demos/embedded/flightinfo/flightinfo.rsc) 124 142 125 143 … … 127 145 128 146 mifs.sources = \ 129 $$ {EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/fluidlauncher.mif\130 $$ {EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/styledemo.mif\131 $$ {EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/deform.mif\132 $$ {EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/pathstroke.mif\133 $$ {EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/wiggly.mif\134 $$ {EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/qftp.mif\135 $$ {EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/saxbookmarks.mif\136 $$ {EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/desktopservices.mif\137 $$ {EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/fridgemagnets.mif\138 $$ {EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/softkeys.mif\139 $$ {EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/raycasting.mif\140 $$ {EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/flickable.mif\141 $$ {EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/digiflip.mif\142 $$ {EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/lightmaps.mif\143 $$ {EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/flightinfo.mif147 $$appResourceDir(demos/embedded/fluidlauncher/fluidlauncher.mif) \ 148 $$appResourceDir(demos/embedded/styledemo/styledemo.mif) \ 149 $$appResourceDir(demos/deform/deform.mif) \ 150 $$appResourceDir(demos/pathstroke/pathstroke.mif) \ 151 $$appResourceDir(examples/widgets/wiggly/wiggly.mif) \ 152 $$appResourceDir(examples/network/qftp/qftp.mif) \ 153 $$appResourceDir(examples/xml/saxbookmarks/saxbookmarks.mif) \ 154 $$appResourceDir(demos/embedded/desktopservices/desktopservices.mif) \ 155 $$appResourceDir(examples/draganddrop/fridgemagnets/fridgemagnets.mif) \ 156 $$appResourceDir(examples/widgets/softkeys/softkeys.mif) \ 157 $$appResourceDir(demos/embedded/raycasting/raycasting.mif) \ 158 $$appResourceDir(demos/embedded/flickable/flickable.mif) \ 159 $$appResourceDir(demos/embedded/digiflip/digiflip.mif) \ 160 $$appResourceDir(demos/embedded/lightmaps/lightmaps.mif) \ 161 $$appResourceDir(demos/embedded/flightinfo/flightinfo.mif) 144 162 mifs.path = $$APP_RESOURCE_DIR 145 163 146 164 contains(QT_CONFIG, svg) { 147 165 executables.sources += \ 148 embeddedsvgviewer.exe \149 weatherinfo.exe166 $$QT_BUILD_TREE/demos/embedded/embeddedsvgviewer/embeddedsvgviewer.exe \ 167 $$QT_BUILD_TREE/demos/embedded/weatherinfo/weatherinfo.exe 150 168 151 169 reg_resource.sources += \ 152 $$ {EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/embeddedsvgviewer_reg.rsc\153 $$ {EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/weatherinfo_reg.rsc170 $$regResourceDir(demos/embedded/embeddedsvgviewer/embeddedsvgviewer_reg.rsc) \ 171 $$regResourceDir(demos/embedded/weatherinfo/weatherinfo_reg.rsc) 154 172 155 173 resource.sources += \ 156 $$ {EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/embeddedsvgviewer.rsc\157 $$ {EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/weatherinfo.rsc158 159 mifs.sources += \ 160 $$ {EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/embeddedsvgviewer.mif\161 $$ {EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/weatherinfo.mif174 $$appResourceDir(demos/embedded/embeddedsvgviewer/embeddedsvgviewer.rsc) \ 175 $$appResourceDir(demos/embedded/weatherinfo/weatherinfo.rsc) 176 177 mifs.sources += \ 178 $$appResourceDir(demos/embedded/embeddedsvgviewer/embeddedsvgviewer.mif) \ 179 $$appResourceDir(demos/embedded/weatherinfo/weatherinfo.mif) 162 180 163 181 } 164 182 contains(QT_CONFIG, webkit) { 165 executables.sources += anomaly.exe166 reg_resource.sources += $$ {EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/anomaly_reg.rsc167 resource.sources += $$ {EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/anomaly.rsc168 mifs.sources += \ 169 $$ {EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/anomaly.mif183 executables.sources += $$QT_BUILD_TREE/demos/embedded/anomaly/anomaly.exe 184 reg_resource.sources += $$regResourceDir(demos/embedded/anomaly/anomaly_reg.rsc) 185 resource.sources += $$appResourceDir(demos/embedded/anomaly/anomaly.rsc) 186 mifs.sources += \ 187 $$appResourceDir(demos/embedded/anomaly/anomaly.mif) 170 188 171 189 isEmpty(QT_LIBINFIX) { … … 178 196 179 197 contains(QT_CONFIG, phonon) { 180 executables.sources += qmediaplayer.exe181 resource.sources += $$ {EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/qmediaplayer.rsc182 mifs.sources += \ 183 $$ {EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/qmediaplayer.mif198 executables.sources += $$QT_BUILD_TREE/demos/qmediaplayer/qmediaplayer.exe 199 resource.sources += $$appResourceDir(demos/qmediaplayer/qmediaplayer.rsc) 200 mifs.sources += \ 201 $$appResourceDir(demos/qmediaplayer/qmediaplayer.mif) 184 202 } 185 203 186 204 contains(QT_CONFIG, multimedia) { 187 executables.sources += spectrum.exe fftreal.dll 188 resource.sources += $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/spectrum.rsc 189 mifs.sources += \ 190 $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/spectrum.mif 205 executables.sources += $$QT_BUILD_TREE/demos/spectrum/app/spectrum.exe 206 executables.sources += $$QT_BUILD_TREE/demos/spectrum/3rdparty/fftreal/fftreal.dll 207 resource.sources += $$appResourceDir(demos/spectrum/app/spectrum.rsc) 208 mifs.sources += \ 209 $$appResourceDir(demos/spectrum/app/spectrum.mif) 191 210 } 192 211 193 212 contains(QT_CONFIG, script) { 194 executables.sources += context2d.exe 195 reg_resource.sources += $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/context2d_reg.rsc 196 resource.sources += $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/context2d.rsc 197 mifs.sources += \ 198 $${EPOCROOT}$$HW_ZDIR$$APP_RESOURCE_DIR/context2d.mif 213 executables.sources += $$QT_BUILD_TREE/examples/script/context2d/context2d.exe 214 reg_resource.sources += $$regResourceDir(examples/script/context2d/context2d_reg.rsc) 215 resource.sources += $$appResourceDir(examples/script/context2d/context2d.rsc) 216 mifs.sources += \ 217 $$appResourceDir(examples/script/context2d/context2d.mif) 218 } 219 220 qmldemos = qmlcalculator qmlclocks qmldialcontrol qmleasing qmlflickr qmlphotoviewer qmltwitter 221 contains(QT_CONFIG, declarative) { 222 for(qmldemo, qmldemos) { 223 executables.sources += $$QT_BUILD_TREE/demos/embedded/$${qmldemo}/$${qmldemo}.exe 224 reg_resource.sources += $$regResourceDir(demos/embedded/$${qmldemo}/$${qmldemo}_reg.rsc) 225 resource.sources += $$appResourceDir(demos/embedded/$${qmldemo}/$${qmldemo}.rsc) 226 mifs.sources += $$appResourceDir(demos/embedded/$${qmldemo}/$${qmldemo}.mif) 227 } 199 228 } 200 229 … … 227 256 mifs desktopservices_music desktopservices_images fluidbackup 228 257 258 contains(QT_CONFIG, declarative):for(qmldemo, qmldemos):include($$QT_BUILD_TREE/demos/embedded/$${qmldemo}/deployment.pri) 259 229 260 DEPLOYMENT.installer_header = 0xA000D7CD 230 261 -
trunk/demos/embedded/fluidlauncher/main.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/embedded/fluidlauncher/pictureflow.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 604 604 img = img.scaled(w, h, Qt::IgnoreAspectRatio, mode); 605 605 606 // slightly larger, to accom odate for the reflection606 // slightly larger, to accommodate for the reflection 607 607 int hs = h * 2; 608 608 int hofs = h / 3; -
trunk/demos/embedded/fluidlauncher/pictureflow.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/embedded/fluidlauncher/slideshow.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/embedded/fluidlauncher/slideshow.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/embedded/lightmaps/lightmaps.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 43 43 #include <QtGui> 44 44 #include <QtNetwork> 45 46 #if defined (Q_OS_SYMBIAN)47 #include "sym_iap_util.h"48 #endif49 45 50 46 #include <math.h> … … 491 487 private: 492 488 LightMaps *map; 489 QNetworkSession *networkSession; 493 490 494 491 public: … … 527 524 #endif 528 525 529 QTimer::singleShot(0, this, SLOT(delayedInit())); 526 QNetworkConfigurationManager manager; 527 if (manager.capabilities() & QNetworkConfigurationManager::NetworkSessionRequired) { 528 // Get saved network configuration 529 QSettings settings(QSettings::UserScope, QLatin1String("Trolltech")); 530 settings.beginGroup(QLatin1String("QtNetwork")); 531 const QString id = 532 settings.value(QLatin1String("DefaultNetworkConfiguration")).toString(); 533 settings.endGroup(); 534 535 // If the saved network configuration is not currently discovered use the system 536 // default 537 QNetworkConfiguration config = manager.configurationFromIdentifier(id); 538 if ((config.state() & QNetworkConfiguration::Discovered) != 539 QNetworkConfiguration::Discovered) { 540 config = manager.defaultConfiguration(); 541 } 542 543 networkSession = new QNetworkSession(config, this); 544 connect(networkSession, SIGNAL(opened()), this, SLOT(sessionOpened())); 545 546 networkSession->open(); 547 } else { 548 networkSession = 0; 549 } 530 550 } 531 551 532 552 private slots: 533 553 534 void delayedInit() { 535 #if defined(Q_OS_SYMBIAN) 536 qt_SetDefaultIap(); 537 #endif 554 void sessionOpened() { 555 // Save the used configuration 556 QNetworkConfiguration config = networkSession->configuration(); 557 QString id; 558 if (config.type() == QNetworkConfiguration::UserChoice) { 559 id = networkSession->sessionProperty( 560 QLatin1String("UserChoiceConfiguration")).toString(); 561 } else { 562 id = config.identifier(); 563 } 564 565 QSettings settings(QSettings::UserScope, QLatin1String("Trolltech")); 566 settings.beginGroup(QLatin1String("QtNetwork")); 567 settings.setValue(QLatin1String("DefaultNetworkConfiguration"), id); 568 settings.endGroup(); 538 569 } 539 570 -
trunk/demos/embedded/lightmaps/lightmaps.pro
r769 r846 6 6 TARGET.UID3 = 0xA000CF75 7 7 include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri) 8 HEADERS += $$QT_SOURCE_TREE/examples/network/qftp/sym_iap_util.h9 LIBS += -lesock -lcommdb -linsock # For IAP selection10 8 TARGET.CAPABILITY = NetworkServices 11 9 TARGET.EPOCHEAPSIZE = 0x20000 0x2000000 -
trunk/demos/embedded/raycasting/raycasting.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 143 143 144 144 for (int ray = 0; ray < bufw; ++ray, u += du, v += dv) { 145 // every time this ray advances 'u' units in x direction,145 // every time this ray advances 'u' units in x direction, 146 146 // it also advanced 'v' units in y direction 147 147 qreal uu = (u < 0) ? -u : u; -
trunk/demos/embedded/styledemo/main.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/embedded/styledemo/stylewidget.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/embedded/styledemo/stylewidget.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/embedded/weatherinfo/weatherinfo.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 44 44 #include <QtNetwork> 45 45 #include <QtSvg> 46 47 #if defined (Q_OS_SYMBIAN)48 #include "sym_iap_util.h"49 #endif50 46 51 47 class WeatherInfo: public QMainWindow … … 68 64 QTimeLine m_timeLine; 69 65 QHash<QString, QString> m_icons; 66 QNetworkAccessManager m_manager; 70 67 71 68 public: … … 99 96 setContextMenuPolicy(Qt::ActionsContextMenu); 100 97 98 connect(&m_manager, SIGNAL(finished(QNetworkReply*)), 99 this, SLOT(handleNetworkData(QNetworkReply*))); 100 101 101 QTimer::singleShot(0, this, SLOT(delayedInit())); 102 102 } … … 104 104 private slots: 105 105 void delayedInit() { 106 #if defined(Q_OS_SYMBIAN)107 qt_SetDefaultIap();108 #endif109 106 request("Oslo"); 110 107 } … … 123 120 digest(QString::fromUtf8(networkReply->readAll())); 124 121 networkReply->deleteLater(); 125 networkReply->manager()->deleteLater();126 122 } 127 123 … … 186 182 url.addEncodedQueryItem("weather", QUrl::toPercentEncoding(location)); 187 183 188 QNetworkAccessManager *manager = new QNetworkAccessManager(this); 189 connect(manager, SIGNAL(finished(QNetworkReply*)), 190 this, SLOT(handleNetworkData(QNetworkReply*))); 191 manager->get(QNetworkRequest(url)); 184 m_manager.get(QNetworkRequest(url)); 192 185 193 186 city = QString(); -
trunk/demos/embedded/weatherinfo/weatherinfo.pro
r769 r846 8 8 TARGET.UID3 = 0xA000CF77 9 9 include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri) 10 HEADERS += $$QT_SOURCE_TREE/examples/network/qftp/sym_iap_util.h11 LIBS += -lesock -lcommdb -linsock # For IAP selection12 10 TARGET.CAPABILITY = NetworkServices 13 11 } -
trunk/demos/embeddeddialogs/customproxy.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/embeddeddialogs/customproxy.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/embeddeddialogs/embeddeddialog.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/embeddeddialogs/embeddeddialog.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/embeddeddialogs/main.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/gradients/gradients.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/gradients/gradients.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/gradients/main.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/interview/main.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/interview/model.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 46 46 Model::Model(int rows, int columns, QObject *parent) 47 47 : QAbstractItemModel(parent), 48 services(QPixmap(":/images/services.png")), 48 49 rc(rows), cc(columns), 49 50 tree(new QVector<Node>(rows, Node(0))) … … 106 107 QVariant Model::headerData(int section, Qt::Orientation orientation, int role) const 107 108 { 108 static QIcon services(QPixmap(":/images/services.png"));109 109 if (role == Qt::DisplayRole) 110 110 return QString::number(section); -
trunk/demos/interview/model.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 45 45 #include <QAbstractItemModel> 46 46 #include <QFileIconProvider> 47 #include <QIcon> 47 48 #include <QVector> 48 49 … … 81 82 int row(Node *node) const; 82 83 84 QIcon services; 83 85 int rc, cc; 84 86 QVector<Node> *tree; -
trunk/demos/macmainwindow/macmainwindow.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/macmainwindow/macmainwindow.mm
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/macmainwindow/main.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/mainwindow/colorswatch.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/mainwindow/colorswatch.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/mainwindow/main.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/mainwindow/mainwindow.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 82 82 ; 83 83 84 Q_DECLARE_METATYPE(QDockWidget::DockWidgetFeatures) 85 84 86 MainWindow::MainWindow(const QMap<QString, QSize> &customSizeHints, 85 87 QWidget *parent, Qt::WindowFlags flags) … … 275 277 void MainWindow::setupDockWidgets(const QMap<QString, QSize> &customSizeHints) 276 278 { 279 qRegisterMetaType<QDockWidget::DockWidgetFeatures>(); 280 277 281 mapper = new QSignalMapper(this); 278 282 connect(mapper, SIGNAL(mapped(int)), this, SLOT(setCorner(int))); … … 330 334 swatch->setTitleBarWidget(titlebar); 331 335 connect(swatch, SIGNAL(topLevelChanged(bool)), titlebar, SLOT(updateMask())); 332 connect(swatch, SIGNAL(featuresChanged(QDockWidget::DockWidgetFeatures)), titlebar, SLOT(updateMask()) );336 connect(swatch, SIGNAL(featuresChanged(QDockWidget::DockWidgetFeatures)), titlebar, SLOT(updateMask()), Qt::QueuedConnection); 333 337 334 338 #ifdef Q_WS_QWS -
trunk/demos/mainwindow/mainwindow.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/mainwindow/toolbar.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/mainwindow/toolbar.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/pathstroke/main.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 49 49 QApplication app(argc, argv); 50 50 51 bool smallScreen = false; 52 for (int i=0; i<argc; i++) 53 if (QString(argv[i]) == "-small-screen") 54 smallScreen = true; 51 bool smallScreen = QApplication::arguments().contains("-small-screen"); 55 52 56 53 PathStrokeWidget pathStrokeWidget(smallScreen); -
trunk/demos/pathstroke/pathstroke.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/pathstroke/pathstroke.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/qmediaplayer/main.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 43 43 #include "mediaplayer.h" 44 44 45 const qreal DefaultVolume = -1.0; 46 45 47 int main (int argc, char *argv[]) 46 48 { … … 51 53 app.setQuitOnLastWindowClosed(true); 52 54 53 bool hasSmallScreen = 55 QString fileName; 56 qreal volume = DefaultVolume; 57 bool smallScreen = false; 54 58 #ifdef Q_OS_SYMBIAN 55 /* On Symbian, we always want fullscreen. One reason is that it's not 56 * possible to launch any demos from the fluidlauncher due to a 57 * limitation in the emulator. */ 58 true 59 #else 60 false 59 smallScreen = true; 61 60 #endif 62 ;63 61 64 QString fileString; 65 const QStringList args(app.arguments()); 66 /* We have a minor problem here, we accept two arguments, both are 67 * optional: 68 * - A file name 69 * - the option "-small-screen", so let's try to cope with that. 70 */ 71 for (int i = 0; i < args.count(); ++i) { 72 const QString &at = args.at(i); 73 74 if (at == QLatin1String("-small-screen")) 75 hasSmallScreen = true; 76 else if (i > 0) // We don't want the app name. 77 fileString = at; 62 QStringList args(app.arguments()); 63 args.removeFirst(); // remove name of executable 64 while (!args.empty()) { 65 const QString &arg = args.first(); 66 if (QLatin1String("-small-screen") == arg || QLatin1String("--small-screen") == arg) { 67 smallScreen = true; 68 } else if (QLatin1String("-volume") == arg || QLatin1String("--volume") == arg) { 69 if (!args.empty()) { 70 args.removeFirst(); 71 volume = qMax(qMin(args.first().toFloat(), float(1.0)), float(0.0)); 72 } 73 } else if (fileName.isNull()) { 74 fileName = arg; 75 } 76 args.removeFirst(); 78 77 } 79 78 80 MediaPlayer player(fileString, hasSmallScreen); 79 MediaPlayer player; 80 player.setSmallScreen(smallScreen); 81 if (DefaultVolume != volume) 82 player.setVolume(volume); 83 if (!fileName.isNull()) 84 player.setFile(fileName); 81 85 82 if ( hasSmallScreen)86 if (smallScreen) 83 87 player.showMaximized(); 84 88 else -
trunk/demos/qmediaplayer/mediaplayer.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 47 47 #include "ui_settings.h" 48 48 49 #ifdef Q_OS_SYMBIAN 50 #include <cdbcols.h> 51 #include <cdblen.h> 52 #include <commdb.h> 53 #endif 49 54 50 55 MediaVideoWidget::MediaVideoWidget(MediaPlayer *player, QWidget *parent) : … … 153 158 154 159 155 MediaPlayer::MediaPlayer(const QString &filePath, 156 const bool hasSmallScreen) : 160 MediaPlayer::MediaPlayer() : 157 161 playButton(0), nextEffect(0), settingsDialog(0), ui(0), 158 162 m_AudioOutput(Phonon::VideoCategory), 159 m_videoWidget(new MediaVideoWidget(this)), 160 m_hasSmallScreen(hasSmallScreen) 163 m_videoWidget(new MediaVideoWidget(this)) 161 164 { 162 165 setWindowTitle(tr("Media Player")); … … 272 275 QAction *openFileAction = fileMenu->addAction(tr("Open &File...")); 273 276 QAction *openUrlAction = fileMenu->addAction(tr("Open &Location...")); 277 #ifdef Q_OS_SYMBIAN 278 QAction *selectIAPAction = fileMenu->addAction(tr("Select &IAP...")); 279 connect(selectIAPAction, SIGNAL(triggered(bool)), this, SLOT(selectIAP())); 280 #endif 274 281 QAction *const openLinkAction = fileMenu->addAction(tr("Open &RAM File...")); 275 282 … … 347 354 Phonon::createPath(&m_MediaObject, m_videoWidget); 348 355 349 if (!filePath.isEmpty())350 setFile(filePath);351 356 resize(minimumSizeHint()); 352 357 } … … 359 364 QRect videoHintRect = QRect(QPoint(0, 0), m_videoWindow.sizeHint()); 360 365 QRect newVideoRect = QApplication::desktop()->screenGeometry().intersected(videoHintRect); 361 if (!m_ hasSmallScreen) {366 if (!m_smallScreen) { 362 367 if (m_MediaObject.hasVideo()) { 363 368 // Flush event que so that sizeHint takes the … … 467 472 } 468 473 474 void MediaPlayer::setVolume(qreal volume) 475 { 476 m_AudioOutput.setVolume(volume); 477 } 478 479 void MediaPlayer::setSmallScreen(bool smallScreen) 480 { 481 m_smallScreen = smallScreen; 482 } 483 469 484 void MediaPlayer::effectChanged() 470 485 { … … 590 605 591 606 if (effectDialog.result() != QDialog::Accepted) { 592 //we need to restore the param aters values607 //we need to restore the parameters values 593 608 int currentIndex = 0; 594 609 foreach(Phonon::EffectParameter param, nextEffect->parameters()) { … … 686 701 // popping up dialogs. We neither want to tamper with the state if the 687 702 // user has paused. 688 if (m_ hasSmallScreen && m_MediaObject.hasVideo()) {703 if (m_smallScreen && m_MediaObject.hasVideo()) { 689 704 if (Phonon::PlayingState == m_MediaObject.state()) { 690 705 m_MediaObject.pause(); … … 717 732 void MediaPlayer::bufferStatus(int percent) 718 733 { 719 if (percent == 0 || percent ==100)734 if (percent == 100) 720 735 progressLabel->setText(QString()); 721 736 else { … … 944 959 m_fullScreenAction->setEnabled(bHasVideo); 945 960 } 961 962 #ifdef Q_OS_SYMBIAN 963 void MediaPlayer::selectIAP() 964 { 965 TRAPD(err, selectIAPL()); 966 if (KErrNone != err) 967 QMessageBox::warning(this, "Phonon Mediaplayer", "Error selecting IAP", QMessageBox::Close); 968 } 969 970 void MediaPlayer::selectIAPL() 971 { 972 QVariant currentIAPValue = m_MediaObject.property("InternetAccessPointName"); 973 QString currentIAPString = currentIAPValue.toString(); 974 bool ok = false; 975 CCommsDatabase *commsDb = CCommsDatabase::NewL(EDatabaseTypeIAP); 976 CleanupStack::PushL(commsDb); 977 commsDb->ShowHiddenRecords(); 978 CCommsDbTableView* view = commsDb->OpenTableLC(TPtrC(IAP)); 979 QStringList items; 980 TInt currentIAP = 0; 981 for (TInt l = view->GotoFirstRecord(), i = 0; l != KErrNotFound; l = view->GotoNextRecord(), i++) { 982 TBuf<KCommsDbSvrMaxColumnNameLength> iapName; 983 view->ReadTextL(TPtrC(COMMDB_NAME), iapName); 984 QString iapString = QString::fromUtf16(iapName.Ptr(), iapName.Length()); 985 items << iapString; 986 if (iapString == currentIAPString) 987 currentIAP = i; 988 } 989 currentIAPString = QInputDialog::getItem(this, tr("Select Access Point"), tr("Select Access Point"), items, currentIAP, false, &ok); 990 if (ok) 991 m_MediaObject.setProperty("InternetAccessPointName", currentIAPString); 992 CleanupStack::PopAndDestroy(2); //commsDB, view 993 } 994 #endif -
trunk/demos/qmediaplayer/mediaplayer.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 105 105 Q_OBJECT 106 106 public: 107 MediaPlayer(const QString &, 108 const bool hasSmallScreen); 107 MediaPlayer(); 109 108 110 109 void dragEnterEvent(QDragEnterEvent *e); … … 116 115 void initVideoWindow(); 117 116 void initSettingsDialog(); 117 void setVolume(qreal volume); 118 void setSmallScreen(bool smallScreen); 118 119 119 120 public slots: … … 141 142 void bufferStatus(int percent); 142 143 void openUrl(); 144 #ifdef Q_OS_SYMBIAN 145 void selectIAP(); 146 #endif 143 147 void openRamFile(); 144 148 void configureEffect(); … … 147 151 private: 148 152 bool playPauseForDialog(); 153 #ifdef Q_OS_SYMBIAN 154 void selectIAPL(); 155 #endif 149 156 150 157 QIcon playIcon; … … 172 179 MediaVideoWidget *m_videoWidget; 173 180 Phonon::Path m_audioOutputPath; 174 const bool m_hasSmallScreen;181 bool m_smallScreen; 175 182 }; 176 183 -
trunk/demos/qmediaplayer/qmediaplayer.pro
r561 r846 34 34 include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri) 35 35 36 LIBS += -lCommDb 37 36 38 TARGET.CAPABILITY="NetworkServices" 37 39 } -
trunk/demos/qtdemo/colors.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/qtdemo/colors.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/qtdemo/demoitem.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/qtdemo/demoitem.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/qtdemo/demoitemanimation.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/qtdemo/demoitemanimation.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/qtdemo/demoscene.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/qtdemo/demoscene.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/qtdemo/demotextitem.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/qtdemo/demotextitem.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/qtdemo/dockitem.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/qtdemo/dockitem.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/qtdemo/examplecontent.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 80 80 { 81 81 QByteArray ba = MenuManager::instance()->getHtml(this->name); 82 QString errorMsg; 83 int errorLine, errorColumn; 82 84 83 85 QDomDocument exampleDoc; 84 exampleDoc.setContent(ba, false); 86 if (!exampleDoc.setContent(ba, false, &errorMsg, &errorLine, &errorColumn)) { 87 qDebug() << errorMsg << errorLine << errorColumn; 88 } 85 89 86 90 QDomNodeList paragraphs = exampleDoc.elementsByTagName("p"); 87 91 if (paragraphs.length() < 1 && Colors::verbose) 88 qDebug() << "- ExampleContent::loadDescription(): Could not load description:" << MenuManager::instance()->info[this->name]["docfile"]; 89 QString description = Colors::contentColor + QLatin1String("Could not load description. Ensure that the documentation for Qt is built."); 92 qDebug() << "- ExampleContent::loadDescription(): Could not load description:" 93 << MenuManager::instance()->info[this->name]["docfile"]; 94 QString description = Colors::contentColor + QLatin1String(""); 95 //QLatin1String("Could not load description. Ensure that the documentation for Qt is built."); // QTBUG-12522: If there is no description why show an error to the user when qDebug above communications the issue (if it is indeed an issue at all) when demos are built? 90 96 for (int p = 0; p < int(paragraphs.length()); ++p) { 91 97 description = this->extractTextFromParagraph(paragraphs.item(p)); … … 100 106 { 101 107 return (!text.contains("[") && 102 text.indexOf(QRegExp(QString("(In )?((The|This) )?(%1 )?.*(tutorial|example|demo|application)").arg(this->name), Qt::CaseInsensitive)) != -1); 108 text.indexOf(QRegExp(QString("(In )?((The|This) )?(%1 )?.*(tutorial|example|demo|application)").arg(this->name), 109 Qt::CaseInsensitive)) != -1); 103 110 } 104 111 -
trunk/demos/qtdemo/examplecontent.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/qtdemo/guide.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/qtdemo/guide.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/qtdemo/guidecircle.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/qtdemo/guidecircle.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/qtdemo/guideline.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/qtdemo/guideline.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/qtdemo/headingitem.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/qtdemo/headingitem.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/qtdemo/imageitem.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/qtdemo/imageitem.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/qtdemo/itemcircleanimation.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/qtdemo/itemcircleanimation.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 62 62 virtual ~ItemCircleAnimation(); 63 63 64 // over idden methods:64 // overridden methods: 65 65 QRectF boundingRect() const; 66 66 void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget * = 0); -
trunk/demos/qtdemo/letteritem.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/qtdemo/letteritem.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/qtdemo/main.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/qtdemo/mainwindow.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 267 267 if (Colors::showFps){ 268 268 this->fpsLabel = new DemoTextItem(QString("FPS: --"), Colors::buttonFont(), Qt::white, -1, this->scene, 0, DemoTextItem::DYNAMIC_TEXT); 269 this->fpsLabel->setZValue(100 );269 this->fpsLabel->setZValue(1000); 270 270 this->fpsLabel->setPos(Colors::stageStartX, 600 - QFontMetricsF(Colors::buttonFont()).height() - 5); 271 271 } 272 272 273 this->companyLogo = new ImageItem(QImage(":/images/trolltech-logo.png"), 1000, 1000, this->scene, 0, true, 0.5f); 274 this->qtLogo = new ImageItem(QImage(":/images/qtlogo_small.png"), 1000, 1000, this->scene, 0, true, 0.5f); 273 this->mainSceneRoot = new QGraphicsWidget(); 274 this->scene->addItem(mainSceneRoot); 275 this->companyLogo = new ImageItem(QImage(":/images/trolltech-logo.png"), 1000, 1000, this->scene, mainSceneRoot, true, 0.5f); 276 this->qtLogo = new ImageItem(QImage(":/images/qtlogo_small.png"), 1000, 1000, this->scene, mainSceneRoot, true, 0.5f); 275 277 this->companyLogo->setZValue(100); 276 278 this->qtLogo->setZValue(100); … … 377 379 QApplication::quit(); 378 380 } 379 else if (event->key() == Qt::Key_ 1){381 else if (event->key() == Qt::Key_F1){ 380 382 QString s(""); 381 383 s += "Rendering system: "; … … 387 389 s += "\nAdapt: "; 388 390 s += Colors::noAdapt ? "off" : "on"; 389 s += "\nAdaption occur ed: ";391 s += "\nAdaption occurred: "; 390 392 s += Colors::adapted ? "yes" : "no"; 391 393 s += "\nOpenGL version: "; … … 416 418 QMessageBox::information(0, QString("Current configuration"), s); 417 419 } 420 QGraphicsView::keyPressEvent(event); 418 421 } 419 422 -
trunk/demos/qtdemo/mainwindow.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 63 63 64 64 QGraphicsScene *scene; 65 QGraphicsWidget* mainSceneRoot; 66 65 67 bool loop; 66 68 … … 73 75 74 76 protected: 75 // Over idden methods:77 // Overridden methods: 76 78 void showEvent(QShowEvent *event); 77 79 void keyPressEvent(QKeyEvent *event); -
trunk/demos/qtdemo/menucontent.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/qtdemo/menucontent.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/qtdemo/menumanager.cpp
r696 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 153 153 this->launchExample(this->currentInfo); 154 154 break; 155 case LAUNCH_QML: 156 this->launchQmlExample(this->currentInfo); 157 break; 155 158 case DOCUMENTATION: 156 159 this->showDocInAssistant(this->currentInfo); … … 170 173 this->score->queueMovie(this->currentInfo + " -buttons -out", Score::NEW_ANIMATION_ONLY); 171 174 this->score->queueMovie("back -out", Score::ONLY_IF_VISIBLE); 175 if(qmlRoot) 176 qmlRoot->setProperty("show", QVariant(false)); 172 177 // book-keeping: 173 178 this->currentMenuCode = ROOT; … … 192 197 this->score->queueMovie(this->currentMenuButtons + " -out", Score::FROM_START, Score::LOCK_ITEMS); 193 198 this->score->queueMovie(this->currentInfo + " -out"); 199 if(qmlRoot) 200 qmlRoot->setProperty("show", QVariant(false)); 194 201 // book-keeping: 195 202 this->currentMenuCode = MENU1; … … 209 216 this->score->queueMovie(this->currentInfo + " -out", Score::NEW_ANIMATION_ONLY); 210 217 this->score->queueMovie(this->currentInfo + " -buttons -out", Score::NEW_ANIMATION_ONLY); 218 if(qmlRoot) 219 qmlRoot->setProperty("show", QVariant(false)); 211 220 // book-keeping: 212 221 this->currentMenuCode = MENU2; … … 243 252 this->score->queueMovie(this->currentInfo + " -out", Score::NEW_ANIMATION_ONLY); 244 253 this->score->queueMovie(this->currentInfo + " -buttons -out", Score::NEW_ANIMATION_ONLY); 254 if(qmlRoot) 255 qmlRoot->setProperty("show", QVariant(false)); 245 256 // book-keeping: 246 257 this->currentMenuCode = MENU1; … … 303 314 // was started to activate assistant and bring it to front: 304 315 QTextStream str(&this->assistantProcess); 305 str << "SetSource " << url << QLatin1Char('\ 0') << endl;316 str << "SetSource " << url << QLatin1Char('\n') << endl; 306 317 } 307 318 … … 344 355 } 345 356 357 void MenuManager::launchQmlExample(const QString &name) 358 { 359 #ifndef QT_NO_DECLARATIVE 360 if(!qmlRoot){ 361 exampleError(QProcess::UnknownError); 362 return; 363 } 364 //resolveQmlFilename - refactor to separate fn? 365 QString dirName = this->info[name]["dirname"]; 366 QString category = this->info[name]["category"]; 367 QString fileName = this->info[name]["filename"]; 368 QDir dir; 369 if (category == "demos") 370 dir = QDir(QLibraryInfo::location(QLibraryInfo::DemosPath)); 371 else 372 dir = QDir(QLibraryInfo::location(QLibraryInfo::ExamplesPath)); 373 QFile file(dir.path() + "/" + dirName + "/" + fileName + "/" + "main.qml"); 374 if(!file.exists()){ 375 //try dirname.qml as well 376 file.setFileName(dir.path() + "/" + dirName + "/" + fileName + "/" + fileName.split('/').last() + ".qml"); 377 if(!file.exists()){ 378 exampleError(QProcess::UnknownError); 379 return; 380 } 381 } 382 383 qmlRoot->setProperty("qmlFile", QVariant(""));//unload component 384 qmlRoot->setProperty("show", QVariant(true)); 385 qmlRoot->setProperty("qmlFile", QUrl::fromLocalFile(file.fileName())); 386 #else 387 exampleError(QProcess::UnknownError); 388 #endif 389 } 390 391 void MenuManager::quitQML() 392 { 393 if(qmlRoot) 394 qmlRoot->setProperty("show", QVariant(false)); 395 } 396 346 397 void MenuManager::exampleFinished() 347 398 { … … 386 437 level2MenuNode = level2MenuNode.nextSibling(); 387 438 } 439 440 qmlRoot = 0; 441 #ifndef QT_NO_DECLARATIVE 442 // Create QML Loader 443 declarativeEngine = new QDeclarativeEngine(this); 444 connect(declarativeEngine, SIGNAL(quit()), 445 this, SLOT(quitQML())); 446 447 QDeclarativeComponent component(declarativeEngine, QUrl("qrc:qml/qmlShell.qml"), this); 448 QDeclarativeItem* qmlRootItem = 0; 449 if(component.isReady()){ 450 qmlRoot = component.create(); 451 qmlRootItem = qobject_cast<QDeclarativeItem*>(qmlRoot); 452 }else{ 453 qDebug() << component.status() << component.errorString(); 454 } 455 456 if(qmlRootItem){ 457 qmlRootItem->setHeight(this->window->scene->sceneRect().height()); 458 qmlRootItem->setWidth(this->window->scene->sceneRect().width()); 459 qmlRootItem->setZValue(101);//Above other items 460 qmlRootItem->setCursor(Qt::ArrowCursor); 461 window->scene->addItem(qmlRootItem); 462 463 //Note that QML adds key handling to the app. 464 window->viewport()->setFocusPolicy(Qt::NoFocus);//Correct keyboard focus handling 465 window->setFocusPolicy(Qt::StrongFocus); 466 window->scene->setStickyFocus(true); 467 window->setFocus(); 468 }else{ 469 qDebug() << "Error initializing QML subsystem, Declarative examples will not work"; 470 } 471 #endif 388 472 } 389 473 … … 393 477 if (this->info.contains(name)) 394 478 qWarning() << "__WARNING: MenuManager::readInfoAboutExample: Demo/example with name" 395 << name << "appears twi ze in the xml-file!__";479 << name << "appears twice in the xml-file!__"; 396 480 397 481 this->info[name]["filename"] = example.attribute("filename"); … … 400 484 this->info[name]["changedirectory"] = example.attribute("changedirectory"); 401 485 this->info[name]["image"] = example.attribute("image"); 486 this->info[name]["qml"] = example.attribute("qml"); 402 487 } 403 488 … … 434 519 dir.cd(fileName); 435 520 521 fileName = fileName.split("/").last(); 436 522 QFile unixFile(dir.path() + "/" + fileName); 437 523 if (unixFile.exists()) return unixFile.fileName(); … … 457 543 458 544 if (category == "demos") 459 return this->helpRootUrl + "demos-" + fileName + ".html";545 return this->helpRootUrl + "demos-" + fileName.replace("/", "-") + ".html"; 460 546 else 461 547 return this->helpRootUrl + dirName.replace("/", "-") + "-" + fileName + ".html"; … … 477 563 QString category = this->info[name]["category"]; 478 564 QString fileName = this->info[name]["filename"]; 565 bool qml = (this->info[name]["qml"] == QLatin1String("true")); 566 if(qml) 567 fileName = QLatin1String("qml-") + fileName.split('/').last(); 479 568 480 569 if (imageName.isEmpty()){ … … 496 585 QString name = el.attribute("name"); 497 586 createMenu(el, MENU1); 498 createInfo(new MenuContentItem(el, this->window->scene, 0), name + " -info");587 createInfo(new MenuContentItem(el, this->window->scene, this->window->mainSceneRoot), name + " -info"); 499 588 500 589 Movie *menuButtonsIn = this->score->insertMovie(name + " -buttons"); … … 508 597 QString name = el.attribute("name"); 509 598 createMenu(el, MENU2); 510 createInfo(new MenuContentItem(el, this->window->scene, 0), name + " -info");599 createInfo(new MenuContentItem(el, this->window->scene, this->window->mainSceneRoot), name + " -info"); 511 600 } 512 601 … … 514 603 { 515 604 QString name = el.attribute("name"); 516 createInfo(new ExampleContent(name, this->window->scene, 0), name);605 createInfo(new ExampleContent(name, this->window->scene, this->window->mainSceneRoot), name); 517 606 518 607 Movie *infoButtonsIn = this->score->insertMovie(name + " -buttons"); … … 521 610 if (el.attribute("executable") != "false") 522 611 createLowRightLeafButton("Launch", 405, LAUNCH, infoButtonsIn, infoButtonsOut, 0); 612 else if(el.attribute("qml") == "true") 613 createLowRightLeafButton("Display", 405, LAUNCH_QML, infoButtonsIn, infoButtonsOut, 0); 523 614 } 524 615 … … 549 640 // create normal menu button 550 641 QString label = currentNode.toElement().attribute("name"); 551 item = new TextButton(label, TextButton::LEFT, type, this->window->scene, 0);642 item = new TextButton(label, TextButton::LEFT, type, this->window->scene, this->window->mainSceneRoot); 552 643 currentNode = currentNode.nextSibling(); 553 644 … … 649 740 Movie *movieIn, Movie *movieOut, Movie *movieShake, const QString &menuString) 650 741 { 651 TextButton *button = new TextButton(label, TextButton::RIGHT, type, this->window->scene, 0, TextButton::PANEL);742 TextButton *button = new TextButton(label, TextButton::RIGHT, type, this->window->scene, this->window->mainSceneRoot, TextButton::PANEL); 652 743 if (!menuString.isNull()) 653 744 button->setMenuString(menuString); … … 691 782 void MenuManager::createLowRightButton(const QString &label, BUTTON_TYPE type, Movie *movieIn, Movie *movieOut, Movie * /*movieShake*/) 692 783 { 693 TextButton *item = new TextButton(label, TextButton::RIGHT, type, this->window->scene, 0, TextButton::PANEL);784 TextButton *item = new TextButton(label, TextButton::RIGHT, type, this->window->scene, this->window->mainSceneRoot, TextButton::PANEL); 694 785 item->setRecursiveVisible(false); 695 786 item->setZValue(10); … … 718 809 void MenuManager::createLowRightLeafButton(const QString &label, int xOffset, BUTTON_TYPE type, Movie *movieIn, Movie *movieOut, Movie * /*movieShake*/) 719 810 { 720 TextButton *item = new TextButton(label, TextButton::RIGHT, type, this->window->scene, 0, TextButton::PANEL);811 TextButton *item = new TextButton(label, TextButton::RIGHT, type, this->window->scene, this->window->mainSceneRoot, TextButton::PANEL); 721 812 item->setRecursiveVisible(false); 722 813 item->setZValue(10); … … 834 925 float yOffset = 450.0f; 835 926 836 this->upButton = new TextButton("", TextButton::LEFT, MenuManager::UP, this->window->scene, 0, TextButton::UP);927 this->upButton = new TextButton("", TextButton::LEFT, MenuManager::UP, this->window->scene, this->window->mainSceneRoot, TextButton::UP); 837 928 this->upButton->prepare(); 838 929 this->upButton->setPos(xOffset, yOffset); 839 930 this->upButton->setState(TextButton::DISABLED); 840 931 841 this->downButton = new TextButton("", TextButton::LEFT, MenuManager::DOWN, this->window->scene, 0, TextButton::DOWN);932 this->downButton = new TextButton("", TextButton::LEFT, MenuManager::DOWN, this->window->scene, this->window->mainSceneRoot, TextButton::DOWN); 842 933 this->downButton->prepare(); 843 934 this->downButton->setPos(xOffset + 10 + this->downButton->sceneBoundingRect().width(), yOffset); -
trunk/demos/qtdemo/menumanager.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 46 46 #include <QtXml> 47 47 #include <QtHelp/QHelpEngineCore> 48 #ifndef QT_NO_DECLARATIVE 49 #include <QtDeclarative> 50 #endif 48 51 49 52 #include "score.h" … … 62 65 63 66 public: 64 enum BUTTON_TYPE {ROOT, MENU1, MENU2, LAUNCH, DOCUMENTATION, QUIT, FULLSCREEN, UP, DOWN, BACK };67 enum BUTTON_TYPE {ROOT, MENU1, MENU2, LAUNCH, DOCUMENTATION, QUIT, FULLSCREEN, UP, DOWN, BACK, LAUNCH_QML}; 65 68 66 69 // singleton pattern: … … 84 87 int currentMenuCode; 85 88 89 QObject *qmlRoot; 90 #ifndef QT_NO_DECLARATIVE 91 QDeclarativeEngine* declarativeEngine; 92 #endif 93 86 94 private slots: 87 95 void exampleFinished(); 88 96 void exampleError(QProcess::ProcessError error); 97 98 void quitQML(); 89 99 90 100 private: … … 101 111 void showDocInAssistant(const QString &docFile); 102 112 void launchExample(const QString &uniqueName); 113 void launchQmlExample(const QString &uniqueName); 103 114 104 115 void createMenu(const QDomElement &category, BUTTON_TYPE type); … … 129 140 TextButton *upButton; 130 141 TextButton *downButton; 142 131 143 }; 132 144 -
trunk/demos/qtdemo/qtdemo.pro
r695 r846 1 CONFIG += assistanthelp x11inc1 CONFIG += help x11inc 2 2 TARGET = qtdemo 3 3 DEMO_DESTDIR = $$QT_BUILD_TREE … … 12 12 DEFINES += QT_OPENGL_SUPPORT 13 13 QT += opengl 14 } 15 16 contains(QT_CONFIG, declarative) { 17 QT += declarative 14 18 } 15 19 … … 76 80 sources.path = $$[QT_INSTALL_DEMOS]/qtdemo 77 81 82 OTHER_FILES += \ 83 qmlShell.qml -
trunk/demos/qtdemo/qtdemo.qrc
r2 r846 1 <!DOCTYPE RCC><RCC version="1.0"> 2 <qresource prefix="/"> 3 <file>xml/examples.xml</file> 4 <file>images/qtlogo_small.png</file> 5 <file>images/trolltech-logo.png</file> 6 <file>images/demobg.png</file> 7 </qresource> 1 <RCC> 2 <qresource prefix="/"> 3 <file>xml/examples.xml</file> 4 <file>images/qtlogo_small.png</file> 5 <file>images/trolltech-logo.png</file> 6 <file>images/demobg.png</file> 7 </qresource> 8 <qresource prefix="/qml" lang="qml"> 9 <file>qmlShell.qml</file> 10 </qresource> 8 11 </RCC> -
trunk/demos/qtdemo/qtdemo.rc
r651 r846 19 19 VALUE "FileDescription", "Qt Examples and Demos" 20 20 VALUE "FileVersion", "1.0.0.0" 21 VALUE "LegalCopyright", "Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies)."21 VALUE "LegalCopyright", "Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies)." 22 22 VALUE "InternalName", "qtdemo" 23 23 VALUE "OriginalFilename", "qtdemo.exe" -
trunk/demos/qtdemo/scanitem.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/qtdemo/scanitem.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/qtdemo/score.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/qtdemo/score.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/qtdemo/textbutton.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/qtdemo/textbutton.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 62 62 virtual ~TextButton(); 63 63 64 // over idden methods:64 // overridden methods: 65 65 virtual QRectF boundingRect() const; 66 66 virtual void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget * = 0){}; -
trunk/demos/qtdemo/xml/examples.xml
r769 r846 2 2 <categories name="Qt Examples and Demos"> 3 3 <demos dirname="." docname="demos" name="Demonstrations"> 4 <example filename="declarative/samegame" name="SameGame" executable="false" qml="true"/> 5 <example filename="declarative/flickr" name="Flickr Client" executable="false" qml="true"/> 4 6 <example filename="affine" name="Affine Transformations" /> 5 <example filename="arthurplugin" name="Arthur Plugin" executable="false" />6 7 <example filename="composition" name="Composition Modes" /> 7 8 <example filename="gradients" name="Gradients" /> 8 9 <example filename="pathstroke" name="Path Stroking" /> 10 <example filename="textedit" name="Text Edit" /> 11 <example filename="chip" name="40000 Chips" /> 12 <example filename="embeddeddialogs" name="Embedded Dialogs" /> 13 <example filename="interview" name="Interview" /> 14 <example filename="declarative/rssnews" name="Rss Client" executable="false" qml="true"/> 15 <example filename="declarative/twitter" name="Twitter Client" executable="false" qml="true"/> 16 <example filename="browser" name="Browser" /> 17 <example filename="qmediaplayer" name="Media Player" /> 18 <example filename="boxes" name="Boxes" /> 19 <example filename="sub-attaq" name="Sub-attaq" /> 20 <example filename="spectrum" name="Spectrum Analyzer" /> 21 <example filename="declarative/minehunt" name="Minehunt"/> 9 22 <example filename="deform" name="Vector Deformation" /> 10 23 <example filename="books" name="Books" /> … … 12 25 <example filename="spreadsheet" name="Spreadsheet" /> 13 26 <example filename="sqlbrowser" name="SQL Browser" /> 14 <example filename="textedit" name="Text Edit" /> 15 <example filename="chip" name="40000 Chips" /> 16 <example filename="embeddeddialogs" name="Embedded Dialogs" /> 17 <example filename="interview" name="Interview" /> 18 <example filename="browser" name="Browser" /> 19 <example filename="qmediaplayer" name="Media Player" /> 20 <example filename="boxes" name="Boxes" /> 21 <example filename="sub-attaq" name="Sub-attaq" /> 22 <example filename="spectrum" name="Spectrum Analyzer" /> 27 <example filename="arthurplugin" name="Arthur Plugin" executable="false" /> 28 23 29 </demos> 24 30 <category dirname="animation" name="Animation Framework"> … … 35 41 <example filename="runfunction" name="Run Function" executable="false"/> 36 42 <example filename="wordcount" name="Word Count" executable="false" /> 43 </category> 44 <category dirname="declarative/toys" name="Qt Declarative Examples"> 45 <example filename="dynamicscene" name="Dynamic Scene" executable="false" qml="true" /> 46 <example filename="tic-tac-toe" name="Tic Tac Toe" executable="false" qml="true" /> 47 <example filename="clocks" name="Clocks" executable="false" qml="true" /> 48 <example filename="corkboards" name="Corkboards" executable="false" qml="true" /> 49 <example filename="tvtennis" name="TV Tennis" executable="false" qml="true" /> 37 50 </category> 38 51 <category dirname="designer" name="Qt Designer"> … … 116 129 <example filename="menus" name="Menus" /> 117 130 <example filename="recentfiles" name="Recent Files" /> 131 </category> 132 <category dirname="declarative/ui-components" name="QML UI Components"> 133 <example filename="dialcontrol" name="Dial" executable="false" qml="true" /> 134 <example filename="flipable" name="Flipable" executable="false" qml="true" /> 135 <example filename="progressbar" name="Progress bar" executable="false" qml="true" /> 136 <example filename="scrollbar" name="Scroll bar" executable="false" qml="true" /> 137 <example filename="searchbox" name="Search box" executable="false" qml="true" /> 138 <example filename="slideswitch" name="Slide switch" executable="false" qml="true" /> 139 <example filename="spinner" name="Spinner" executable="false" qml="true" /> 140 <example filename="tabwidget" name="Tab widget" executable="false" qml="true" /> 118 141 </category> 119 142 <category dirname="network" name="Networking"> -
trunk/demos/shared/arthurstyle.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/shared/arthurstyle.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/shared/arthurwidgets.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/shared/arthurwidgets.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/shared/hoverpoints.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/shared/hoverpoints.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/shared/shared.pri
r561 r846 7 7 contains(CONFIG, debug_and_release_target) { 8 8 CONFIG(debug, debug|release) { 9 LIBS+=-L$$SHARED_FOLDER/debug9 QMAKE_LIBDIR += $$SHARED_FOLDER/debug 10 10 } else { 11 LIBS+=-L$$SHARED_FOLDER/release11 QMAKE_LIBDIR += $$SHARED_FOLDER/release 12 12 } 13 13 } else { 14 LIBS += -L$$SHARED_FOLDER14 QMAKE_LIBDIR += $$SHARED_FOLDER 15 15 } 16 16 -
trunk/demos/spectrum/3rdparty/fftreal/fftreal.pro
r769 r846 1 include(../../spectrum.pri) 2 3 static: error(This library cannot be built for static linkage) 4 1 5 TEMPLATE = lib 2 6 TARGET = fftreal … … 30 34 symbian { 31 35 # Provide unique ID for the generated binary, required by Symbian OS 32 TARGET.UID3 = 0xA000E 3FB36 TARGET.UID3 = 0xA000E403 33 37 TARGET.CAPABILITY = UserEnvironment 38 } 39 40 macx { 41 CONFIG += lib_bundle 34 42 } else { 35 macx { 36 CONFIG += lib_bundle 37 } else { 38 DESTDIR = ../../bin 39 } 40 } 43 !symbian: DESTDIR = ../..$${spectrum_build_dir} 44 } 41 45 42 46 # Install -
trunk/demos/spectrum/3rdparty/fftreal/fftreal_wrapper.cpp
r769 r846 1 1 /*************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 5 ** -
trunk/demos/spectrum/3rdparty/fftreal/fftreal_wrapper.h
r769 r846 1 1 /*************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 5 ** -
trunk/demos/spectrum/app/app.pro
r769 r846 1 1 include(../spectrum.pri) 2 3 static: error(This application cannot be statically linked to the fftreal library) 2 4 3 5 TEMPLATE = app 4 6 5 7 TARGET = spectrum 6 unix: !macx: !symbian: TARGET = spectrum.bin7 8 8 9 QT += multimedia … … 49 50 50 51 # Provide unique ID for the generated binary, required by Symbian OS 51 TARGET.UID3 = 0xA000E 3FA52 TARGET.UID3 = 0xA000E402 52 53 } 53 54 … … 58 59 # Must explicitly add the .dll suffix to ensure dynamic linkage 59 60 LIBS += -lfftreal.dll 61 QMAKE_LIBDIR += $${fftreal_dir} 60 62 } else { 61 63 macx { … … 64 66 LIBS += -framework fftreal 65 67 } else { 66 # Link to dynamic library which is written to ../bin 67 LIBS += -L../bin 68 LIBS += -L..$${spectrum_build_dir} 68 69 LIBS += -lfftreal 69 70 } … … 86 87 !contains(DEFINES, DISABLE_FFT) { 87 88 # Include FFTReal DLL in the SIS file 88 fftreal.sources = $${EPOCROOT}epoc32/release/$(PLATFORM)/$(TARGET)/fftreal.dll89 fftreal.sources = ../fftreal.dll 89 90 fftreal.path = !:/sys/bin 90 91 DEPLOYMENT += fftreal 91 92 } 92 93 } else { 94 DESTDIR = ..$${spectrum_build_dir} 93 95 macx { 94 # Specify directory in which to create spectrum.app bundle95 DESTDIR = ..96 97 96 !contains(DEFINES, DISABLE_FFT) { 98 97 # Relocate fftreal.framework into spectrum.app bundle … … 110 109 } 111 110 } else { 112 # Specify directory in which to create spectrum application 113 DESTDIR = ../bin 114 115 unix: !symbian { 116 # On unices other than Mac OSX, we copy a shell script into the bin directory. 117 # This script takes care of correctly setting the LD_LIBRARY_PATH so that 118 # the dynamic library can be located. 119 copy_launch_script.target = copy_launch_script 120 copy_launch_script.commands = \ 121 install -m 0555 $$QT_SOURCE_TREE/demos/spectrum/app/spectrum.sh ../bin/spectrum 122 QMAKE_EXTRA_TARGETS += copy_launch_script 123 POST_TARGETDEPS += copy_launch_script 111 linux-g++*: { 112 # Provide relative path from application to fftreal library 113 QMAKE_LFLAGS += -Wl,--rpath=\\\$\$ORIGIN 124 114 } 125 115 } -
trunk/demos/spectrum/app/engine.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 86 86 , m_generateTone(false) 87 87 , m_file(0) 88 , m_analysisFile(0) 88 89 , m_availableAudioInputDevices 89 90 (QAudioDeviceInfo::availableDevices(QAudio::AudioInput)) … … 97 98 , m_audioOutput(0) 98 99 , m_playPosition(0) 100 , m_bufferPosition(0) 101 , m_bufferLength(0) 99 102 , m_dataLength(0) 103 , m_levelBufferLength(0) 100 104 , m_rmsLevel(0.0) 101 105 , m_peakLevel(0.0) 102 , m_spectrum LengthBytes(0)106 , m_spectrumBufferLength(0) 103 107 , m_spectrumAnalyser() 104 108 , m_spectrumPosition(0) … … 106 110 { 107 111 qRegisterMetaType<FrequencySpectrum>("FrequencySpectrum"); 112 qRegisterMetaType<WindowFunction>("WindowFunction"); 108 113 CHECKED_CONNECT(&m_spectrumAnalyser, 109 114 SIGNAL(spectrumChanged(FrequencySpectrum)), … … 133 138 bool Engine::loadFile(const QString &fileName) 134 139 { 140 reset(); 135 141 bool result = false; 136 m_generateTone = false;137 142 Q_ASSERT(!m_generateTone); 143 Q_ASSERT(!m_file); 138 144 Q_ASSERT(!fileName.isEmpty()); 139 Q_ASSERT(!m_file); 140 m_file = new QFile(fileName, this); 141 m_file->setFileName(fileName); 142 Q_ASSERT(m_file->exists()); 143 if (m_file->open(QFile::ReadOnly)) { 144 m_wavFile.readHeader(*m_file); 145 if (isPCMS16LE(m_wavFile.format())) { 145 m_file = new WavFile(this); 146 if (m_file->open(fileName)) { 147 if (isPCMS16LE(m_file->fileFormat())) { 146 148 result = initialize(); 147 149 } else { 148 150 emit errorMessage(tr("Audio format not supported"), 149 formatToString(m_ wavFile.format()));151 formatToString(m_file->fileFormat())); 150 152 } 151 153 } else { 152 154 emit errorMessage(tr("Could not open file"), fileName); 153 155 } 154 155 delete m_file;156 m_file = 0;157 156 if (result) { 157 m_analysisFile = new WavFile(this); 158 m_analysisFile->open(fileName); 159 } 158 160 return result; 159 161 } … … 161 163 bool Engine::generateTone(const Tone &tone) 162 164 { 165 reset(); 166 Q_ASSERT(!m_generateTone); 163 167 Q_ASSERT(!m_file); 164 168 m_generateTone = true; … … 173 177 bool Engine::generateSweptTone(qreal amplitude) 174 178 { 179 Q_ASSERT(!m_generateTone); 175 180 Q_ASSERT(!m_file); 176 181 m_generateTone = true; … … 186 191 bool Engine::initializeRecord() 187 192 { 193 reset(); 188 194 ENGINE_DEBUG << "Engine::initializeRecord"; 195 Q_ASSERT(!m_generateTone); 189 196 Q_ASSERT(!m_file); 190 197 m_generateTone = false; … … 193 200 } 194 201 195 qint64 Engine::bufferDuration() const 196 { 197 return BufferDurationUs; 198 } 199 200 qint64 Engine::dataDuration() const 201 { 202 qint64 result = 0; 203 if (QAudioFormat() != m_format) 204 result = audioDuration(m_format, m_dataLength); 205 return result; 206 } 207 208 qint64 Engine::audioBufferLength() const 209 { 210 qint64 length = 0; 211 if (QAudio::ActiveState == m_state || QAudio::IdleState == m_state) { 212 Q_ASSERT(QAudioFormat() != m_format); 213 switch (m_mode) { 214 case QAudio::AudioInput: 215 length = m_audioInput->bufferSize(); 216 break; 217 case QAudio::AudioOutput: 218 length = m_audioOutput->bufferSize(); 219 break; 220 } 221 } 222 return length; 202 qint64 Engine::bufferLength() const 203 { 204 return m_file ? m_file->size() : m_bufferLength; 223 205 } 224 206 … … 253 235 m_count = 0; 254 236 m_dataLength = 0; 255 emit data DurationChanged(0);237 emit dataLengthChanged(0); 256 238 m_audioInputIODevice = m_audioInput->start(); 257 239 CHECKED_CONNECT(m_audioInputIODevice, SIGNAL(readyRead()), … … 276 258 m_spectrumAnalyser.cancelCalculation(); 277 259 spectrumChanged(0, 0, FrequencySpectrum()); 278 279 260 setPlayPosition(0, true); 280 261 stopRecording(); … … 285 266 this, SLOT(audioNotify())); 286 267 m_count = 0; 287 m_audioOutputIODevice.close(); 288 m_audioOutputIODevice.setBuffer(&m_buffer); 289 m_audioOutputIODevice.open(QIODevice::ReadOnly); 290 m_audioOutput->start(&m_audioOutputIODevice); 268 if (m_file) { 269 m_file->seek(0); 270 m_bufferPosition = 0; 271 m_dataLength = 0; 272 m_audioOutput->start(m_file); 273 } else { 274 m_audioOutputIODevice.close(); 275 m_audioOutputIODevice.setBuffer(&m_buffer); 276 m_audioOutputIODevice.open(QIODevice::ReadOnly); 277 m_audioOutput->start(&m_audioOutputIODevice); 278 } 291 279 } 292 280 } … … 333 321 switch (m_mode) { 334 322 case QAudio::AudioInput: { 335 const qint64 recordPosition = 336 qMin(BufferDurationUs, m_audioInput->processedUSecs()); 323 const qint64 recordPosition = qMin(m_bufferLength, audioLength(m_format, m_audioInput->processedUSecs())); 337 324 setRecordPosition(recordPosition); 338 339 // Calculate level of most recently captured data 340 qint64 levelLength = audioLength(m_format, LevelWindowUs); 341 levelLength = qMin(m_dataLength, levelLength); 342 const qint64 levelPosition = m_dataLength - levelLength; 343 calculateLevel(levelPosition, levelLength); 344 345 // Calculate spectrum of most recently captured data 346 if (m_dataLength >= m_spectrumLengthBytes) { 347 const qint64 spectrumPosition = m_dataLength - m_spectrumLengthBytes; 325 const qint64 levelPosition = m_dataLength - m_levelBufferLength; 326 if (levelPosition >= 0) 327 calculateLevel(levelPosition, m_levelBufferLength); 328 if (m_dataLength >= m_spectrumBufferLength) { 329 const qint64 spectrumPosition = m_dataLength - m_spectrumBufferLength; 348 330 calculateSpectrum(spectrumPosition); 349 331 } 332 emit bufferChanged(0, m_dataLength, m_buffer); 350 333 } 351 334 break; 352 335 case QAudio::AudioOutput: { 353 const qint64 playPosition = 354 qMin(dataDuration(), m_audioOutput->processedUSecs()); 355 setPlayPosition(playPosition); 356 357 qint64 analysisPosition = audioLength(m_format, playPosition); 358 359 // Calculate level of data starting at current playback position 360 const qint64 levelLength = audioLength(m_format, LevelWindowUs); 361 if (analysisPosition + levelLength < m_dataLength) 362 calculateLevel(analysisPosition, levelLength); 363 364 if (analysisPosition + m_spectrumLengthBytes < m_dataLength) 365 calculateSpectrum(analysisPosition); 366 367 if (dataDuration() == playPosition) 368 stopPlayback(); 336 const qint64 playPosition = audioLength(m_format, m_audioOutput->processedUSecs()); 337 setPlayPosition(qMin(bufferLength(), playPosition)); 338 const qint64 levelPosition = playPosition - m_levelBufferLength; 339 const qint64 spectrumPosition = playPosition - m_spectrumBufferLength; 340 if (m_file) { 341 if (levelPosition > m_bufferPosition || 342 spectrumPosition > m_bufferPosition || 343 qMax(m_levelBufferLength, m_spectrumBufferLength) > m_dataLength) { 344 m_bufferPosition = 0; 345 m_dataLength = 0; 346 // Data needs to be read into m_buffer in order to be analysed 347 const qint64 readPos = qMax(qint64(0), qMin(levelPosition, spectrumPosition)); 348 const qint64 readEnd = qMin(m_analysisFile->size(), qMax(levelPosition + m_levelBufferLength, spectrumPosition + m_spectrumBufferLength)); 349 const qint64 readLen = readEnd - readPos + audioLength(m_format, WaveformWindowDuration); 350 qDebug() << "Engine::audioNotify [1]" 351 << "analysisFileSize" << m_analysisFile->size() 352 << "readPos" << readPos 353 << "readLen" << readLen; 354 if (m_analysisFile->seek(readPos + m_analysisFile->headerLength())) { 355 m_buffer.resize(readLen); 356 m_bufferPosition = readPos; 357 m_dataLength = m_analysisFile->read(m_buffer.data(), readLen); 358 qDebug() << "Engine::audioNotify [2]" << "bufferPosition" << m_bufferPosition << "dataLength" << m_dataLength; 359 } else { 360 qDebug() << "Engine::audioNotify [2]" << "file seek error"; 361 } 362 emit bufferChanged(m_bufferPosition, m_dataLength, m_buffer); 363 } 364 } else { 365 if (playPosition >= m_dataLength) 366 stopPlayback(); 367 } 368 if (levelPosition >= 0 && levelPosition + m_levelBufferLength < m_bufferPosition + m_dataLength) 369 calculateLevel(levelPosition, m_levelBufferLength); 370 if (spectrumPosition >= 0 && spectrumPosition + m_spectrumBufferLength < m_bufferPosition + m_dataLength) 371 calculateSpectrum(spectrumPosition); 369 372 } 370 373 break; … … 377 380 << "to" << state; 378 381 379 if (QAudio::StoppedState == state) { 380 // Check error 381 QAudio::Error error = QAudio::NoError; 382 switch (m_mode) { 383 case QAudio::AudioInput: 384 error = m_audioInput->error(); 385 break; 386 case QAudio::AudioOutput: 387 error = m_audioOutput->error(); 388 break; 389 } 390 if (QAudio::NoError != error) { 391 reset(); 392 return; 393 } 394 } 395 setState(state); 382 if (QAudio::IdleState == state && m_file && m_file->pos() == m_file->size()) { 383 stopPlayback(); 384 } else { 385 if (QAudio::StoppedState == state) { 386 // Check error 387 QAudio::Error error = QAudio::NoError; 388 switch (m_mode) { 389 case QAudio::AudioInput: 390 error = m_audioInput->error(); 391 break; 392 case QAudio::AudioOutput: 393 error = m_audioOutput->error(); 394 break; 395 } 396 if (QAudio::NoError != error) { 397 reset(); 398 return; 399 } 400 } 401 setState(state); 402 } 396 403 } 397 404 398 405 void Engine::audioDataReady() 399 406 { 407 Q_ASSERT(0 == m_bufferPosition); 400 408 const qint64 bytesReady = m_audioInput->bytesReady(); 401 409 const qint64 bytesSpace = m_buffer.size() - m_dataLength; … … 408 416 if (bytesRead) { 409 417 m_dataLength += bytesRead; 410 411 const qint64 duration = audioDuration(m_format, m_dataLength); 412 emit dataDurationChanged(duration); 418 emit dataLengthChanged(dataLength()); 413 419 } 414 420 … … 420 426 { 421 427 ENGINE_DEBUG << "Engine::spectrumChanged" << "pos" << m_spectrumPosition; 422 const qint64 positionUs = audioDuration(m_format, m_spectrumPosition); 423 const qint64 lengthUs = audioDuration(m_format, m_spectrumLengthBytes); 424 emit spectrumChanged(positionUs, lengthUs, spectrum); 428 emit spectrumChanged(m_spectrumPosition, m_spectrumBufferLength, spectrum); 425 429 } 426 430 … … 430 434 //----------------------------------------------------------------------------- 431 435 432 void Engine::reset() 433 { 434 stopRecording(); 435 stopPlayback(); 436 setState(QAudio::AudioInput, QAudio::StoppedState); 437 setFormat(QAudioFormat()); 436 void Engine::resetAudioDevices() 437 { 438 438 delete m_audioInput; 439 439 m_audioInput = 0; … … 443 443 m_audioOutput = 0; 444 444 setPlayPosition(0); 445 m_spectrumPosition = 0; 446 setLevel(0.0, 0.0, 0); 447 } 448 449 void Engine::reset() 450 { 451 stopRecording(); 452 stopPlayback(); 453 setState(QAudio::AudioInput, QAudio::StoppedState); 454 setFormat(QAudioFormat()); 455 m_generateTone = false; 456 delete m_file; 457 m_file = 0; 458 delete m_analysisFile; 459 m_analysisFile = 0; 445 460 m_buffer.clear(); 461 m_bufferPosition = 0; 462 m_bufferLength = 0; 446 463 m_dataLength = 0; 447 m_spectrumPosition = 0; 448 emit dataDurationChanged(0); 449 setLevel(0.0, 0.0, 0); 464 emit dataLengthChanged(0); 465 resetAudioDevices(); 450 466 } 451 467 … … 454 470 bool result = false; 455 471 456 reset();472 QAudioFormat format = m_format; 457 473 458 474 if (selectFormat()) { 459 const qint64 bufferLength = audioLength(m_format, BufferDurationUs); 460 m_buffer.resize(bufferLength); 461 m_buffer.fill(0); 462 emit bufferDurationChanged(BufferDurationUs); 463 464 if (m_generateTone) { 465 if (0 == m_tone.endFreq) { 466 const qreal nyquist = nyquistFrequency(m_format); 467 m_tone.endFreq = qMin(qreal(SpectrumHighFreq), nyquist); 475 if (m_format != format) { 476 resetAudioDevices(); 477 if (m_file) { 478 emit bufferLengthChanged(bufferLength()); 479 emit dataLengthChanged(dataLength()); 480 emit bufferChanged(0, 0, m_buffer); 481 setRecordPosition(bufferLength()); 482 result = true; 483 } else { 484 m_bufferLength = audioLength(m_format, BufferDurationUs); 485 m_buffer.resize(m_bufferLength); 486 m_buffer.fill(0); 487 emit bufferLengthChanged(bufferLength()); 488 if (m_generateTone) { 489 if (0 == m_tone.endFreq) { 490 const qreal nyquist = nyquistFrequency(m_format); 491 m_tone.endFreq = qMin(qreal(SpectrumHighFreq), nyquist); 492 } 493 // Call function defined in utils.h, at global scope 494 ::generateTone(m_tone, m_format, m_buffer); 495 m_dataLength = m_bufferLength; 496 emit dataLengthChanged(dataLength()); 497 emit bufferChanged(0, m_dataLength, m_buffer); 498 setRecordPosition(m_bufferLength); 499 result = true; 500 } else { 501 emit bufferChanged(0, 0, m_buffer); 502 m_audioInput = new QAudioInput(m_audioInputDevice, m_format, this); 503 m_audioInput->setNotifyInterval(NotifyIntervalMs); 504 result = true; 505 } 468 506 } 469 470 // Call function defined in utils.h, at global scope 471 ::generateTone(m_tone, m_format, m_buffer); 472 m_dataLength = m_buffer.size(); 473 emit dataDurationChanged(bufferDuration()); 474 setRecordPosition(bufferDuration()); 475 result = true; 476 } else if (m_file) { 477 const qint64 length = m_wavFile.readData(*m_file, m_buffer, m_format); 478 if (length) { 479 m_dataLength = length; 480 emit dataDurationChanged(dataDuration()); 481 setRecordPosition(dataDuration()); 482 result = true; 483 } 484 } else { 485 m_audioInput = new QAudioInput(m_audioInputDevice, m_format, this); 486 m_audioInput->setNotifyInterval(NotifyIntervalMs); 487 result = true; 488 } 489 490 m_audioOutput = new QAudioOutput(m_audioOutputDevice, m_format, this); 491 m_audioOutput->setNotifyInterval(NotifyIntervalMs); 492 m_spectrumLengthBytes = SpectrumLengthSamples * 493 (m_format.sampleSize() / 8) * m_format.channels(); 507 m_audioOutput = new QAudioOutput(m_audioOutputDevice, m_format, this); 508 m_audioOutput->setNotifyInterval(NotifyIntervalMs); 509 } 494 510 } else { 495 511 if (m_file) … … 502 518 } 503 519 520 ENGINE_DEBUG << "Engine::initialize" << "m_bufferLength" << m_bufferLength; 521 ENGINE_DEBUG << "Engine::initialize" << "m_dataLength" << m_dataLength; 504 522 ENGINE_DEBUG << "Engine::initialize" << "format" << m_format; 505 523 … … 511 529 bool foundSupportedFormat = false; 512 530 513 if (m_file) { 514 // Header is read from the WAV file; just need to check whether 515 // it is supported by the audio output device 516 QAudioFormat format = m_wavFile.format(); 517 if (m_audioOutputDevice.isFormatSupported(m_wavFile.format())) { 518 setFormat(m_wavFile.format()); 531 if (m_file || QAudioFormat() != m_format) { 532 QAudioFormat format = m_format; 533 if (m_file) 534 // Header is read from the WAV file; just need to check whether 535 // it is supported by the audio output device 536 format = m_file->fileFormat(); 537 if (m_audioOutputDevice.isFormatSupported(format)) { 538 setFormat(format); 519 539 foundSupportedFormat = true; 520 } else {521 // Try flipping mono <-> stereo522 const int channels = (format.channels() == 1) ? 2 : 1;523 format.setChannels(channels);524 if (m_audioOutputDevice.isFormatSupported(format)) {525 setFormat(format);526 foundSupportedFormat = true;527 }528 540 } 529 541 } else { … … 649 661 Q_UNUSED(length) 650 662 #else 651 Q_ASSERT(position + length <= m_ dataLength);663 Q_ASSERT(position + length <= m_bufferPosition + m_dataLength); 652 664 653 665 qreal peakLevel = 0.0; 654 666 655 667 qreal sum = 0.0; 656 const char *ptr = m_buffer.constData() + position ;668 const char *ptr = m_buffer.constData() + position - m_bufferPosition; 657 669 const char *const end = ptr + length; 658 670 while (ptr < end) { … … 680 692 Q_UNUSED(position) 681 693 #else 682 Q_ASSERT(position + m_spectrum LengthBytes <=m_dataLength);683 Q_ASSERT(0 == m_spectrum LengthBytes% 2); // constraint of FFT algorithm694 Q_ASSERT(position + m_spectrumBufferLength <= m_bufferPosition + m_dataLength); 695 Q_ASSERT(0 == m_spectrumBufferLength % 2); // constraint of FFT algorithm 684 696 685 697 // QThread::currentThread is marked 'for internal use only', but 686 698 // we're only using it for debug output here, so it's probably OK :) 687 699 ENGINE_DEBUG << "Engine::calculateSpectrum" << QThread::currentThread() 688 << "count" << m_count << "pos" << position << "len" << m_spectrum LengthBytes700 << "count" << m_count << "pos" << position << "len" << m_spectrumBufferLength 689 701 << "spectrumAnalyser.isReady" << m_spectrumAnalyser.isReady(); 690 702 691 703 if(m_spectrumAnalyser.isReady()) { 692 m_spectrumBuffer = QByteArray::fromRawData(m_buffer.constData() + position ,693 m_spectrum LengthBytes);704 m_spectrumBuffer = QByteArray::fromRawData(m_buffer.constData() + position - m_bufferPosition, 705 m_spectrumBufferLength); 694 706 m_spectrumPosition = position; 695 707 m_spectrumAnalyser.calculate(m_spectrumBuffer, m_format); … … 702 714 const bool changed = (format != m_format); 703 715 m_format = format; 716 m_levelBufferLength = audioLength(m_format, LevelWindowUs); 717 m_spectrumBufferLength = SpectrumLengthSamples * 718 (m_format.sampleSize() / 8) * m_format.channels(); 704 719 if (changed) 705 720 emit formatChanged(m_format); -
trunk/demos/spectrum/app/engine.h
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 66 66 67 67 class FrequencySpectrum; 68 69 68 QT_FORWARD_DECLARE_CLASS(QAudioInput) 70 69 QT_FORWARD_DECLARE_CLASS(QAudioOutput) … … 93 92 94 93 /** 95 * \return Reference to internal audio buffer96 * \note This reference is valid for the lifetime of the Engine97 */98 const QByteArray& buffer() const { return m_buffer; }99 100 /**101 94 * \return Current audio format 102 95 * \note May be QAudioFormat() if engine is not initialized … … 131 124 /** 132 125 * Position of the audio input device. 133 * \return Position in microseconds.126 * \return Position in bytes. 134 127 */ 135 128 qint64 recordPosition() const { return m_recordPosition; } … … 149 142 /** 150 143 * Position of the audio output device. 151 * \return Position in microseconds.144 * \return Position in bytes. 152 145 */ 153 146 qint64 playPosition() const { return m_playPosition; } … … 155 148 /** 156 149 * Length of the internal engine buffer. 157 * \return Buffer length in microseconds.158 */ 159 qint64 buffer Duration() const;150 * \return Buffer length in bytes. 151 */ 152 qint64 bufferLength() const; 160 153 161 154 /** 162 155 * Amount of data held in the buffer. 163 * \return Data duration in microseconds. 164 */ 165 qint64 dataDuration() const; 166 167 /** 168 * Returns the size of the underlying audio buffer in bytes. 169 * This should be an approximation of the capture latency. 170 */ 171 qint64 audioBufferLength() const; 156 * \return Data length in bytes. 157 */ 158 qint64 dataLength() const { return m_dataLength; } 172 159 173 160 /** … … 205 192 * \param duration Duration in microseconds 206 193 */ 207 void buffer DurationChanged(qint64 duration);194 void bufferLengthChanged(qint64 duration); 208 195 209 196 /** 210 197 * Amount of data in buffer has changed. 211 * \param duration Duration of data in microseconds212 */ 213 void data DurationChanged(qint64 duration);198 * \param Length of data in bytes 199 */ 200 void dataLengthChanged(qint64 duration); 214 201 215 202 /** 216 203 * Position of the audio input device has changed. 217 * \param position Position in microseconds204 * \param position Position in bytes 218 205 */ 219 206 void recordPositionChanged(qint64 position); … … 221 208 /** 222 209 * Position of the audio output device has changed. 223 * \param position Position in microseconds210 * \param position Position in bytes 224 211 */ 225 212 void playPositionChanged(qint64 position); … … 229 216 * \param rmsLevel RMS level in range 0.0 - 1.0 230 217 * \param peakLevel Peak level in range 0.0 - 1.0 231 * \param numSamples Number of audio samples analy sed218 * \param numSamples Number of audio samples analyzed 232 219 */ 233 220 void levelChanged(qreal rmsLevel, qreal peakLevel, int numSamples); … … 235 222 /** 236 223 * Spectrum has changed. 237 * \param position Position of start of window in microseconds238 * \param length Length of window in microseconds224 * \param position Position of start of window in bytes 225 * \param length Length of window in bytes 239 226 * \param spectrum Resulting frequency spectrum 240 227 */ 241 228 void spectrumChanged(qint64 position, qint64 length, const FrequencySpectrum &spectrum); 229 230 /** 231 * Buffer containing audio data has changed. 232 * \param position Position of start of buffer in bytes 233 * \param buffer Buffer 234 */ 235 void bufferChanged(qint64 position, qint64 length, const QByteArray &buffer); 242 236 243 237 private slots: … … 248 242 249 243 private: 244 void resetAudioDevices(); 250 245 bool initialize(); 251 246 bool selectFormat(); … … 277 272 SweptTone m_tone; 278 273 279 QFile* m_file; 280 WavFile m_wavFile; 274 WavFile* m_file; 275 // We need a second file handle via which to read data into m_buffer 276 // for analysis 277 WavFile* m_analysisFile; 281 278 282 279 QAudioFormat m_format; … … 295 292 296 293 QByteArray m_buffer; 294 qint64 m_bufferPosition; 295 qint64 m_bufferLength; 297 296 qint64 m_dataLength; 298 297 298 int m_levelBufferLength; 299 299 qreal m_rmsLevel; 300 300 qreal m_peakLevel; 301 301 302 int m_spectrum LengthBytes;302 int m_spectrumBufferLength; 303 303 QByteArray m_spectrumBuffer; 304 304 SpectrumAnalyser m_spectrumAnalyser; -
trunk/demos/spectrum/app/frequencyspectrum.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/spectrum/app/frequencyspectrum.h
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/spectrum/app/levelmeter.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/spectrum/app/levelmeter.h
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 47 47 /** 48 48 * Widget which displays a vertical audio level meter, indicating the 49 * RMS and peak levels of the window of audio samples most recently analy sed49 * RMS and peak levels of the window of audio samples most recently analyzed 50 50 * by the Engine. 51 51 */ -
trunk/demos/spectrum/app/main.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 45 45 { 46 46 QApplication app(argc, argv); 47 app.setApplicationName("QtMultimedia spectrum analy ser");47 app.setApplicationName("QtMultimedia spectrum analyzer"); 48 48 MainWidget w; 49 49 -
trunk/demos/spectrum/app/mainwidget.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 66 66 , m_engine(new Engine(this)) 67 67 #ifndef DISABLE_WAVEFORM 68 , m_waveform(new Waveform( m_engine->buffer(),this))68 , m_waveform(new Waveform(this)) 69 69 #endif 70 70 , m_progressBar(new ProgressBar(this)) … … 167 167 } 168 168 169 void MainWidget::positionChanged(qint64 positionUs) 170 { 171 #ifndef DISABLE_WAVEFORM 172 qint64 positionBytes = audioLength(m_engine->format(), positionUs); 173 m_waveform->positionChanged(positionBytes); 169 void MainWidget::audioPositionChanged(qint64 position) 170 { 171 #ifndef DISABLE_WAVEFORM 172 m_waveform->audioPositionChanged(position); 174 173 #else 175 Q_UNUSED(position Us)176 #endif 177 } 178 179 void MainWidget::buffer DurationChanged(qint64 durationUs)180 { 181 m_progressBar->buffer DurationChanged(durationUs);174 Q_UNUSED(position) 175 #endif 176 } 177 178 void MainWidget::bufferLengthChanged(qint64 length) 179 { 180 m_progressBar->bufferLengthChanged(length); 182 181 } 183 182 … … 187 186 //----------------------------------------------------------------------------- 188 187 189 void MainWidget::dataDurationChanged(qint64 duration)190 {191 #ifndef DISABLE_WAVEFORM192 const qint64 dataLength = audioLength(m_engine->format(), duration);193 m_waveform->dataLengthChanged(dataLength);194 #else195 Q_UNUSED(duration)196 #endif197 198 updateButtonStates();199 }200 201 188 void MainWidget::showFileDialog() 202 189 { 203 reset();204 190 const QString dir; 205 191 const QStringList fileNames = QFileDialog::getOpenFileNames(this, tr("Open WAV file"), dir, "*.wav"); 206 192 if (fileNames.count()) { 193 reset(); 207 194 setMode(LoadFileMode); 208 195 m_engine->loadFile(fileNames.front()); 209 196 updateButtonStates(); 197 } else { 198 updateModeMenu(); 210 199 } 211 200 } … … 213 202 void MainWidget::showSettingsDialog() 214 203 { 215 reset();216 204 m_settingsDialog->exec(); 217 205 if (m_settingsDialog->result() == QDialog::Accepted) { … … 224 212 void MainWidget::showToneGeneratorDialog() 225 213 { 226 reset();227 214 m_toneGeneratorDialog->exec(); 228 215 if (m_toneGeneratorDialog->result() == QDialog::Accepted) { 216 reset(); 229 217 setMode(GenerateToneMode); 230 218 const qreal amplitude = m_toneGeneratorDialog->amplitude(); … … 237 225 updateButtonStates(); 238 226 } 227 } else { 228 updateModeMenu(); 239 229 } 240 230 } … … 361 351 this, SLOT(formatChanged(const QAudioFormat &))); 362 352 363 m_progressBar->buffer DurationChanged(m_engine->bufferDuration());364 365 CHECKED_CONNECT(m_engine, SIGNAL(buffer DurationChanged(qint64)),366 this, SLOT(buffer DurationChanged(qint64)));367 368 CHECKED_CONNECT(m_engine, SIGNAL(data DurationChanged(qint64)),369 this, SLOT( dataDurationChanged(qint64)));353 m_progressBar->bufferLengthChanged(m_engine->bufferLength()); 354 355 CHECKED_CONNECT(m_engine, SIGNAL(bufferLengthChanged(qint64)), 356 this, SLOT(bufferLengthChanged(qint64))); 357 358 CHECKED_CONNECT(m_engine, SIGNAL(dataLengthChanged(qint64)), 359 this, SLOT(updateButtonStates())); 370 360 371 361 CHECKED_CONNECT(m_engine, SIGNAL(recordPositionChanged(qint64)), … … 376 366 377 367 CHECKED_CONNECT(m_engine, SIGNAL(recordPositionChanged(qint64)), 378 this, SLOT( positionChanged(qint64)));368 this, SLOT(audioPositionChanged(qint64))); 379 369 380 370 CHECKED_CONNECT(m_engine, SIGNAL(playPositionChanged(qint64)), 381 this, SLOT( positionChanged(qint64)));371 this, SLOT(audioPositionChanged(qint64))); 382 372 383 373 CHECKED_CONNECT(m_engine, SIGNAL(levelChanged(qreal, qreal, int)), … … 395 385 CHECKED_CONNECT(m_spectrograph, SIGNAL(infoMessage(QString, int)), 396 386 this, SLOT(infoMessage(QString, int))); 387 388 #ifndef DISABLE_WAVEFORM 389 CHECKED_CONNECT(m_engine, SIGNAL(bufferChanged(qint64, qint64, const QByteArray &)), 390 m_waveform, SLOT(bufferChanged(qint64, qint64, const QByteArray &))); 391 #endif 397 392 } 398 393 … … 426 421 m_pauseButton->setEnabled(pauseEnabled); 427 422 428 const bool playEnabled = ( m_engine->dataDuration() &&423 const bool playEnabled = (/*m_engine->dataLength() &&*/ 429 424 (QAudio::AudioOutput != m_engine->mode() || 430 425 (QAudio::ActiveState != m_engine->state() && … … 446 441 void MainWidget::setMode(Mode mode) 447 442 { 448 449 443 m_mode = mode; 450 m_loadFileAction->setChecked(LoadFileMode == mode); 451 m_generateToneAction->setChecked(GenerateToneMode == mode); 452 m_recordAction->setChecked(RecordMode == mode); 453 } 454 444 updateModeMenu(); 445 } 446 447 void MainWidget::updateModeMenu() 448 { 449 m_loadFileAction->setChecked(LoadFileMode == m_mode); 450 m_generateToneAction->setChecked(GenerateToneMode == m_mode); 451 m_recordAction->setChecked(RecordMode == m_mode); 452 } 453 -
trunk/demos/spectrum/app/mainwidget.h
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 81 81 void infoMessage(const QString &message, int timeoutMs); 82 82 void errorMessage(const QString &heading, const QString &detail); 83 void positionChanged(qint64 position);84 void buffer DurationChanged(qint64 duration);83 void audioPositionChanged(qint64 position); 84 void bufferLengthChanged(qint64 length); 85 85 86 86 private slots: … … 89 89 void showToneGeneratorDialog(); 90 90 void initializeRecord(); 91 void dataDurationChanged(qint64 duration); 91 void updateModeMenu(); 92 void updateButtonStates(); 92 93 93 94 private: … … 95 96 void createMenus(); 96 97 void connectUi(); 97 void updateButtonStates();98 98 void reset(); 99 99 … … 112 112 Engine* m_engine; 113 113 114 #ifndef DISABLE_WAVEFORM 114 115 Waveform* m_waveform; 116 #endif 115 117 ProgressBar* m_progressBar; 116 118 Spectrograph* m_spectrograph; -
trunk/demos/spectrum/app/progressbar.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 45 45 ProgressBar::ProgressBar(QWidget *parent) 46 46 : QWidget(parent) 47 , m_buffer Duration(0)47 , m_bufferLength(0) 48 48 , m_recordPosition(0) 49 49 , m_playPosition(0) … … 65 65 void ProgressBar::reset() 66 66 { 67 m_buffer Duration= 0;67 m_bufferLength = 0; 68 68 m_recordPosition = 0; 69 69 m_playPosition = 0; … … 87 87 #endif 88 88 89 if (m_buffer Duration) {89 if (m_bufferLength) { 90 90 QRect bar = rect(); 91 const qreal play = qreal(m_playPosition) / m_buffer Duration;91 const qreal play = qreal(m_playPosition) / m_bufferLength; 92 92 bar.setLeft(rect().left() + play * rect().width()); 93 const qreal record = qreal(m_recordPosition) / m_buffer Duration;93 const qreal record = qreal(m_recordPosition) / m_bufferLength; 94 94 bar.setRight(rect().left() + record * rect().width()); 95 95 painter.fillRect(bar, bufferColor); 96 96 97 97 QRect window = rect(); 98 const qreal windowLeft = qreal(m_windowPosition) / m_buffer Duration;98 const qreal windowLeft = qreal(m_windowPosition) / m_bufferLength; 99 99 window.setLeft(rect().left() + windowLeft * rect().width()); 100 const qreal windowWidth = qreal(m_windowLength) / m_buffer Duration;100 const qreal windowWidth = qreal(m_windowLength) / m_bufferLength; 101 101 window.setWidth(windowWidth * rect().width()); 102 102 painter.fillRect(window, windowColor); … … 104 104 } 105 105 106 void ProgressBar::buffer DurationChanged(qint64 bufferSize)106 void ProgressBar::bufferLengthChanged(qint64 bufferSize) 107 107 { 108 m_buffer Duration= bufferSize;108 m_bufferLength = bufferSize; 109 109 m_recordPosition = 0; 110 110 m_playPosition = 0; … … 117 117 { 118 118 Q_ASSERT(recordPosition >= 0); 119 Q_ASSERT(recordPosition <= m_buffer Duration);119 Q_ASSERT(recordPosition <= m_bufferLength); 120 120 m_recordPosition = recordPosition; 121 121 repaint(); … … 125 125 { 126 126 Q_ASSERT(playPosition >= 0); 127 Q_ASSERT(playPosition <= m_buffer Duration);127 Q_ASSERT(playPosition <= m_bufferLength); 128 128 m_playPosition = playPosition; 129 129 repaint(); … … 133 133 { 134 134 Q_ASSERT(position >= 0); 135 Q_ASSERT(position <= m_buffer Duration);136 Q_ASSERT(position + length <= m_buffer Duration);135 Q_ASSERT(position <= m_bufferLength); 136 Q_ASSERT(position + length <= m_bufferLength); 137 137 m_windowPosition = position; 138 138 m_windowLength = length; -
trunk/demos/spectrum/app/progressbar.h
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 58 58 59 59 public slots: 60 void buffer DurationChanged(qint64 bufferSize);60 void bufferLengthChanged(qint64 length); 61 61 void recordPositionChanged(qint64 recordPosition); 62 62 void playPositionChanged(qint64 playPosition); … … 64 64 65 65 private: 66 qint64 m_buffer Duration;66 qint64 m_bufferLength; 67 67 qint64 m_recordPosition; 68 68 qint64 m_playPosition; -
trunk/demos/spectrum/app/settingsdialog.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/spectrum/app/settingsdialog.h
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/spectrum/app/spectrograph.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/spectrum/app/spectrograph.h
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 49 49 /** 50 50 * Widget which displays a spectrograph showing the frequency spectrum 51 * of the window of audio samples most recently analy sed by the Engine.51 * of the window of audio samples most recently analyzed by the Engine. 52 52 */ 53 53 class Spectrograph : public QWidget { -
trunk/demos/spectrum/app/spectrum.h
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/spectrum/app/spectrumanalyser.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 65 65 { 66 66 #ifdef SPECTRUM_ANALYSER_SEPARATE_THREAD 67 // moveToThread() cannot be called on a QObject with a parent 68 setParent(0); 67 69 moveToThread(m_thread); 68 70 m_thread->start(); … … 125 127 m_fft->calculateFFT(m_output.data(), m_input.data()); 126 128 127 // Analy se output to obtain amplitude and phase for each frequency129 // Analyze output to obtain amplitude and phase for each frequency 128 130 for (int i=2; i<=m_numSamples/2; ++i) { 129 131 // Calculate frequency of this complex sample -
trunk/demos/spectrum/app/spectrumanalyser.h
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/spectrum/app/tonegenerator.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/spectrum/app/tonegenerator.h
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/spectrum/app/tonegeneratordialog.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/spectrum/app/tonegeneratordialog.h
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/spectrum/app/utils.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 50 50 qint64 audioLength(const QAudioFormat &format, qint64 microSeconds) 51 51 { 52 return(format.frequency() * format.channels() * (format.sampleSize() / 8))52 qint64 result = (format.frequency() * format.channels() * (format.sampleSize() / 8)) 53 53 * microSeconds / 1000000; 54 result -= result % (format.channelCount() * format.sampleSize()); 55 return result; 54 56 } 55 57 -
trunk/demos/spectrum/app/utils.h
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/spectrum/app/waveform.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 45 45 #include <QDebug> 46 46 47 48 Waveform::Waveform(const QByteArray &buffer, QWidget *parent) 47 //#define PAINT_EVENT_TRACE 48 #ifdef PAINT_EVENT_TRACE 49 # define WAVEFORM_PAINT_DEBUG qDebug() 50 #else 51 # define WAVEFORM_PAINT_DEBUG nullDebug() 52 #endif 53 54 Waveform::Waveform(QWidget *parent) 49 55 : QWidget(parent) 50 , m_buffer (buffer)51 , m_ dataLength(0)52 , m_ position(0)56 , m_bufferPosition(0) 57 , m_bufferLength(0) 58 , m_audioPosition(0) 53 59 , m_active(false) 54 60 , m_tileLength(0) … … 73 79 74 80 if (m_active) { 75 WAVEFORM_ DEBUG << "Waveform::paintEvent"76 << "windowPosition" << m_windowPosition77 << "windowLength" << m_windowLength;81 WAVEFORM_PAINT_DEBUG << "Waveform::paintEvent" 82 << "windowPosition" << m_windowPosition 83 << "windowLength" << m_windowLength; 78 84 qint64 pos = m_windowPosition; 79 85 const qint64 windowEnd = m_windowPosition + m_windowLength; … … 82 88 while (pos < windowEnd) { 83 89 const TilePoint point = tilePoint(pos); 84 WAVEFORM_ DEBUG << "Waveform::paintEvent" << "pos" << pos85 << "tileIndex" << point.index86 << "positionOffset" << point.positionOffset87 << "pixelOffset" << point.pixelOffset;90 WAVEFORM_PAINT_DEBUG << "Waveform::paintEvent" << "pos" << pos 91 << "tileIndex" << point.index 92 << "positionOffset" << point.positionOffset 93 << "pixelOffset" << point.pixelOffset; 88 94 89 95 if (point.index != NullIndex) { … … 105 111 sourceRect.setRight(sourceRight); 106 112 107 WAVEFORM_ DEBUG << "Waveform::paintEvent" << "tileIndex" << point.index108 << "source" << point.pixelOffset << sourceRight109 << "dest" << destLeft << destRight;113 WAVEFORM_PAINT_DEBUG << "Waveform::paintEvent" << "tileIndex" << point.index 114 << "source" << point.pixelOffset << sourceRight 115 << "dest" << destLeft << destRight; 110 116 111 117 painter.drawPixmap(destRect, *tile.pixmap, sourceRect); … … 115 121 if (point.index < m_tiles.count()) { 116 122 pos = tilePosition(point.index + 1); 117 WAVEFORM_ DEBUG << "Waveform::paintEvent" << "pos ->" << pos;123 WAVEFORM_PAINT_DEBUG << "Waveform::paintEvent" << "pos ->" << pos; 118 124 } else { 119 125 // Reached end of tile array 120 WAVEFORM_ DEBUG << "Waveform::paintEvent" << "reached end of tile array";126 WAVEFORM_PAINT_DEBUG << "Waveform::paintEvent" << "reached end of tile array"; 121 127 break; 122 128 } 123 129 } else { 124 130 // Passed last tile which is painted 125 WAVEFORM_ DEBUG << "Waveform::paintEvent" << "tile" << point.index << "not painted";131 WAVEFORM_PAINT_DEBUG << "Waveform::paintEvent" << "tile" << point.index << "not painted"; 126 132 break; 127 133 } 128 134 } else { 129 135 // pos is past end of tile array 130 WAVEFORM_ DEBUG << "Waveform::paintEvent" << "pos" << pos << "past end of tile array";136 WAVEFORM_PAINT_DEBUG << "Waveform::paintEvent" << "pos" << pos << "past end of tile array"; 131 137 break; 132 138 } 133 139 } 134 140 135 WAVEFORM_ DEBUG << "Waveform::paintEvent" << "final pos" << pos << "final x" << destRight;141 WAVEFORM_PAINT_DEBUG << "Waveform::paintEvent" << "final pos" << pos << "final x" << destRight; 136 142 } 137 143 } … … 147 153 WAVEFORM_DEBUG << "Waveform::initialize" 148 154 << "audioBufferSize" << audioBufferSize 149 << "m_buffer.size()" << m_buffer.size()150 155 << "windowDurationUs" << windowDurationUs; 151 156 … … 187 192 WAVEFORM_DEBUG << "Waveform::reset"; 188 193 189 m_dataLength = 0; 190 m_position = 0; 194 m_bufferPosition = 0; 195 m_buffer = QByteArray(); 196 m_audioPosition = 0; 191 197 m_format = QAudioFormat(); 192 198 m_active = false; … … 199 205 } 200 206 201 void Waveform::dataLengthChanged(qint64 length) 202 { 203 WAVEFORM_DEBUG << "Waveform::dataLengthChanged" << length; 204 const qint64 oldLength = m_dataLength; 205 m_dataLength = length; 206 207 if (m_active) { 208 if (m_dataLength < oldLength) 209 positionChanged(m_dataLength); 210 else 211 paintTiles(); 212 } 213 } 214 215 void Waveform::positionChanged(qint64 position) 216 { 217 WAVEFORM_DEBUG << "Waveform::positionChanged" << position; 218 219 if (position + m_windowLength > m_dataLength) 220 position = m_dataLength - m_windowLength; 221 222 m_position = position; 223 224 setWindowPosition(position); 207 void Waveform::bufferChanged(qint64 position, qint64 length, const QByteArray &buffer) 208 { 209 WAVEFORM_DEBUG << "Waveform::bufferChanged" 210 << "audioPosition" << m_audioPosition 211 << "bufferPosition" << position 212 << "bufferLength" << length; 213 m_bufferPosition = position; 214 m_bufferLength = length; 215 m_buffer = buffer; 216 paintTiles(); 217 } 218 219 void Waveform::audioPositionChanged(qint64 position) 220 { 221 WAVEFORM_DEBUG << "Waveform::audioPositionChanged" 222 << "audioPosition" << position 223 << "bufferPosition" << m_bufferPosition 224 << "bufferLength" << m_bufferLength; 225 226 if (position >= m_bufferPosition) { 227 if (position + m_windowLength > m_bufferPosition + m_bufferLength) 228 position = qMax(qint64(0), m_bufferPosition + m_bufferLength - m_windowLength); 229 m_audioPosition = position; 230 setWindowPosition(position); 231 } 225 232 } 226 233 … … 256 263 m_tiles[i].painted = false; 257 264 } 258 259 paintTiles();260 265 } 261 266 … … 328 333 const Tile &tile = m_tiles[i]; 329 334 if (!tile.painted) { 330 const qint64 tileEnd = m_tileArrayStart + (i + 1) * m_tileLength; 331 if (m_dataLength >= tileEnd) { 335 const qint64 tileStart = m_tileArrayStart + i * m_tileLength; 336 const qint64 tileEnd = tileStart + m_tileLength; 337 if (m_bufferPosition <= tileStart && m_bufferPosition + m_bufferLength >= tileEnd) { 332 338 paintTile(i); 333 339 updateRequired = true; … … 344 350 void Waveform::paintTile(int index) 345 351 { 346 WAVEFORM_DEBUG << "Waveform::paintTile" << "index" << index;347 348 352 const qint64 tileStart = m_tileArrayStart + index * m_tileLength; 349 Q_ASSERT(m_dataLength >= tileStart + m_tileLength); 353 354 WAVEFORM_DEBUG << "Waveform::paintTile" 355 << "index" << index 356 << "bufferPosition" << m_bufferPosition 357 << "bufferLength" << m_bufferLength 358 << "start" << tileStart 359 << "end" << tileStart + m_tileLength; 360 361 Q_ASSERT(m_bufferPosition <= tileStart); 362 Q_ASSERT(m_bufferPosition + m_bufferLength >= tileStart + m_tileLength); 350 363 351 364 Tile &tile = m_tiles[index]; … … 353 366 354 367 const qint16* base = reinterpret_cast<const qint16*>(m_buffer.constData()); 355 const qint16* buffer = base + ( tileStart/ 2);368 const qint16* buffer = base + ((tileStart - m_bufferPosition) / 2); 356 369 const int numSamples = m_tileLength / (2 * m_format.channels()); 357 370 … … 377 390 for (int i=0; i<numSamples; ++i) { 378 391 const qint16* ptr = buffer + i * m_format.channels(); 392 393 const int offset = reinterpret_cast<const char*>(ptr) - m_buffer.constData(); 394 Q_ASSERT(offset >= 0); 395 Q_ASSERT(offset < m_bufferLength); 396 379 397 const qint16 pcmValue = *ptr; 380 398 const qreal realValue = pcmToReal(pcmValue); -
trunk/demos/spectrum/app/waveform.h
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 61 61 Q_OBJECT 62 62 public: 63 Waveform( const QByteArray &buffer,QWidget *parent = 0);63 Waveform(QWidget *parent = 0); 64 64 ~Waveform(); 65 65 … … 74 74 75 75 public slots: 76 void dataLengthChanged(qint64 length);77 void positionChanged(qint64 position);76 void bufferChanged(qint64 position, qint64 length, const QByteArray &buffer); 77 void audioPositionChanged(qint64 position); 78 78 79 79 private: … … 168 168 169 169 private: 170 const QByteArray& m_buffer; 171 qint64 m_dataLength; 172 qint64 m_position; 170 qint64 m_bufferPosition; 171 qint64 m_bufferLength; 172 QByteArray m_buffer; 173 174 qint64 m_audioPosition; 173 175 QAudioFormat m_format; 174 176 -
trunk/demos/spectrum/app/wavfile.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 77 77 RIFFHeader riff; 78 78 WAVEHeader wave; 79 DATAHeader data;80 79 }; 81 80 82 static const int HeaderLength = sizeof(CombinedHeader); 83 84 85 WavFile::WavFile(const QAudioFormat &format, qint64 dataLength) 86 : m_format(format) 87 , m_dataLength(dataLength) 81 WavFile::WavFile(QObject *parent) 82 : QFile(parent) 83 , m_headerLength(0) 88 84 { 89 85 90 86 } 91 87 92 bool WavFile:: readHeader(QIODevice &device)88 bool WavFile::open(const QString &fileName) 93 89 { 94 bool result = true; 90 close(); 91 setFileName(fileName); 92 return QFile::open(QIODevice::ReadOnly) && readHeader(); 93 } 95 94 96 if (!device.isSequential()) 97 result = device.seek(0); 98 // else, assume that current position is the start of the header 95 const QAudioFormat &WavFile::fileFormat() const 96 { 97 return m_fileFormat; 98 } 99 99 100 qint64 WavFile::headerLength() const 101 { 102 return m_headerLength; 103 } 104 105 bool WavFile::readHeader() 106 { 107 seek(0); 108 CombinedHeader header; 109 bool result = read(reinterpret_cast<char *>(&header), sizeof(CombinedHeader)) == sizeof(CombinedHeader); 100 110 if (result) { 101 CombinedHeader header; 102 result = (device.read(reinterpret_cast<char *>(&header), HeaderLength) == HeaderLength); 103 if (result) { 104 if ((memcmp(&header.riff.descriptor.id, "RIFF", 4) == 0 105 || memcmp(&header.riff.descriptor.id, "RIFX", 4) == 0) 106 && memcmp(&header.riff.type, "WAVE", 4) == 0 107 && memcmp(&header.wave.descriptor.id, "fmt ", 4) == 0 108 && header.wave.audioFormat == 1 // PCM 109 ) { 110 if (memcmp(&header.riff.descriptor.id, "RIFF", 4) == 0) 111 m_format.setByteOrder(QAudioFormat::LittleEndian); 112 else 113 m_format.setByteOrder(QAudioFormat::BigEndian); 111 if ((memcmp(&header.riff.descriptor.id, "RIFF", 4) == 0 112 || memcmp(&header.riff.descriptor.id, "RIFX", 4) == 0) 113 && memcmp(&header.riff.type, "WAVE", 4) == 0 114 && memcmp(&header.wave.descriptor.id, "fmt ", 4) == 0 115 && (header.wave.audioFormat == 1 || header.wave.audioFormat == 0)) { 114 116 115 m_format.setChannels(qFromLittleEndian<quint16>(header.wave.numChannels)); 116 m_format.setCodec("audio/pcm"); 117 m_format.setFrequency(qFromLittleEndian<quint32>(header.wave.sampleRate)); 118 m_format.setSampleSize(qFromLittleEndian<quint16>(header.wave.bitsPerSample)); 117 // Read off remaining header information 118 DATAHeader dataHeader; 119 119 120 switch(header.wave.bitsPerSample) { 121 case 8: 122 m_format.setSampleType(QAudioFormat::UnSignedInt); 123 break; 124 case 16: 125 m_format.setSampleType(QAudioFormat::SignedInt); 126 break; 127 default: 128 result = false; 129 } 120 if (qFromLittleEndian<quint32>(header.wave.descriptor.size) > sizeof(WAVEHeader)) { 121 // Extended data available 122 quint16 extraFormatBytes; 123 if (peek((char*)&extraFormatBytes, sizeof(quint16)) != sizeof(quint16)) 124 return false; 125 const qint64 throwAwayBytes = sizeof(quint16) + qFromLittleEndian<quint16>(extraFormatBytes); 126 if (read(throwAwayBytes).size() != throwAwayBytes) 127 return false; 128 } 130 129 131 m_dataLength = device.size() - HeaderLength; 132 } else { 133 result = false; 134 } 130 if (read((char*)&dataHeader, sizeof(DATAHeader)) != sizeof(DATAHeader)) 131 return false; 132 133 // Establish format 134 if (memcmp(&header.riff.descriptor.id, "RIFF", 4) == 0) 135 m_fileFormat.setByteOrder(QAudioFormat::LittleEndian); 136 else 137 m_fileFormat.setByteOrder(QAudioFormat::BigEndian); 138 139 int bps = qFromLittleEndian<quint16>(header.wave.bitsPerSample); 140 m_fileFormat.setChannels(qFromLittleEndian<quint16>(header.wave.numChannels)); 141 m_fileFormat.setCodec("audio/pcm"); 142 m_fileFormat.setFrequency(qFromLittleEndian<quint32>(header.wave.sampleRate)); 143 m_fileFormat.setSampleSize(qFromLittleEndian<quint16>(header.wave.bitsPerSample)); 144 m_fileFormat.setSampleType(bps == 8 ? QAudioFormat::UnSignedInt : QAudioFormat::SignedInt); 145 } else { 146 result = false; 135 147 } 136 148 } 137 149 m_headerLength = pos(); 138 150 return result; 139 151 } 140 141 bool WavFile::writeHeader(QIODevice &device)142 {143 CombinedHeader header;144 145 memset(&header, 0, HeaderLength);146 147 // RIFF header148 if (m_format.byteOrder() == QAudioFormat::LittleEndian)149 strncpy(&header.riff.descriptor.id[0], "RIFF", 4);150 else151 strncpy(&header.riff.descriptor.id[0], "RIFX", 4);152 qToLittleEndian<quint32>(quint32(m_dataLength + HeaderLength - 8),153 reinterpret_cast<unsigned char*>(&header.riff.descriptor.size));154 strncpy(&header.riff.type[0], "WAVE", 4);155 156 // WAVE header157 strncpy(&header.wave.descriptor.id[0], "fmt ", 4);158 qToLittleEndian<quint32>(quint32(16),159 reinterpret_cast<unsigned char*>(&header.wave.descriptor.size));160 qToLittleEndian<quint16>(quint16(1),161 reinterpret_cast<unsigned char*>(&header.wave.audioFormat));162 qToLittleEndian<quint16>(quint16(m_format.channels()),163 reinterpret_cast<unsigned char*>(&header.wave.numChannels));164 qToLittleEndian<quint32>(quint32(m_format.frequency()),165 reinterpret_cast<unsigned char*>(&header.wave.sampleRate));166 qToLittleEndian<quint32>(quint32(m_format.frequency() * m_format.channels() * m_format.sampleSize() / 8),167 reinterpret_cast<unsigned char*>(&header.wave.byteRate));168 qToLittleEndian<quint16>(quint16(m_format.channels() * m_format.sampleSize() / 8),169 reinterpret_cast<unsigned char*>(&header.wave.blockAlign));170 qToLittleEndian<quint16>(quint16(m_format.sampleSize()),171 reinterpret_cast<unsigned char*>(&header.wave.bitsPerSample));172 173 // DATA header174 strncpy(&header.data.descriptor.id[0], "data", 4);175 qToLittleEndian<quint32>(quint32(m_dataLength),176 reinterpret_cast<unsigned char*>(&header.data.descriptor.size));177 178 return (device.write(reinterpret_cast<const char *>(&header), HeaderLength) == HeaderLength);179 }180 181 const QAudioFormat& WavFile::format() const182 {183 return m_format;184 }185 186 qint64 WavFile::dataLength() const187 {188 return m_dataLength;189 }190 191 qint64 WavFile::headerLength()192 {193 return HeaderLength;194 }195 196 bool WavFile::writeDataLength(QIODevice &device, qint64 dataLength)197 {198 bool result = false;199 if (!device.isSequential()) {200 device.seek(40);201 unsigned char dataLengthLE[4];202 qToLittleEndian<quint32>(quint32(dataLength), dataLengthLE);203 result = (device.write(reinterpret_cast<const char *>(dataLengthLE), 4) == 4);204 }205 return result;206 }207 208 #include <QFile>209 #include <QTextStream>210 211 qint64 WavFile::readData(QIODevice &device, QByteArray &buffer,212 QAudioFormat outputFormat)213 {214 if (QAudioFormat() == outputFormat)215 outputFormat = m_format;216 217 qint64 result = 0;218 219 QFile file("wav.txt");220 file.open(QIODevice::WriteOnly | QIODevice::Text);221 QTextStream stream;222 stream.setDevice(&file);223 224 if (isPCMS16LE(outputFormat) && isPCMS16LE(m_format)) {225 QVector<char> inputSample(2 * m_format.channels());226 227 qint16 *output = reinterpret_cast<qint16*>(buffer.data());228 229 while (result < buffer.size()) {230 if (device.read(inputSample.data(), inputSample.count())) {231 int inputIdx = 0;232 for (int outputIdx = 0; outputIdx < outputFormat.channels(); ++outputIdx) {233 const qint16* input = reinterpret_cast<const qint16*>(inputSample.data() + 2 * inputIdx);234 *output++ = qFromLittleEndian<qint16>(*input);235 result += 2;236 if (inputIdx < m_format.channels())237 ++inputIdx;238 }239 } else {240 break;241 }242 }243 }244 return result;245 }246 -
trunk/demos/spectrum/app/wavfile.h
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 47 47 #include <QtMultimedia/qaudioformat.h> 48 48 49 /** 50 * Helper class for reading WAV files 51 * 52 * See https://ccrma.stanford.edu/courses/422/projects/WaveFormat/ 53 */ 54 class WavFile 49 class WavFile : public QFile 55 50 { 56 51 public: 57 WavFile(const QAudioFormat &format = QAudioFormat(), 58 qint64 dataLength = 0); 52 WavFile(QObject *parent = 0); 59 53 60 // Reads WAV header and seeks to start of data 61 bool readHeader(QIODevice &device); 62 63 // Writes WAV header 64 bool writeHeader(QIODevice &device); 65 66 // Read PCM data 67 qint64 readData(QIODevice &device, QByteArray &buffer, 68 QAudioFormat outputFormat = QAudioFormat()); 69 70 const QAudioFormat& format() const; 71 qint64 dataLength() const; 72 73 static qint64 headerLength(); 74 75 static bool writeDataLength(QIODevice &device, qint64 dataLength); 54 bool open(const QString &fileName); 55 const QAudioFormat &fileFormat() const; 56 qint64 headerLength() const; 76 57 77 58 private: 78 QAudioFormat m_format; 79 qint64 m_dataLength; 59 bool readHeader(); 60 61 private: 62 QAudioFormat m_fileFormat; 63 qint64 m_headerLength; 64 80 65 }; 81 66 -
trunk/demos/spectrum/spectrum.pri
r769 r846 36 36 win32: DEFINES += _CRT_SECURE_NO_WARNINGS 37 37 38 win32 { 39 # spectrum_build_dir is defined with a leading slash so that it can 40 # be used in contexts such as 41 # ..$${spectrum_build_dir} 42 # without the result having a trailing slash where spectrum_build_dir 43 # is undefined. 44 spectrum_build_dir = /release 45 if (!debug_and_release|build_pass): CONFIG(debug, debug|release) { 46 spectrum_build_dir = /debug 47 } 48 } 49 -
trunk/demos/spectrum/spectrum.pro
r769 r846 15 15 16 16 symbian { 17 load(data_caging_paths)18 19 17 # Create a 'make sis' rule which can be run from the top-level 20 18 … … 22 20 23 21 # UID for the SIS file 24 TARGET.UID3 = 0xA000E 3FA22 TARGET.UID3 = 0xA000E402 25 23 } 26 24 -
trunk/demos/spreadsheet/main.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/spreadsheet/printview.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/spreadsheet/printview.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/spreadsheet/spreadsheet.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 71 71 setupMenuBar(); 72 72 setupContents(); 73 setupContextMenu(); 73 74 setCentralWidget(table); 74 75 … … 511 512 table->setItem(0, 2, new SpreadSheetItem("Price")); 512 513 table->item(0, 2)->setBackgroundColor(titleBackground); 513 table->item(0, 2)->setToolTip("This col lumn shows the price of the purchase");514 table->item(0, 2)->setToolTip("This column shows the price of the purchase"); 514 515 table->item(0, 2)->setFont(titleFont); 515 516 -
trunk/demos/spreadsheet/spreadsheet.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/spreadsheet/spreadsheetdelegate.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/spreadsheet/spreadsheetdelegate.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/spreadsheet/spreadsheetitem.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/spreadsheet/spreadsheetitem.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/sqlbrowser/browser.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 243 243 { 244 244 QMessageBox::about(this, tr("About"), tr("The SQL Browser demonstration " 245 "show how a data browser can be used to visualize the results of SQL"245 "shows how a data browser can be used to visualize the results of SQL" 246 246 "statements on a live database")); 247 247 } -
trunk/demos/sqlbrowser/browser.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/sqlbrowser/connectionwidget.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/sqlbrowser/connectionwidget.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/sqlbrowser/main.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/sqlbrowser/qsqlconnectiondialog.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/sqlbrowser/qsqlconnectiondialog.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/sub-attaq/animationmanager.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/sub-attaq/animationmanager.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/sub-attaq/boat.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/sub-attaq/boat.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/sub-attaq/boat_p.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/sub-attaq/bomb.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/sub-attaq/bomb.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/sub-attaq/graphicsscene.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/sub-attaq/graphicsscene.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/sub-attaq/main.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/sub-attaq/mainwindow.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/sub-attaq/mainwindow.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/sub-attaq/pixmapitem.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/sub-attaq/pixmapitem.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/sub-attaq/progressitem.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/sub-attaq/progressitem.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/sub-attaq/qanimationstate.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/sub-attaq/qanimationstate.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/sub-attaq/states.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/sub-attaq/states.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/sub-attaq/submarine.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/sub-attaq/submarine.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/sub-attaq/submarine_p.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/sub-attaq/textinformationitem.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/sub-attaq/textinformationitem.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/sub-attaq/torpedo.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/sub-attaq/torpedo.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/symbianpkgrules.pri
r769 r846 3 3 RSS_RULES ="group_name=\"QtDemos\";" 4 4 5 nokiaVendor = "Nokia, Qt" 5 6 vendorinfo = \ 6 7 "; Localised Vendor name" \ 7 "%{ \"Nokia, Qt\"}" \8 "%{$$addLanguageDependentPkgItem(nokiaVendor)}" \ 8 9 " " \ 9 10 "; Unique Vendor name" \ 10 ":\" Nokia, Qt\"" \11 ":\"$$nokiaVendor\"" \ 11 12 " " 12 13 … … 14 15 DEPLOYMENT += demos_deployment 15 16 16 isEmpty(ICON):ICON = $$QT_SOURCE_TREE/src/s60installs/qt.svg 17 isEmpty(ICON):contains(TEMPLATE, ".*app"):contains(QT, gui):contains(CONFIG, qt):!contains(CONFIG, "no_icon") { 18 ICON = $$QT_SOURCE_TREE/src/s60installs/qt.svg 19 } -
trunk/demos/textedit/main.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/textedit/textedit.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 263 263 menu->addAction(a); 264 264 #ifndef QT_NO_CLIPBOARD 265 actionPaste->setEnabled(!QApplication::clipboard()->text().isEmpty()); 265 if (const QMimeData *md = QApplication::clipboard()->mimeData()) 266 actionPaste->setEnabled(md->hasText()); 266 267 #endif 267 268 } … … 682 683 { 683 684 #ifndef QT_NO_CLIPBOARD 684 actionPaste->setEnabled(!QApplication::clipboard()->text().isEmpty()); 685 if (const QMimeData *md = QApplication::clipboard()->mimeData()) 686 actionPaste->setEnabled(md->hasText()); 685 687 #endif 686 688 } -
trunk/demos/textedit/textedit.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/textedit/textedit.qdoc
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 7 7 ** This file is part of the documentation of the Qt Toolkit. 8 8 ** 9 ** $QT_BEGIN_LICENSE: LGPL$9 ** $QT_BEGIN_LICENSE:FDL$ 10 10 ** Commercial Usage 11 11 ** Licensees holding valid Qt Commercial licenses may use this file in 12 12 ** accordance with the Qt Commercial License Agreement provided with the 13 ** Software or, alternatively, in accordance with the terms contained in 14 ** awritten agreement between you and Nokia.13 ** Software or, alternatively, in accordance with the terms contained in a 14 ** written agreement between you and Nokia. 15 15 ** 16 ** GNU Lesser General Public License Usage 17 ** Alternatively, this file may be used under the terms of the GNU Lesser 18 ** General Public License version 2.1 as published by the Free Software 19 ** Foundation and appearing in the file LICENSE.LGPL included in the 20 ** packaging of this file. Please review the following information to 21 ** ensure the GNU Lesser General Public License version 2.1 requirements 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 23 ** 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 ** 28 ** GNU General Public License Usage 29 ** Alternatively, this file may be used under the terms of the GNU 30 ** General Public License version 3.0 as published by the Free Software 31 ** Foundation and appearing in the file LICENSE.GPL included in the 32 ** packaging of this file. Please review the following information to 33 ** ensure the GNU General Public License version 3.0 requirements will be 34 ** met: http://www.gnu.org/copyleft/gpl.html. 16 ** GNU Free Documentation License 17 ** Alternatively, this file may be used under the terms of the GNU Free 18 ** Documentation License version 1.3 as published by the Free Software 19 ** Foundation and appearing in the file included in the packaging of this 20 ** file. 35 21 ** 36 22 ** If you have questions regarding the use of this file, please contact -
trunk/demos/undo/commands.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/undo/commands.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/undo/document.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/undo/document.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/undo/main.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/undo/mainwindow.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/demos/undo/mainwindow.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com)
Note:
See TracChangeset
for help on using the changeset viewer.