Доброго дня!
Я использую QT embedded 4.5.2, на arm.
У меня проблемы при обращении к видеопамяти, не могу получить указатель используя как QScreen::base, так и QDirectPainter::frameBuffer. Код:
void AddressBook :: paintEvent ( QPaintEvent * event ){
qWarning("got paint event");
QDirectPainter :: lock();
uchar* fb = QDirectPainter :: frameBuffer();
qWarning("directPainter.frameBuffer(): fb is at %p, screenWidth: %d, screenHeight: %d",
fb, QDirectPainter :: screenWidth(), QDirectPainter :: screenHeight() );
QDirectPainter :: unlock();
QScreen *screen = QScreen::instance();
QList<QScreen*> subScreens = screen -> subScreens();
int subscreensCount = subScreens.size();
int memTotal = screen -> totalSize();
uchar* base = screen -> base();
qWarning("Screen-based info: subscreensCount: %d, memTotal: %d, base at: %p", subscreensCount, memTotal, base );
}
console logs:
got paint event
directPainter.frameBuffer(): fb is at 0x0, screenWidth: 0, screenHeight: 0
Screen-based info: subscreensCount: 0, memTotal: 0, base at: 0x0
QDirectFBScreen::lockSurface(IDirectFBSurface *surface, uint flags, int *bpl): surface locked at 0x42299000, returning it
QDirectFBPaintDevice::lockDirectFB(uint flags): mem locked at 0x42299000
QDirectFBPaintDevice::memory(): returning 0x42299000
QDirectFBPaintDevice::memory(): returning 0x42299000
QDirectFBPaintDevice::memory(): returning 0x42299000
QDirectFBPaintDevice::memory(): returning 0x42299000
QDirectFBPaintDevice::memory(): returning 0x42299000
QDirectFBPaintDevice::memory(): returning 0x42299000
QDirectFBPaintDevice::memory(): returning 0x42299000
QDirectFBScreen::lockSurface(IDirectFBSurface *surface, uint flags, int *bpl): surface locked at 0x42299000, returning it
QDirectFBPaintDevice::lockDirectFB(uint flags): mem locked at 0x42299000
QDirectFBPaintDevice::memory(): returning 0x42299000
QDirectFBPaintDevice::memory(): returning 0x42299000
got paint event
directPainter.frameBuffer(): fb is at 0x0, screenWidth: 0, screenHeight: 0
Screen-based info: subscreensCount: 0, memTotal: 0, base at: 0x0
QDirectFBScreen::lockSurface(IDirectFBSurface *surface, uint flags, int *bpl): surface locked at 0x42299000, returning it
QDirectFBPaintDevice::lockDirectFB(uint flags): mem locked at 0x42299000
QDirectFBPaintDevice::memory(): returning 0x42299000
QDirectFBPaintDevice::memory(): returning 0x42299000
QDirectFBPaintDevice::memory(): returning 0x42299000
QDirectFBPaintDevice::memory(): returning 0x42299000
QDirectFBPaintDevice::memory(): returning 0x42299000
QDirectFBPaintDevice::memory(): returning 0x42299000
QDirectFBPaintDevice::memory(): returning 0x42299000
QDirectFBScreen::lockSurface(IDirectFBSurface *surface, uint flags, int *bpl): surface locked at 0x42299000, returning it
QDirectFBPaintDevice::lockDirectFB(uint flags): mem locked at 0x42299000
QDirectFBPaintDevice::memory(): returning 0x42299000
QDirectFBPaintDevice::memory(): returning 0x42299000
got paint event
Я также добавил несколько отладочных сообщений в код самой QT. Как видите, адрес проскакивает! Но как мне получить его стандартными средствами?