On 17/10/2010, at 6:56 AM, ext Charley Bay wrote:
> <snip, not have multiple QDeclarativeView instances>,
>> instead, have:
>> 
>> QDeclarativeView
>>   -Desktop-Widget-Canvas
>>       -QDeclarativeItem
>>       -QDeclarativeItem
>>       -QDeclarativeItem
> 
> Ah, that makes sense:  One "convenience" QDeclarativeView,
> and I'll instantiate my QDeclarativeEngine, QDeclarativeContext,
> and QDeclarativeItem instances, and I'll merely parent all my
> QDeclarativeItem instances inside the *one* QDeclarativeView
> convenience instance.
> 
> Should I try to figure out how to "share" a single QDeclarativeEngine
> instance (I assume there's already one being used by QDeclarativeView
> before I create my own)?

If you never use setSource on the view it shouldn't matter functionality-wise, 
but for ease of remembering the 'right' engine it might make sense to use the 
engine supplied by the view (if you are not using setSource you could 
potentially also just use QGraphicsView directly, rather than QDeclarativeView).

> Finally, with a single "big" desktop widget, I'd like to make the
> background transparent so I can see the rest of my desktop.
> I couldn't find any examples in the QML docs, and the "standard"
> approaches don't seem to be working, like:
> 
> //NOT WORK (app flashes up briefly, then nothing displays):
> my_qdeclarative_view.setAttribute(Qt::WA_TranslucentBackground);
> my_qdeclarative_view.setWindowFlags(Qt::WindowSystemMenuHint |
> Qt::WindowStaysOnTopHint);
> 
> QPalette p = my_view.viewport()->palette();
> p.setColor(QPalette::Base, Qt::transparent);
> my_qdeclarative_view.viewport()->setPalette(p);
> 
> ...I thought the above should work, because QDeclarativeView
> derives from QFrame and QGraphicsView.  (What is the root-most
> widget?)

I haven't personally played around with translucent windows, but if the above 
is working for you with QGraphicsView, it should also be working for 
QDeclarativeView. If not, a bug report on bugreports.qt.nokia.com with a small 
reproducible example would be much appreciated:-)

Regards,
Michael


_______________________________________________
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml

Reply via email to