Yes, although this is not trivial and only one way (you can use GDI calls to draw on Qt widgets but not QPainter to draw on non-Qt devices). Why can't you make a leap from winapi to Qt in one go?
Yes, although this is not trivial and only one way (you can use GDI calls to draw on Qt widgets but not QPainter to draw on non-Qt devices). Why can't you make a leap from winapi to Qt in one go?
What you propose is the oposite from what I need. I need to draw with QT on the desktop where other API calls also draw.
As you know a screensaver consists of the drawing on the desktop and the configuration dialog.
From your reply I think it would be more easy to start transfering to QT the dialog of the screensaver and leave for a later step the desktop drawing of the screensaver?
I am developing with visual studio 2005.
To create a dialog widget, do I need first to initiate a QApplication object?
How can I initiate it since all the QT examples need argc and argv
QApplication ( int & argc, char ** argv )
This main() is a "dos" version. The screensaver has a winmain function without the argc and argv arguments.
(Confused)
Is there an example of win32 and QT leaving together in the same windows application?
Thank you very much
Michael
You can try opening a painter on QDesktopWidget.
Configuration dialog is trivial once you have all the infrastructure running so I'd suggest going for the screen saver first.From your reply I think it would be more easy to start transfering to QT the dialog of the screensaver and leave for a later step the desktop drawing of the screensaver?
Yes.To create a dialog widget, do I need first to initiate a QApplication object?
No, it's not. World doesn't end on Windows, neither it begins there. main() is a classic C interface and winmain() is an artificial function that is called from the real main provided by msvc.This main() is a "dos" version.
So make it have a main() and not winmain, that's not a problem.The screensaver has a winmain function without the argc and argv arguments.
(Confused)
Each Qt application running on Windows is a "win32" application.Is there an example of win32 and QT leaving together in the same windows application?
Stop thinking in terms of Visual Studio and start thinking in terms of programming. Start with main(), create an application object there, do everything you want related to pure winapi calls if you want and call QApplication::exec(). Just remember the latter is an event loop that will block until your application exits.
If you are concerned about the whole desktop, you can think of your application occupying the whole screen, and paint whatever u like. Simple.
You can use showFullScreen for that.
Also you can move your widget on the desktop while painting is done inside the widget. This is second approach.
Why do you think any of them wont work ?
Hint : In a screensaver, the desktop is your playground![]()
Bookmarks