1
/****************************************************************************
3
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
4
** All rights reserved.
5
** Contact: Nokia Corporation (qt-info@nokia.com)
7
** This file is part of the Qt Components project on Qt Labs.
10
** This file contains pre-release code and may not be distributed.
11
** You may use this file in accordance with the terms and conditions contained
12
** in the Technology Preview License Agreement accompanying this package.
14
** GNU Lesser General Public License Usage
15
** Alternatively, this file may be used under the terms of the GNU Lesser
16
** General Public License version 2.1 as published by the Free Software
17
** Foundation and appearing in the file LICENSE.LGPL included in the
18
** packaging of this file. Please review the following information to
19
** ensure the GNU Lesser General Public License version 2.1 requirements
20
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
22
** If you have questions regarding the use of this file, please contact
23
** Nokia at qt-info@nokia.com.
25
****************************************************************************/
26
#include "qdesktopitem.h"
29
QDesktopItem::QDesktopItem(QObject* obj) : QObject(obj) {
30
connect(&desktopWidget, SIGNAL(resized(int)), this, SIGNAL(screenGeometryChanged()));
31
connect(&desktopWidget, SIGNAL(resized(int)), this, SIGNAL(availableGeometryChanged()));
32
connect(&desktopWidget, SIGNAL(workAreaResized(int)), this, SIGNAL(availableGeometryChanged()));
33
connect(&desktopWidget, SIGNAL(screenCountChanged(int)), this, SIGNAL(screenCountChanged()));
36
int QDesktopItem::screenCount() const
38
return desktopWidget.screenCount();
41
QRect QDesktopItem::screenGeometry(int screen) const {
42
return desktopWidget.screenGeometry(screen);
45
QRect QDesktopItem::availableGeometry(int screen) const {
46
return desktopWidget.availableGeometry(screen);
49
int QDesktopItem::screenWidth() const
51
return desktopWidget.screenGeometry().width();
54
int QDesktopItem::screenHeight() const
56
return desktopWidget.screenGeometry().height();
59
int QDesktopItem::availableWidth() const
61
return desktopWidget.availableGeometry().width();
64
int QDesktopItem::availableHeight() const
66
return desktopWidget.availableGeometry().height();
69
QDesktopItem *QDesktopItem::qmlAttachedProperties(QObject *obj) {
70
return new QDesktopItem(obj);