PDA

View Full Version : WA_TranslucentBackground and raster graphic engine on MacOS



mykhailo
17th November 2011, 17:44
I use Qt 4.8 RC1 and develop application on Windows and MacOS.
Rendering complex qml views with many listviews and images works incorrectly on MacOS.

I have tried to use raster graphic engine instead native. It works fine only when I set WA_TranslucentBackground to false.

Is there way to solve this problem?

There is simple example produce different results on my Mac (with raster and native graphic system)

Q_DECL_EXPORT int main(int argc, char *argv[])
{
QApplication::setGraphicsSystem("raster");
QScopedPointer<QApplication> app(createApplication(argc, argv));
QScopedPointer<QmlApplicationViewer> viewer(QmlApplicationViewer::create());
viewer->setAttribute(Qt::WA_TranslucentBackground,true);
viewer->setMainQmlFile(QLatin1String("qml/untitled/main.qml"));
viewer->showExpanded();
return app->exec();
}



import QtQuick 1.0

Item {
width: 1024
height: 500
Rectangle
{
color:"green"
anchors.fill:parent
ListView
{
model:5
delegate:
Image {
id: testText
source: "http://www.google.com.ua/images/srpr/logo1w.png"
}

width:200
height:500
}
}