wyc
wyc

Reputation: 19

When Qt::WA_TranslucentBackground is set for Android system, the backgound is black

#include "basedialog.h"
#include <qevent.h>
#include <QtDebug>
#include <QGraphicsDropShadowEffect>
#include <QFrame>
#ifdef Q_OS_WIN

#include <windows.h>


#endif
#include <QApplication>
#include <QLabel>
#include <QPushButton>
#include <dialog/hotkeysettingdialog.h>

#include <tool/tooltip.h>
#include <QBitmap>
#include <QPainter>

BaseDialog::BaseDialog(QWidget *parent):
    QDialog (parent,Qt::FramelessWindowHint|Qt::Dialog),
    m_shadoweffect(new QGraphicsDropShadowEffect(this))
{
#ifdef Q_OS_ANDROID
    this->setWindowFlags(Qt::Dialog|Qt::FramelessWindowHint|Qt::WindowStaysOnTopHint);
    this->setAttribute(Qt::WA_TranslucentBackground);
#endif

#ifdef Q_OS_WIN
    this->setAttribute(Qt::WA_TranslucentBackground);
#endif
 
}

Upvotes: 0

Views: 39

Answers (0)

Related Questions