QT下的几种透明效果(QPalette背景白色,窗口设置setWindowOpacity,QPainter使用Clear模式绘图)
QPalette pal = palette();
pal.setColor(QPalette::Background, QColor(0x00,0xff,0x00,0x00));
setPalette(pal);
setAttribute(Qt::WA_TranslucentBackground, true);
setWindowOpacity(0.7)
void TestWindow::paintEvent( QPaintEvent* )
{
QPainter p(this);
p.setCompositionMode( QPainter::CompositionMode_Clear );
p.fillRect( 10, 10, 300, 300, Qt::SolidPattern );
} QT下的几种透明效果(QPalette背景白色,窗口设置setWindowOpacity,QPainter使用Clear模式绘图)的更多相关文章
- QT下的几种透明效果(三种方法:调色板,透明度属性,自绘)
1.窗口整体透明,但是窗体上的控件不透明. 通过设置窗体的背景色来实现,将背景色设置为全透. QPalette pal = palette(); pal.setColor(QPalette: ...
- Android 编程下实现 Activity 的透明效果
实现方式一(使用系统透明样式) 通过配置 Activity 的样式来实现,在 AndroidManifest.xml 找到要实现透明效果的 Activity,在 Activity 的配置中添加如下的代 ...
- 一种透明效果的view
设置这个view背景色: [UIColor colorWithRed: green: blue: alpha:0.3]; 效果如下:
- 专题:DUILIB Win32 透明效果
Win32 透明效果相关基础知识 Layered Windows 分层窗口.这是Windows2000开始引入的概念,重新定义了窗口的Hit Testing方法,以前都是把窗口按rectangle的方 ...
- CentOS下Qt窗口透明效果失效,成黑色背景的问题
一.问题 Linux系统下Qt窗口的透明效果成了黑色,但同样的代码在windows机子上有透明效果,主要是修改系统的配置,仅在centos6.3及其以上版本实验过.其他系统可以相应配置. 二.问题运行 ...
- Qt 设置背景图片3种方法(三种方法:QPalette调色板,paintEvent,QSS)
方法1. setStylSheet{"QDialog{background-image:url()"}} //使用styleSheet 这种方法的好处是继承它的dialog都会自 ...
- Android课程---Android设置透明效果的三种方法(转)
1.使用Android系统自带的透明效果资源 <Button android:background="@android:color/transparent"/> ...
- Qt在Windows下的三种编程环境搭建
尊重作者,支持原创,如需转载,请附上原地址:http://blog.csdn.net/libaineu2004/article/details/17363165 从QT官网可以得知其支持的平台.编译器 ...
- Button的几种常用的xml背景,扁平化,下划线,边框包裹,以及按压效果
Button的几种常用的xml背景,扁平化,下划线,边框包裹,以及按压效果 分享下我项目中用到的几种Button的效果,说实话,还真挺好看的 一.标准圆角 效果是这样的 他的实现很简单,我们只需要两个 ...
随机推荐
- 【29.70%】【codeforces 723D】Lakes in Berland
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard o ...
- kernel build & preempt-rt patch & xenomai
提前准备好 linux 内核源代码,假设是 x86 系统.能够去下载原生内核(Vanilla kernel): wget https://www.kernel.org/pub/linux/kernel ...
- php课程 5-19 php数据结构函数和常用函数有哪些
php课程 5-19 php数据结构函数和常用函数有哪些 一.总结 一句话总结: 1.php数据结构函数有哪些(四个)? • array_pop();从最后弹出一个值,返回弹出值• array_pus ...
- 【37.21%】【codeforces 721B】Passwords
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard o ...
- [Node.js] Take Screenshots of Multiple Dimensions for Responsive Sites using Nightmare
When developing responsive websites, you will constantly be resizing your browser to make sure your ...
- php的标准输入与输出是什么?
php的标准输入与输出是什么? 一.总结 php的标准输入与输出(STDIN是一个文件句柄,等同于fopen("php://stdin", 'r')) 1.STDIN是一个文件句柄 ...
- style.height、offsetHeight、clientHeight、scrollHeight的差别
style.height 包含元素的滚动栏,不包含边框 clientHeight 不包含元素的滚动栏和边框 offsetHeight 包含元素的滚动栏和边框 scrollHeight offsetHe ...
- 热烈庆祝UE4完全免费Free---GitHub上源码的关联方法
声明:所有权利保留. 转载请说明出处:http://blog.csdn.net/cartzhang/article/details/44040317 IF YOU LOVE SOMETHING, SE ...
- 【Material Design视觉设计语言】开篇
作者:郭孝星 微博:郭孝星的新浪微博 邮箱:allenwells@163.com 博客:http://blog.csdn.net/allenwells Github:https://github.co ...
- 初始化NSDictionary:(工作经验)两种方法有时候效果不一样
方法1: NSMutableDictionary *dic = [[NSMutableDictionary alloc] init]; [dic setObject:[Hp_KeysArray obj ...