1
0
mirror of https://gitee.com/drabel/LibQQt.git synced 2025-01-04 10:18:44 +08:00
2019-09-08 23:53:39 +08:00

45 lines
1.3 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include "mainwindow.h"
#include <QQtApplication>
#include <qgraphicseffect.h>
#include <qqtosdform.h>
#include <qqtwidgets.h>
#include <qqtbodymover.h>
#include <qqtframe.h>
int main ( int argc, char* argv[] )
{
QQtApplication a ( argc, argv );
//MainWindow w;
//w.show();
QQtWidget w;
w.setWindowTitle ( "QQtRoseMonitor" );
w.setWindowFlag ( Qt::WindowStaysOnTopHint, true );
w.setWindowFlag ( Qt::FramelessWindowHint, true );
w.setAttribute ( Qt::WA_TranslucentBackground, true );
QQtBodyMover* frameless = new QQtBodyMover ( &w );
w.installEventFilter ( frameless );
QPalette pal = w.palette();
pal.setColor ( QPalette::Background, QColor ( 0, 0, 0 ) );
//w.setPalette ( pal );
w.setMinimumSize ( 420, 720 );
w.setGeometry ( 0, 0, 420, 720 );
moveCenter ( &w );
w.setPixmap ( conf_root ( "rose.png" ) );
w.show();
#if 0
//顺便测试一下shadow。测试结果对设置的图片管用了在图片附近产生了阴影。
QGraphicsDropShadowEffect* shadow = new QGraphicsDropShadowEffect;
shadow->setBlurRadius ( 10 );
shadow->setColor ( QColor ( 0, 0, 0, 160 ) );
shadow->setOffset ( 5, 5 );
w.setGraphicsEffect ( shadow );
#endif
return a.exec();
}