Maybe QWidget::getDC() will help?
Maybe QWidget::getDC() will help?
I don't see this for Qt3. But perhaps I can look in the Qt4 code and create my own version of this based on it.
Sorry, I haven't noticed that you are using Qt3. AFAIR QWidget::winId() returns HWND on windows. Once you have it, you can get HDC through win API.
OK now I have the same basic question about OS/X. OS/X has these functions for setting the gamma ramp:
CGDisplayErr CGSetDisplayTransferByTable (
CGDirectDisplayID display,
CGTableCount tableSize,
const CGGammaValue * redTable,
const CGGammaValue * greenTable,
const CGGammaValue * blueTable
);
and
CGDisplayErr CGGetDisplayTransferByTable (
CGDirectDisplayID display,
CGTableCount capacity,
CGGammaValue * redTable,
CGGammaValue * greenTable,
CGGammaValue * blueTable,
CGTableCount * sampleCount
);
Which are similar to X11 and Windows functions for the same thing but there are some differences. Like the gamma table values are floats in the range of 0.0 through 1.0 instead of unsigned shorts in the range of 0 to 2^16 on the other platforms. OK not a big deal. But how do I get from QDesktopWidget::screenNumber() to a CGDirectDisplayID so that I can make these calls? Are these the same thing or are they different? If they are different are there some functions for getting the CGDirectDisplayID available? I can't seem to find any docs about this.
OK I didn't mean to stump the band. So I will bump this to see if perhaps a new set of eyes might have an idea about how to get this working on a Mac.
Bookmarks