summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qplatformscreen_qpa.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qplatformscreen_qpa.cpp')
-rw-r--r--src/gui/kernel/qplatformscreen_qpa.cpp48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/gui/kernel/qplatformscreen_qpa.cpp b/src/gui/kernel/qplatformscreen_qpa.cpp
index 478d2d6..5e80ba8 100644
--- a/src/gui/kernel/qplatformscreen_qpa.cpp
+++ b/src/gui/kernel/qplatformscreen_qpa.cpp
@@ -43,6 +43,12 @@
#include <QtGui/qapplication.h>
#include <QtGui/qdesktopwidget.h>
+/*!
+ Return the given top level widget for a given position.
+
+ Default implementation retrieves a list of all top level widgets and finds the first widget
+ which contains point \a pos
+*/
QWidget *QPlatformScreen::topLevelAt(const QPoint & pos) const
{
QWidgetList list = QApplication::topLevelWidgets();
@@ -56,6 +62,13 @@ QWidget *QPlatformScreen::topLevelAt(const QPoint & pos) const
return 0;
}
+/*! \fn physicalSize() const
+ Reimplement in subclass to return the physical size of the screen. This function is used by
+ QFont to convert point sizes to pixel sizes.
+
+ Default implementation takes the pixel size of the screen, considers a dpi of 100 and returns
+ the calculated (and probably wrong) physical size
+*/
QSize QPlatformScreen::physicalSize() const
{
static const int dpi = 100;
@@ -64,3 +77,38 @@ QSize QPlatformScreen::physicalSize() const
return QSize(width,height);
}
+/*!
+ \class QPlatformScreen
+ \since 4.8
+ \internal
+ \preliminary
+ \ingroup qpa
+
+ \brief The QPlatformScreen class provides an abstraction for visual displays.
+
+ Many window systems has support for retrieving information on the attached displays. To be able
+ to query the display QPA uses QPlatformScreen. Qt its self is most dependent on the
+ physicalSize() function, since this is the function it uses to calculate the dpi to use when
+ converting point sizes to pixels sizes. However, this is unfortunate on some systems, as the
+ native system fakes its dpi size.
+
+ QPlatformScreen is also used by the public api QDesktopWidget for information about the desktop.
+ */
+
+/*! \fn geometry() const
+ Reimplement in subclass to return the pixel geometry of the screen
+*/
+
+/*! \fn availableGeometry() const
+ Reimplement in subclass to return the pixel geometry of the available space
+ This normally is the desktop screen minus the task manager, global menubar etc.
+*/
+
+/*! \fn depth() const
+ Reimplement in subclass to return current depth of the screen
+*/
+
+/*! \fn format() const
+ Reimplement in subclass to return the image format which corresponds to the screen format
+*/
+