summaryrefslogtreecommitdiffstats
path: root/demos/embedded/desktopservices/desktopwidget.cpp
blob: 17243cf7b4373e3789191ac6c65bb525916da7c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
** Contact: Qt Software Information (qt-info@nokia.com)
**
** This file is part of the $MODULE$ of the Qt Toolkit.
**
** $TROLLTECH_DUAL_LICENSE$
**
****************************************************************************/

// EXTERNAL INCLUDES
#include <QTabWidget>
#include <QVBoxLayout>
#include <QDesktopServices>

// 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(QDesktopServices::PicturesLocation, ":/resources/photo.png");
    tabWidget->addTab(imageTab, tr("Images")); 
    
    // Music
    ContentTab* musicTab = new ContentTab(tabWidget);     
    musicTab->init(QDesktopServices::MusicLocation, ":/resources/music.png");        
    tabWidget->addTab(musicTab, tr("Music"));       
    
    // Links
    LinkTab* othersTab = new LinkTab(tabWidget);;   
    // Given icon file will be overriden by LinkTab
    othersTab->init(QDesktopServices::PicturesLocation, "");    
    tabWidget->addTab(othersTab, tr("Links"));       
    
    // Layout
    QVBoxLayout *layout = new QVBoxLayout;
    layout->addWidget(tabWidget);
    setLayout(layout);     
}
      
DesktopWidget::~DesktopWidget()
{
}
    
// End of file