summaryrefslogtreecommitdiff
path: root/examples/svg/embedded/desktopservices
diff options
context:
space:
mode:
authorhjk <qthjk@ovi.com>2012-12-04 12:34:19 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-12-06 12:25:09 +0100
commit166e66496114975b9580e489b16963191fd4f600 (patch)
treefea7f51ef2ad93dd2f440429d29894ae795d2673 /examples/svg/embedded/desktopservices
parent0f146689e6fb53762123c3e8a44fc6c8e71492ba (diff)
downloadqtsvg-166e66496114975b9580e489b16963191fd4f600.tar.gz
Centralize and fixup qtsvg example sources install targets
This follows suit with aeb036e in qtbase. Change-Id: I2e64dcce15b3b39f98395df5627cf0839debdf99 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Diffstat (limited to 'examples/svg/embedded/desktopservices')
-rw-r--r--examples/svg/embedded/desktopservices/contenttab.cpp140
-rw-r--r--examples/svg/embedded/desktopservices/contenttab.h102
-rw-r--r--examples/svg/embedded/desktopservices/data/Explosion.wavbin0 -> 18427 bytes
-rw-r--r--examples/svg/embedded/desktopservices/data/designer.pngbin0 -> 2529 bytes
-rw-r--r--examples/svg/embedded/desktopservices/data/monkey_on_64x64.pngbin0 -> 3479 bytes
-rw-r--r--examples/svg/embedded/desktopservices/data/sax.mp3bin0 -> 104104 bytes
-rw-r--r--examples/svg/embedded/desktopservices/desktopservices.pro21
-rw-r--r--examples/svg/embedded/desktopservices/desktopservices.qrc8
-rw-r--r--examples/svg/embedded/desktopservices/desktopwidget.cpp90
-rw-r--r--examples/svg/embedded/desktopservices/desktopwidget.h73
-rw-r--r--examples/svg/embedded/desktopservices/linktab.cpp88
-rw-r--r--examples/svg/embedded/desktopservices/linktab.h86
-rw-r--r--examples/svg/embedded/desktopservices/main.cpp56
-rw-r--r--examples/svg/embedded/desktopservices/resources/browser.pngbin0 -> 2525 bytes
-rw-r--r--examples/svg/embedded/desktopservices/resources/heart.svg55
-rw-r--r--examples/svg/embedded/desktopservices/resources/message.pngbin0 -> 1989 bytes
-rw-r--r--examples/svg/embedded/desktopservices/resources/music.pngbin0 -> 2123 bytes
-rw-r--r--examples/svg/embedded/desktopservices/resources/photo.pngbin0 -> 2233 bytes
18 files changed, 719 insertions, 0 deletions
diff --git a/examples/svg/embedded/desktopservices/contenttab.cpp b/examples/svg/embedded/desktopservices/contenttab.cpp
new file mode 100644
index 0000000..5c82611
--- /dev/null
+++ b/examples/svg/embedded/desktopservices/contenttab.cpp
@@ -0,0 +1,140 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// EXTERNAL INCLUDES
+#include <QKeyEvent>
+#include <QMessageBox>
+#include <QListWidget>
+#include <QVBoxLayout>
+#include <QFileInfoList>
+#include <QListWidgetItem>
+
+// INTERNAL INCLUDES
+
+// CLASS HEADER
+#include "contenttab.h"
+
+
+// CONSTRUCTORS & DESTRUCTORS
+ContentTab::ContentTab(QWidget *parent) :
+ QListWidget(parent)
+{
+ setDragEnabled(false);
+ setIconSize(QSize(45, 45));
+}
+
+ContentTab::~ContentTab()
+{
+}
+
+// NEW PUBLIC METHODS
+void ContentTab::init(const QStandardPaths::StandardLocation &location,
+ const QString &filter,
+ const QString &icon)
+{
+ setContentDir(location);
+ QStringList filterList;
+ filterList = filter.split(";");
+ m_ContentDir.setNameFilters(filterList);
+ setIcon(icon);
+
+ connect(this, SIGNAL(itemClicked(QListWidgetItem*)),
+ this, SLOT(openItem(QListWidgetItem*)));
+
+ populateListWidget();
+}
+
+// NEW PROTECTED METHODS
+void ContentTab::setContentDir(const QStandardPaths::StandardLocation &location)
+{
+ m_ContentDir.setPath(QStandardPaths::writableLocation(location));
+}
+
+void ContentTab::setIcon(const QString &icon)
+{
+ m_Icon = QIcon(icon);
+}
+
+void ContentTab::populateListWidget()
+{
+ QFileInfoList fileList = m_ContentDir.entryInfoList(QDir::Files, QDir::Time);
+ foreach(QFileInfo item, fileList) {
+ new QListWidgetItem(m_Icon, itemName(item), this);
+ }
+}
+
+QString ContentTab::itemName(const QFileInfo &item)
+{
+ return QString(item.baseName() + "." + item.completeSuffix());
+}
+
+QUrl ContentTab::itemUrl(QListWidgetItem *item)
+{
+ return QUrl("file:///" + m_ContentDir.absolutePath() + "/" + item->text());
+}
+
+void ContentTab::keyPressEvent(QKeyEvent *event)
+{
+ switch (event->key()) {
+ case Qt::Key_Select:
+ openItem(currentItem());
+ default:
+ QListWidget::keyPressEvent(event);
+ break;
+ }
+}
+
+void ContentTab::handleErrorInOpen(QListWidgetItem *item)
+{
+ Q_UNUSED(item);
+ QMessageBox::warning(this, tr("Operation Failed"), tr("Unknown error!"), QMessageBox::Close);
+}
+
+// NEW SLOTS
+void ContentTab::openItem(QListWidgetItem *item)
+{
+ bool ret = QDesktopServices::openUrl(itemUrl(item));
+ if (!ret)
+ handleErrorInOpen(item);
+}
+
+
+// End of File
diff --git a/examples/svg/embedded/desktopservices/contenttab.h b/examples/svg/embedded/desktopservices/contenttab.h
new file mode 100644
index 0000000..9f0a824
--- /dev/null
+++ b/examples/svg/embedded/desktopservices/contenttab.h
@@ -0,0 +1,102 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef CONTENTTAB_H_
+#define CONTENTTAB_H_
+
+// EXTERNAL INCLUDES
+#include <QDir>
+#include <QUrl>
+#include <QIcon>
+#include <QFileInfo>
+#include <QListWidget>
+#include <QDesktopServices>
+#include <QStandardPaths>
+
+// INTERNAL INCLUDES
+
+// FORWARD DECLARATIONS
+QT_BEGIN_NAMESPACE
+class QListWidgetItem;
+QT_END_NAMESPACE
+
+// CLASS DECLARATION
+
+/**
+* ContentTab class.
+*
+* This class implements general purpose tab for media files.
+*/
+class ContentTab : public QListWidget
+{
+ Q_OBJECT
+
+public: // Constructors & Destructors
+ ContentTab(QWidget *parent);
+ virtual ~ContentTab();
+
+public: // New Methods
+ virtual void init(const QStandardPaths::StandardLocation &location,
+ const QString &filter,
+ const QString &icon);
+
+protected: // New Methods
+ virtual void setContentDir(const QStandardPaths::StandardLocation &location);
+ virtual void setIcon(const QString &icon);
+ virtual void populateListWidget();
+ virtual QString itemName(const QFileInfo &item);
+ virtual QUrl itemUrl(QListWidgetItem *item);
+ virtual void handleErrorInOpen(QListWidgetItem *item);
+protected:
+ void keyPressEvent(QKeyEvent *event);
+
+public slots: // New Slots
+ virtual void openItem(QListWidgetItem *item);
+
+protected: // Owned variables
+ QDir m_ContentDir;
+ QIcon m_Icon;
+};
+
+
+#endif // CONTENTTAB_H_
+
+// End of File
diff --git a/examples/svg/embedded/desktopservices/data/Explosion.wav b/examples/svg/embedded/desktopservices/data/Explosion.wav
new file mode 100644
index 0000000..7b140b1
--- /dev/null
+++ b/examples/svg/embedded/desktopservices/data/Explosion.wav
Binary files differ
diff --git a/examples/svg/embedded/desktopservices/data/designer.png b/examples/svg/embedded/desktopservices/data/designer.png
new file mode 100644
index 0000000..1485efa
--- /dev/null
+++ b/examples/svg/embedded/desktopservices/data/designer.png
Binary files differ
diff --git a/examples/svg/embedded/desktopservices/data/monkey_on_64x64.png b/examples/svg/embedded/desktopservices/data/monkey_on_64x64.png
new file mode 100644
index 0000000..990f604
--- /dev/null
+++ b/examples/svg/embedded/desktopservices/data/monkey_on_64x64.png
Binary files differ
diff --git a/examples/svg/embedded/desktopservices/data/sax.mp3 b/examples/svg/embedded/desktopservices/data/sax.mp3
new file mode 100644
index 0000000..d77c817
--- /dev/null
+++ b/examples/svg/embedded/desktopservices/data/sax.mp3
Binary files differ
diff --git a/examples/svg/embedded/desktopservices/desktopservices.pro b/examples/svg/embedded/desktopservices/desktopservices.pro
new file mode 100644
index 0000000..1410451
--- /dev/null
+++ b/examples/svg/embedded/desktopservices/desktopservices.pro
@@ -0,0 +1,21 @@
+QT+=widgets
+
+HEADERS += desktopwidget.h contenttab.h linktab.h
+SOURCES += desktopwidget.cpp contenttab.cpp linktab.cpp main.cpp
+
+RESOURCES += desktopservices.qrc
+
+EXAMPLE_FILES += data
+
+music.files = data/*.mp3 data/*.wav
+image.files = data/*.png
+
+target.path = $$[QT_INSTALL_EXAMPLES]/svg/embedded/desktopservices
+
+wince*{
+ music.path = "\\My Documents\\My Music"
+ image.path = "\\My Documents\\My Pictures"
+ DEPLOYMENT += music image
+}
+
+INSTALLS += target
diff --git a/examples/svg/embedded/desktopservices/desktopservices.qrc b/examples/svg/embedded/desktopservices/desktopservices.qrc
new file mode 100644
index 0000000..410175f
--- /dev/null
+++ b/examples/svg/embedded/desktopservices/desktopservices.qrc
@@ -0,0 +1,8 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource prefix="/">
+ <file>resources/music.png</file>
+ <file>resources/photo.png</file>
+ <file>resources/browser.png</file>
+ <file>resources/message.png</file>
+</qresource>
+</RCC>
diff --git a/examples/svg/embedded/desktopservices/desktopwidget.cpp b/examples/svg/embedded/desktopservices/desktopwidget.cpp
new file mode 100644
index 0000000..75cc249
--- /dev/null
+++ b/examples/svg/embedded/desktopservices/desktopwidget.cpp
@@ -0,0 +1,90 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// EXTERNAL INCLUDES
+#include <QTabWidget>
+#include <QVBoxLayout>
+#include <QStandardPaths>
+
+// INTERNAL INCLUDES
+#include "linktab.h"
+#include "contenttab.h"
+
+// CLASS HEADER
+#include "desktopwidget.h"
+
+// CONSTRUCTORS & DESTRUCTORS
+DesktopWidget::DesktopWidget(QWidget *parent) : QWidget(parent)
+
+{
+ QTabWidget *tabWidget = new QTabWidget(this);
+
+ // Images
+ ContentTab* imageTab = new ContentTab(tabWidget);
+ imageTab->init(QStandardPaths::PicturesLocation,
+ "*.png;*.jpg;*.jpeg;*.bmp;*.gif",
+ ":/resources/photo.png");
+ tabWidget->addTab(imageTab, tr("Images"));
+
+ // Music
+ ContentTab* musicTab = new ContentTab(tabWidget);
+ musicTab->init(QStandardPaths::MusicLocation,
+ "*.wav;*.mp3;*.mp4",
+ ":/resources/music.png");
+ tabWidget->addTab(musicTab, tr("Music"));
+
+ // Links
+ LinkTab* othersTab = new LinkTab(tabWidget);;
+ // Given icon file will be overridden by LinkTab
+ othersTab->init(QStandardPaths::PicturesLocation, "", "");
+ tabWidget->addTab(othersTab, tr("Links"));
+
+ // Layout
+ QVBoxLayout *layout = new QVBoxLayout;
+ layout->addWidget(tabWidget);
+ setLayout(layout);
+}
+
+DesktopWidget::~DesktopWidget()
+{
+}
+
+// End of file
diff --git a/examples/svg/embedded/desktopservices/desktopwidget.h b/examples/svg/embedded/desktopservices/desktopwidget.h
new file mode 100644
index 0000000..6c1539c
--- /dev/null
+++ b/examples/svg/embedded/desktopservices/desktopwidget.h
@@ -0,0 +1,73 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef DESKTOPWIDGET_H_
+#define DESKTOPWIDGET_H_
+
+// EXTERNAL INCLUDES
+#include <QWidget>
+
+// INTERNAL INCLUDES
+
+// FORWARD DECLARATIONS
+QT_BEGIN_NAMESPACE
+class QTabWidget;
+QT_END_NAMESPACE
+
+// CLASS DECLARATION
+/**
+* DesktopWidget class.
+*
+* Implements the main top level widget for QDesktopServices demo app.
+*/
+class DesktopWidget : public QWidget
+{
+ Q_OBJECT
+
+public: // Constructors & Destructors
+ DesktopWidget(QWidget *parent);
+ ~DesktopWidget();
+
+};
+
+#endif // DESKTOPWIDGET_H_
+
+// End of file
diff --git a/examples/svg/embedded/desktopservices/linktab.cpp b/examples/svg/embedded/desktopservices/linktab.cpp
new file mode 100644
index 0000000..523a104
--- /dev/null
+++ b/examples/svg/embedded/desktopservices/linktab.cpp
@@ -0,0 +1,88 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// EXTERNAL INCLUDES
+#include <QUrl>
+#include <QMessageBox>
+#include <QListWidgetItem>
+
+// INTERNAL INCLUDES
+
+// CLASS HEADER
+#include "linktab.h"
+
+LinkTab::LinkTab(QWidget *parent) :
+ ContentTab(parent)
+{
+}
+
+LinkTab::~LinkTab()
+{
+}
+
+void LinkTab::populateListWidget()
+{
+ m_WebItem = new QListWidgetItem(QIcon(":/resources/browser.png"), tr("Launch Browser"), this);
+ m_MailToItem = new QListWidgetItem(QIcon(":/resources/message.png"), tr("New e-mail"), this);
+}
+
+QUrl LinkTab::itemUrl(QListWidgetItem *item)
+{
+ if (m_WebItem == item) {
+ return QUrl(tr("http://qt-project.org"));
+ } else if (m_MailToItem == item) {
+ return QUrl(tr("mailto:noreply@qt-project.org?subject=Qt feedback&body=Hello"));
+ } else {
+ // We should never endup here
+ Q_ASSERT(false);
+ return QUrl();
+ }
+}
+void LinkTab::handleErrorInOpen(QListWidgetItem *item)
+{
+ if (m_MailToItem == item) {
+ QMessageBox::warning(this, tr("Operation Failed"), tr("Please check that you have\ne-mail account defined."), QMessageBox::Close);
+ } else {
+ ContentTab::handleErrorInOpen(item);
+ }
+}
+
+// End of file
diff --git a/examples/svg/embedded/desktopservices/linktab.h b/examples/svg/embedded/desktopservices/linktab.h
new file mode 100644
index 0000000..8d13475
--- /dev/null
+++ b/examples/svg/embedded/desktopservices/linktab.h
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef LINKTAB_H_
+#define LINKTAB_H_
+
+// EXTERNAL INCLUDES
+
+// INTERNAL INCLUDES
+#include "contenttab.h"
+
+// FORWARD DECLARATIONS
+QT_BEGIN_NAMESPACE
+class QWidget;
+class QListWidgetItem;
+QT_END_NAMESPACE
+
+// CLASS DECLARATION
+
+/**
+* LinkTab class.
+*
+* This class implements tab for opening http and mailto links.
+*/
+class LinkTab : public ContentTab
+{
+ Q_OBJECT
+
+public: // Constructors & Destructors
+ LinkTab(QWidget *parent);
+ ~LinkTab();
+
+protected: // Derived Methods
+ virtual void populateListWidget();
+ virtual QUrl itemUrl(QListWidgetItem *item);
+ virtual void handleErrorInOpen(QListWidgetItem *item);
+
+private: // Used variables
+ QListWidgetItem *m_WebItem;
+ QListWidgetItem *m_MailToItem;
+
+private: // Owned variables
+
+};
+
+#endif // CONTENTTAB_H_
+
+// End of File
diff --git a/examples/svg/embedded/desktopservices/main.cpp b/examples/svg/embedded/desktopservices/main.cpp
new file mode 100644
index 0000000..878d589
--- /dev/null
+++ b/examples/svg/embedded/desktopservices/main.cpp
@@ -0,0 +1,56 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the demonstration applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QApplication>
+#include "desktopwidget.h"
+
+int main(int argc, char *argv[])
+{
+ Q_INIT_RESOURCE(desktopservices);
+
+ QApplication app(argc, argv);
+ DesktopWidget* myWidget = new DesktopWidget(0);
+ myWidget->showMaximized();
+
+ return app.exec();
+}
+
+// End of file
diff --git a/examples/svg/embedded/desktopservices/resources/browser.png b/examples/svg/embedded/desktopservices/resources/browser.png
new file mode 100644
index 0000000..9ecda6b
--- /dev/null
+++ b/examples/svg/embedded/desktopservices/resources/browser.png
Binary files differ
diff --git a/examples/svg/embedded/desktopservices/resources/heart.svg b/examples/svg/embedded/desktopservices/resources/heart.svg
new file mode 100644
index 0000000..ba5f050
--- /dev/null
+++ b/examples/svg/embedded/desktopservices/resources/heart.svg
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) --><svg viewBox="100 200 550 500" height="595.27559pt" id="svg1" inkscape:version="0.40+cvs" sodipodi:docbase="C:\Documents and Settings\Jon Phillips\My Documents\projects\clipart-project\submissions" sodipodi:docname="heart-left-highlight.svg" sodipodi:version="0.32" width="595.27559pt" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://web.resource.org/cc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:svg="http://www.w3.org/2000/svg">
+<metadata>
+<rdf:RDF xmlns:cc="http://web.resource.org/cc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+<cc:Work rdf:about="">
+<dc:title>Heart Left-Highlight</dc:title>
+<dc:description>This is a normal valentines day heart.</dc:description>
+<dc:subject>
+<rdf:Bag>
+<rdf:li>holiday</rdf:li>
+<rdf:li>valentines</rdf:li>
+<rdf:li></rdf:li>
+<rdf:li>valentine</rdf:li>
+<rdf:li>hash(0x8a091c0)</rdf:li>
+<rdf:li>hash(0x8a0916c)</rdf:li>
+<rdf:li>signs_and_symbols</rdf:li>
+<rdf:li>hash(0x8a091f0)</rdf:li>
+<rdf:li>day</rdf:li>
+</rdf:Bag>
+</dc:subject>
+<dc:publisher>
+<cc:Agent rdf:about="http://www.openclipart.org">
+<dc:title>Jon Phillips</dc:title>
+</cc:Agent>
+</dc:publisher>
+<dc:creator>
+<cc:Agent>
+<dc:title>Jon Phillips</dc:title>
+</cc:Agent>
+</dc:creator>
+<dc:rights>
+<cc:Agent>
+<dc:title>Jon Phillips</dc:title>
+</cc:Agent>
+</dc:rights>
+<dc:date></dc:date>
+<dc:format>image/svg+xml</dc:format>
+<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
+<cc:license rdf:resource="http://web.resource.org/cc/PublicDomain"/>
+<dc:language>en</dc:language>
+</cc:Work>
+<cc:License rdf:about="http://web.resource.org/cc/PublicDomain">
+<cc:permits rdf:resource="http://web.resource.org/cc/Reproduction"/>
+<cc:permits rdf:resource="http://web.resource.org/cc/Distribution"/>
+<cc:permits rdf:resource="http://web.resource.org/cc/DerivativeWorks"/>
+</cc:License>
+</rdf:RDF>
+</metadata>
+<defs id="defs3"/>
+<sodipodi:namedview bordercolor="#666666" borderopacity="1.0" id="base" inkscape:current-layer="layer1" inkscape:cx="549.40674" inkscape:cy="596.00159" inkscape:document-units="px" inkscape:guide-bbox="true" inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:window-height="615" inkscape:window-width="866" inkscape:window-x="88" inkscape:window-y="116" inkscape:zoom="0.35000000" pagecolor="#ffffff" showguides="true"/>
+<g id="layer1" inkscape:groupmode="layer" inkscape:label="Layer 1">
+<path d="M 263.41570,235.14588 C 197.17570,235.14588 143.41575,288.90587 143.41575,355.14588 C 143.41575,489.90139 279.34890,525.23318 371.97820,658.45392 C 459.55244,526.05056 600.54070,485.59932 600.54070,355.14588 C 600.54070,288.90588 546.78080,235.14587 480.54070,235.14588 C 432.49280,235.14588 391.13910,263.51631 371.97820,304.33338 C 352.81740,263.51630 311.46370,235.14587 263.41570,235.14588 z " id="path7" sodipodi:nodetypes="ccccccc" style="fill:#e60000;fill-opacity:1.0000000;stroke:#000000;stroke-width:18.700001;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000"/>
+<path d="M 265.00000,253.59375 C 207.04033,253.59375 160.00000,300.63407 160.00000,358.59375 C 160.00000,476.50415 278.91857,507.43251 359.96875,624.00000 C 366.52868,614.08205 220.00000,478.47309 220.00000,378.59375 C 220.00000,320.63407 267.04033,273.59375 325.00000,273.59375 C 325.50453,273.59375 325.99718,273.64912 326.50000,273.65625 C 309.22436,261.07286 288.00557,253.59374 265.00000,253.59375 z " id="path220" sodipodi:nodetypes="ccccccc" style="fill:#e6e6e6;fill-opacity:0.64556962;stroke:none;stroke-width:18.700001;stroke-miterlimit:4.0000000;stroke-opacity:1.0000000"/>
+</g>
+</svg>
diff --git a/examples/svg/embedded/desktopservices/resources/message.png b/examples/svg/embedded/desktopservices/resources/message.png
new file mode 100644
index 0000000..78917c7
--- /dev/null
+++ b/examples/svg/embedded/desktopservices/resources/message.png
Binary files differ
diff --git a/examples/svg/embedded/desktopservices/resources/music.png b/examples/svg/embedded/desktopservices/resources/music.png
new file mode 100644
index 0000000..cc569cb
--- /dev/null
+++ b/examples/svg/embedded/desktopservices/resources/music.png
Binary files differ
diff --git a/examples/svg/embedded/desktopservices/resources/photo.png b/examples/svg/embedded/desktopservices/resources/photo.png
new file mode 100644
index 0000000..ac81cf3
--- /dev/null
+++ b/examples/svg/embedded/desktopservices/resources/photo.png
Binary files differ