[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Finding Display Resolution ?
From:       Rolf Magnus <ramagnus () zvw ! de>
Date:       2001-11-14 10:38:12
[Download RAW message or body]

On Wednesday 14 November 2001 10:16, Lars Knoll wrote:
> On Wednesday 14 November 2001 06:18, pmoscatt@netscape.net wrote:
> > I am writing an application that needs to know what the current display
> > resolution is.
> >
> > I am assuming I would use:
> >
> >    KApplication *display
> >
> > If so, how do I actually implement this to find the current settings.
> > I am reasonably new to KDE/QT/C++ programming, so be gentle  :-)
>
> QPaintDevice::x11AppDpiX() and x11AppDpiY() is what you're looking for.

Or, if you want the desktop resolution in pixels, you do:

  QDesktopWidget *d = QApplication::desktop();
    int w=d->width();                   // returns desktop width
    int h=d->height();                  // returns desktop height

This is from the QApplication documentation.

-- 
2 hours? Boy, that's way too old. You should use a more recent version.
(Waldo Bastian about a copile error in a 2 hours old CVS version of KDE)


>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic