设置QWidget窗口属性,保持窗口顶置在最前面显示。
CameraWidget::CameraWidget(QWidget *parent, int index) : QWidget(parent), ui(new Ui::CameraWidget) { ui->setupUi(this); //隐藏标题栏 setWindowFlags(Qt::FramelessWindowHint);//无边框 //设置窗口顶置: 一直在最前面. Qt::WindowFlags m_flags = windowFlags(); setWindowFlags(m_flags | Qt::WindowStaysOnTopHint); setAttribute(Qt::WA_TranslucentBackground); ............................ }