×
Namespaces

Variants
Actions
(Difference between revisions)

Working with QSystemDisplayInfo - System Information API

From Nokia Developer Wiki
Jump to: navigation, search
kiran10182 (Talk | contribs)
m (Related articles)
kiran10182 (Talk | contribs)
m
Line 1: Line 1:
[[Category:Qt for Symbian]][[Category:Code Examples]]
+
[[Category:Qt]][[Category:Qt for Symbian]][[Category:Code Examples]]
 
{|style="background:#eceff2" width="660px" border="1" cellpadding="5" cellspacing="0"  
 
{|style="background:#eceff2" width="660px" border="1" cellpadding="5" cellspacing="0"  
 
|-
 
|-
Line 21: Line 21:
 
|}
 
|}
  
 
{{UnderConstruction}}
 
  
 
{{Tip|<b></b>
 
{{Tip|<b></b>
Line 29: Line 27:
 
}}
 
}}
  
== Overview ==  
+
 
 +
= Overview =  
 
This article explains '''''QSystemDisplayInfo API''''' which is a part of the '''''System Information API''''' from '''''Qt Mobility project'''''.
 
This article explains '''''QSystemDisplayInfo API''''' which is a part of the '''''System Information API''''' from '''''Qt Mobility project'''''.
  
== What is covered in QSystemDisplayInfo API ==
+
= What is covered in QSystemDisplayInfo API =
 
* It is a part of the System Information API.
 
* It is a part of the System Information API.
 
* This article covers information about
 
* This article covers information about
Line 40: Line 39:
  
  
== Capabilities required ==
+
= Capabilities required =
 
* None
 
* None
  
  
== UI design (.ui file) ==
+
= UI design (.ui file)=
 
[[File:QSystemDisplayInfo_UI.PNG]]
 
[[File:QSystemDisplayInfo_UI.PNG]]
  
  
  
== Project configuration file (.Pro file) ==
+
= Project configuration file (.Pro file) =
 
* Add the Qt Mobility project configuration option in the .Pro file as shown below
 
* Add the Qt Mobility project configuration option in the .Pro file as shown below
 
<code cpp>
 
<code cpp>
Line 57: Line 56:
  
  
== Implementing QSystemDisplayInfo API ==
+
= Implementing QSystemDisplayInfo API =
 
* QSystemDisplayInfo API is a part of the QtMobility namespace. So declare the QtMobility namespace as shown below:
 
* QSystemDisplayInfo API is a part of the QtMobility namespace. So declare the QtMobility namespace as shown below:
 
<code cpp>
 
<code cpp>
Line 63: Line 62:
 
</code>
 
</code>
  
=== Header file===
+
== Header file==
 
<code cpp>
 
<code cpp>
 
#ifndef SYSTEMDISPLAYINFO_H
 
#ifndef SYSTEMDISPLAYINFO_H
Line 94: Line 93:
  
  
=== Source file ===
+
== Source file ==
 
<code cpp>
 
<code cpp>
 
#include "SystemDisplayInfo.h"
 
#include "SystemDisplayInfo.h"
Line 136: Line 135:
 
</code>
 
</code>
  
== Output ==
+
= Output =
 
[[File:QSystemDisplayInfo_device.jpg]]
 
[[File:QSystemDisplayInfo_device.jpg]]
  
  
  
== Useful functions ==
+
= Useful functions =
  
  
  
== Keywords ==
+
= Keywords =
  
 
+
==Headers==
===Headers===
+
 
* #include <qsysteminfo.h>
 
* #include <qsysteminfo.h>
  
 
+
==Classes==
===Classes===
+
 
* QSystemDisplayInfo
 
* QSystemDisplayInfo
  
  
== Example Application ==
+
= Example Application =
 
* A working example application is available to download from here: [[Media:SystemDisplayInfo.zip|QSystemDisplayInfo.zip]]
 
* A working example application is available to download from here: [[Media:SystemDisplayInfo.zip|QSystemDisplayInfo.zip]]
  
  
== Related articles ==  
+
= Related articles =  
 
* [[Getting started with Qt Mobility APIs]]
 
* [[Getting started with Qt Mobility APIs]]
 
* [[Setting up environment for Qt Mobility API]]
 
* [[Setting up environment for Qt Mobility API]]
Line 171: Line 168:
 
* [[Working with QSystemNetworkInfo - System Information API - Part 2]]
 
* [[Working with QSystemNetworkInfo - System Information API - Part 2]]
  
== Reference links==
+
= Reference links=
 
* [http://qt.nokia.com/ Qt - cross-platform application and UI framework]
 
* [http://qt.nokia.com/ Qt - cross-platform application and UI framework]
 
* [http://labs.trolltech.com/page/Projects/QtMobility Qt Mobility API]
 
* [http://labs.trolltech.com/page/Projects/QtMobility Qt Mobility API]
 
* [http://qt.nokia.com/developer/new-qt-apis New Qt APIs Beta - Mobility Project]
 
* [http://qt.nokia.com/developer/new-qt-apis New Qt APIs Beta - Mobility Project]
 
* SDK help
 
* SDK help

Revision as of 21:18, 31 March 2010

ID Creation date 9-March-2010
Platform S60 3rd Edition, FP1, FP2

S60 5th Edition

Tested on devices Nokia 5800 xPressMusic
Category Qt for Symbian Subcategory Qt Mobility API


Keywords (APIs, classes, methods, functions): QSystemDisplayInfo, QString, QButton, QLabel,


Tip.pngTip: 


Contents

Overview

This article explains QSystemDisplayInfo API which is a part of the System Information API from Qt Mobility project.

What is covered in QSystemDisplayInfo API

  • It is a part of the System Information API.
  • This article covers information about
    • Color depth value of a screen number in bits per pixel
    • Display brightness of screen in % between 1 - 100 scale.


Capabilities required

  • None


UI design (.ui file)

QSystemDisplayInfo UI.PNG


Project configuration file (.Pro file)

  • Add the Qt Mobility project configuration option in the .Pro file as shown below
CONFIG += mobility
MOBILITY += systeminfo


Implementing QSystemDisplayInfo API

  • QSystemDisplayInfo API is a part of the QtMobility namespace. So declare the QtMobility namespace as shown below:
using namespace QtMobility;

Header file

#ifndef SYSTEMDISPLAYINFO_H
#define SYSTEMDISPLAYINFO_H
 
#include <QtGui/QWidget>
#include "ui_SystemDisplayInfo.h"
#include <qsysteminfo.h>
 
using namespace QtMobility;
class SystemDisplayInfo : public QWidget
{
Q_OBJECT
 
public:
SystemDisplayInfo(QWidget *parent = 0);
~SystemDisplayInfo();
 
public slots:
void listDisplayInformation();
void resetAllFields();
 
private:
Ui::SystemDisplayInfo ui;
QSystemDisplayInfo* displayInfo;
};
 
#endif // SYSTEMDISPLAYINFO_H


Source file

#include "SystemDisplayInfo.h"
 
SystemDisplayInfo::SystemDisplayInfo(QWidget *parent)
: QWidget(parent)
{
ui.setupUi(this);
displayInfo = new QSystemDisplayInfo();
 
QObject::connect(ui.listDisplayInfoButton,
SIGNAL(clicked()),
this,
SLOT(listDisplayInformation()));
QObject::connect(ui.resetButton,
SIGNAL(clicked()),
this,
SLOT(resetAllFields()));
}
 
SystemDisplayInfo::~SystemDisplayInfo()
{
delete displayInfo;
displayInfo = NULL;
}
 
void SystemDisplayInfo::listDisplayInformation()
{
QString colorDepthStr = QString::number(displayInfo->colorDepth(0));
ui.colorDepthLabel->setText(colorDepthStr);
 
QString brightnessStr = QString::number(displayInfo->displayBrightness(0));
ui.brightnessLabel->setText(brightnessStr);
}
 
void SystemDisplayInfo::resetAllFields()
{
ui.colorDepthLabel->clear();
ui.brightnessLabel->clear();
}

Output

QSystemDisplayInfo device.jpg


Useful functions

Keywords

Headers

  • #include <qsysteminfo.h>

Classes

  • QSystemDisplayInfo


Example Application


Related articles

Reference links

113 page views in the last 30 days.
×