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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 22:46:54  来源:igfitidea点击:

Qt Designer how to change background

pythonpyqtpyqt5qwidgetqt-designer

提问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 中,您必须遵循以下步骤:

  1. Right click on the item you want to change and select: change stylesheet

    enter image description here

  2. Then press the button to the color side and select background-color, Then select the color and press the OK buttons.

  1. 右键单击要更改的项目并选择:更改样式表

    在此处输入图片说明

  2. 然后将按钮按到颜色侧并选择background-color,然后选择颜色并按 OK 按钮。

enter image description here

在此处输入图片说明

enter image description here

在此处输入图片说明

Output:

输出:

enter image description here

在此处输入图片说明

plus+:

加+:

enter image description here

在此处输入图片说明

enter image description here

在此处输入图片说明