I'd like to pop up a dialog on top of other widgets on iOS as if it's a pop-up window (message box etc). My application is pure widgets and I'm using Qt 5.4.0.

It seems that windows are always maximized on the iOS platform, so I put everything inside a QFrame and positioned the frame where I want the window to appear to be. However, I can't get the background of the window to be transparent.



In Qt 4 it was possible by setting "background: transparent" in the stylesheet for that element, and the WA_TranslucentBackground|| window attribute. However this is not having any effect in Qt 5. I'm able to set colours ok (and I can make the whole window translucent with setOpacity), but I can't get the background itself to be transparent.

I'm creating the dialog as follows;

TMobileTopicInfo::TMobileTopicInfo(bool error, const QString& heading, const 
QString& body, QWidget *parent)

: QDialog(parent, Qt::Dialog| Qt::FramelessWindowHint)

{

    setAttribute(Qt::WA_TranslucentBackground, true);

    //setAttribute(Qt::WA_NoSystemBackground, true); // tried - doesn't seem 
helpful.


    mUi.setupUi( this );

    //...

}


The window background is black, on both iOS and on Windows.

There's suggestions on StackOverflow that the window flags should be overriden to change the window type to QWidget instead of QDialog. This actually seems to work (the background is transparent), but then there seem to be widget focus issues on iOS.


Any suggestions?


Thanks

Hamish
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to