Qt Creator 和主窗口背景图 [英] Qt Creator and main window background image

查看:61
本文介绍了Qt Creator 和主窗口背景图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想添加一张图片作为主窗口的背景.

I would like to add an image as background of my main window.

添加此背景图片的最佳方法是什么?

What is the best way to add this background image?

我的主窗口的其余部分必须是透明的.

The remaining part of my main window must be transparent.

我想通过 QtCreator 编辑器来做到这一点(对于这个组件,因此,没有代码)

I would like to do this by QtCreator editor (for this component, therefore, no code)

推荐答案

在编辑主窗口表单时找到 styleSheet 属性,然后输入如下内容:

While editing your main window form find styleSheet property, and put something like this:

background: url(:/path/to-your-resource.png)

这篇关于Qt Creator 和主窗口背景图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆