diff --git a/include/wx/qt/dcscreen.h b/include/wx/qt/dcscreen.h index 8143f215a1..5289cc53fb 100644 --- a/include/wx/qt/dcscreen.h +++ b/include/wx/qt/dcscreen.h @@ -1,7 +1,7 @@ ///////////////////////////////////////////////////////////////////////////// // Name: wx/qt/dcscreen.h -// Author: Peter Most -// Copyright: (c) Peter Most +// Author: Sean D'Epagnier +// Copyright: (c) Sean D'Epagnier // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -15,9 +15,13 @@ class WXDLLIMPEXP_CORE wxScreenDCImpl : public wxWindowDCImpl public: wxScreenDCImpl( wxScreenDC *owner ); -protected: + ~wxScreenDCImpl(); + + virtual void DoGetSize(int *width, int *height) const wxOVERRIDE; private: + + DECLARE_ABSTRACT_CLASS(wxScreenDCImpl) }; #endif // _WX_QT_DCSCREEN_H_ diff --git a/src/qt/dcscreen.cpp b/src/qt/dcscreen.cpp index 4b1902ce9d..2336e0ce86 100644 --- a/src/qt/dcscreen.cpp +++ b/src/qt/dcscreen.cpp @@ -1,7 +1,7 @@ ///////////////////////////////////////////////////////////////////////////// // Name: src/qt/dcscreen.cpp -// Author: Peter Most -// Copyright: (c) Peter Most +// Author: Sean D'Epagnier +// Copyright: (c) Sean D'Epagnier // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -11,8 +11,23 @@ #include "wx/dcscreen.h" #include "wx/qt/dcscreen.h" +#include +#include + +IMPLEMENT_ABSTRACT_CLASS(wxScreenDCImpl, wxWindowDCImpl) + wxScreenDCImpl::wxScreenDCImpl( wxScreenDC *owner ) : wxWindowDCImpl( owner ) { + m_qtImage = new QImage(QApplication::primaryScreen()->grabWindow(QApplication::desktop()->winId()).toImage()); } +wxScreenDCImpl::~wxScreenDCImpl( ) +{ + delete m_qtImage; +} + +void wxScreenDCImpl::DoGetSize(int *width, int *height) const +{ + wxDisplaySize(width, height); +}