Python Qt Designer 如何更改背景
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/43282899/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Qt Designer how to change background
提问by That One
This is an repost.
这是转贴。
I am kind of new in QtDesigner and wanted to do something about the uglyness of just some buttons.
我是 QtDesigner 的新手,想对一些按钮的丑陋做点什么。
All i have done yesterday was looking on the internet on how to change the background color of a screen in Qt Designer. How to change the color of a button and how to make it flow into another color on the sides. Guess what.
我昨天所做的就是在互联网上查看如何在 Qt Designer 中更改屏幕的背景颜色。如何更改按钮的颜色以及如何使其在侧面流动成另一种颜色。你猜怎么着。
I found nothing.
我什么也没发现。
I hope that some of you die-hard coders know what i need..
我希望你们中的一些顽固的程序员知道我需要什么..
EDIT 1: What i mean with a color flowing into another:
编辑1:我的意思是一种颜色流入另一种颜色:
Here pink flows into purple, do you get what I mean?
这里粉红色变成紫色,你明白我的意思吗?
回答by eyllanesc
To make the changes of colors you can use stylesheets
, in Qt Designer you must follow the following steps:
要更改您可以使用的颜色stylesheets
,在 Qt Designer 中,您必须遵循以下步骤:
Right click on the item you want to change and select: change stylesheet
Then press the button to the color side and select
background-color
, Then select the color and press the OK buttons.
Output:
输出:
plus+:
加+: