当前位置: 首页 > news >正文

pyside6的调色板QPalette的简单应用

使用调色板需要先导入:from PySide6.QtGui import QPalette 

调色板QPalette的源代码:

class QPalette(Shiboken.Object):class ColorGroup(enum.Enum):Active                   : QPalette.ColorGroup = ... # 0x0Normal                   : QPalette.ColorGroup = ... # 0x0Disabled                 : QPalette.ColorGroup = ... # 0x1Inactive                 : QPalette.ColorGroup = ... # 0x2NColorGroups             : QPalette.ColorGroup = ... # 0x3Current                  : QPalette.ColorGroup = ... # 0x4All                      : QPalette.ColorGroup = ... # 0x5class ColorRole(enum.Enum):WindowText               : QPalette.ColorRole = ... # 0x0Button                   : QPalette.ColorRole = ... # 0x1Light                    : QPalette.ColorRole = ... # 0x2Midlight                 : QPalette.ColorRole = ... # 0x3Dark                     : QPalette.ColorRole = ... # 0x4Mid                      : QPalette.ColorRole = ... # 0x5Text                     : QPalette.ColorRole = ... # 0x6BrightText               : QPalette.ColorRole = ... # 0x7ButtonText               : QPalette.ColorRole = ... # 0x8Base                     : QPalette.ColorRole = ... # 0x9Window                   : QPalette.ColorRole = ... # 0xaShadow                   : QPalette.ColorRole = ... # 0xbHighlight                : QPalette.ColorRole = ... # 0xcHighlightedText          : QPalette.ColorRole = ... # 0xdLink                     : QPalette.ColorRole = ... # 0xeLinkVisited              : QPalette.ColorRole = ... # 0xfAlternateBase            : QPalette.ColorRole = ... # 0x10NoRole                   : QPalette.ColorRole = ... # 0x11ToolTipBase              : QPalette.ColorRole = ... # 0x12ToolTipText              : QPalette.ColorRole = ... # 0x13PlaceholderText          : QPalette.ColorRole = ... # 0x14Accent                   : QPalette.ColorRole = ... # 0x15NColorRoles              : QPalette.ColorRole = ... # 0x16@overloaddef __init__(self) -> None: ...@overloaddef __init__(self, button: PySide6.QtCore.Qt.GlobalColor) -> None: ...@overloaddef __init__(self, button: Union[PySide6.QtGui.QColor, PySide6.QtGui.QRgba64, Any, PySide6.QtCore.Qt.GlobalColor, str, int]) -> None: ...@overloaddef __init__(self, button: Union[PySide6.QtGui.QColor, PySide6.QtGui.QRgba64, Any, PySide6.QtCore.Qt.GlobalColor, str, int], window: Union[PySide6.QtGui.QColor, PySide6.QtGui.QRgba64, Any, PySide6.QtCore.Qt.GlobalColor, str, int]) -> None: ...@overloaddef __init__(self, palette: Union[PySide6.QtGui.QPalette, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor]) -> None: ...@overloaddef __init__(self, windowText: Union[PySide6.QtGui.QBrush, PySide6.QtCore.Qt.BrushStyle, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor, PySide6.QtGui.QGradient, PySide6.QtGui.QImage, PySide6.QtGui.QPixmap], button: Union[PySide6.QtGui.QBrush, PySide6.QtCore.Qt.BrushStyle, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor, PySide6.QtGui.QGradient, PySide6.QtGui.QImage, PySide6.QtGui.QPixmap], light: Union[PySide6.QtGui.QBrush, PySide6.QtCore.Qt.BrushStyle, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor, PySide6.QtGui.QGradient, PySide6.QtGui.QImage, PySide6.QtGui.QPixmap], dark: Union[PySide6.QtGui.QBrush, PySide6.QtCore.Qt.BrushStyle, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor, PySide6.QtGui.QGradient, PySide6.QtGui.QImage, PySide6.QtGui.QPixmap], mid: Union[PySide6.QtGui.QBrush, PySide6.QtCore.Qt.BrushStyle, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor, PySide6.QtGui.QGradient, PySide6.QtGui.QImage, PySide6.QtGui.QPixmap], text: Union[PySide6.QtGui.QBrush, PySide6.QtCore.Qt.BrushStyle, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor, PySide6.QtGui.QGradient, PySide6.QtGui.QImage, PySide6.QtGui.QPixmap], bright_text: Union[PySide6.QtGui.QBrush, PySide6.QtCore.Qt.BrushStyle, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor, PySide6.QtGui.QGradient, PySide6.QtGui.QImage, PySide6.QtGui.QPixmap], base: Union[PySide6.QtGui.QBrush, PySide6.QtCore.Qt.BrushStyle, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor, PySide6.QtGui.QGradient, PySide6.QtGui.QImage, PySide6.QtGui.QPixmap], window: Union[PySide6.QtGui.QBrush, PySide6.QtCore.Qt.BrushStyle, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor, PySide6.QtGui.QGradient, PySide6.QtGui.QImage, PySide6.QtGui.QPixmap]) -> None: ...@overloaddef __init__(self, windowText: Union[PySide6.QtGui.QColor, PySide6.QtGui.QRgba64, Any, PySide6.QtCore.Qt.GlobalColor, str, int], window: Union[PySide6.QtGui.QColor, PySide6.QtGui.QRgba64, Any, PySide6.QtCore.Qt.GlobalColor, str, int], light: Union[PySide6.QtGui.QColor, PySide6.QtGui.QRgba64, Any, PySide6.QtCore.Qt.GlobalColor, str, int], dark: Union[PySide6.QtGui.QColor, PySide6.QtGui.QRgba64, Any, PySide6.QtCore.Qt.GlobalColor, str, int], mid: Union[PySide6.QtGui.QColor, PySide6.QtGui.QRgba64, Any, PySide6.QtCore.Qt.GlobalColor, str, int], text: Union[PySide6.QtGui.QColor, PySide6.QtGui.QRgba64, Any, PySide6.QtCore.Qt.GlobalColor, str, int], base: Union[PySide6.QtGui.QColor, PySide6.QtGui.QRgba64, Any, PySide6.QtCore.Qt.GlobalColor, str, int]) -> None: ...@staticmethoddef __copy__() -> None: ...def __lshift__(self, ds: PySide6.QtCore.QDataStream) -> PySide6.QtCore.QDataStream: ...def __rshift__(self, ds: PySide6.QtCore.QDataStream) -> PySide6.QtCore.QDataStream: ...def accent(self) -> PySide6.QtGui.QBrush: ...def alternateBase(self) -> PySide6.QtGui.QBrush: ...def base(self) -> PySide6.QtGui.QBrush: ...def brightText(self) -> PySide6.QtGui.QBrush: ...@overloaddef brush(self, cg: PySide6.QtGui.QPalette.ColorGroup, cr: PySide6.QtGui.QPalette.ColorRole) -> PySide6.QtGui.QBrush: ...@overloaddef brush(self, cr: PySide6.QtGui.QPalette.ColorRole) -> PySide6.QtGui.QBrush: ...def button(self) -> PySide6.QtGui.QBrush: ...def buttonText(self) -> PySide6.QtGui.QBrush: ...def cacheKey(self) -> int: ...@overloaddef color(self, cg: PySide6.QtGui.QPalette.ColorGroup, cr: PySide6.QtGui.QPalette.ColorRole) -> PySide6.QtGui.QColor: ...@overloaddef color(self, cr: PySide6.QtGui.QPalette.ColorRole) -> PySide6.QtGui.QColor: ...def currentColorGroup(self) -> PySide6.QtGui.QPalette.ColorGroup: ...def dark(self) -> PySide6.QtGui.QBrush: ...def highlight(self) -> PySide6.QtGui.QBrush: ...def highlightedText(self) -> PySide6.QtGui.QBrush: ...def isBrushSet(self, cg: PySide6.QtGui.QPalette.ColorGroup, cr: PySide6.QtGui.QPalette.ColorRole) -> bool: ...def isCopyOf(self, p: Union[PySide6.QtGui.QPalette, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor]) -> bool: ...def isEqual(self, cr1: PySide6.QtGui.QPalette.ColorGroup, cr2: PySide6.QtGui.QPalette.ColorGroup) -> bool: ...def light(self) -> PySide6.QtGui.QBrush: ...def link(self) -> PySide6.QtGui.QBrush: ...def linkVisited(self) -> PySide6.QtGui.QBrush: ...def mid(self) -> PySide6.QtGui.QBrush: ...def midlight(self) -> PySide6.QtGui.QBrush: ...def placeholderText(self) -> PySide6.QtGui.QBrush: ...def resolve(self, other: Union[PySide6.QtGui.QPalette, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor]) -> PySide6.QtGui.QPalette: ...def resolveMask(self) -> int: ...@overloaddef setBrush(self, cg: PySide6.QtGui.QPalette.ColorGroup, cr: PySide6.QtGui.QPalette.ColorRole, brush: Union[PySide6.QtGui.QBrush, PySide6.QtCore.Qt.BrushStyle, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor, PySide6.QtGui.QGradient, PySide6.QtGui.QImage, PySide6.QtGui.QPixmap]) -> None: ...@overloaddef setBrush(self, cr: PySide6.QtGui.QPalette.ColorRole, brush: Union[PySide6.QtGui.QBrush, PySide6.QtCore.Qt.BrushStyle, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor, PySide6.QtGui.QGradient, PySide6.QtGui.QImage, PySide6.QtGui.QPixmap]) -> None: ...@overloaddef setColor(self, cg: PySide6.QtGui.QPalette.ColorGroup, cr: PySide6.QtGui.QPalette.ColorRole, color: Union[PySide6.QtGui.QColor, PySide6.QtGui.QRgba64, Any, PySide6.QtCore.Qt.GlobalColor, str, int]) -> None: ...@overloaddef setColor(self, cr: PySide6.QtGui.QPalette.ColorRole, color: Union[PySide6.QtGui.QColor, PySide6.QtGui.QRgba64, Any, PySide6.QtCore.Qt.GlobalColor, str, int]) -> None: ...def setColorGroup(self, cr: PySide6.QtGui.QPalette.ColorGroup, windowText: Union[PySide6.QtGui.QBrush, PySide6.QtCore.Qt.BrushStyle, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor, PySide6.QtGui.QGradient, PySide6.QtGui.QImage, PySide6.QtGui.QPixmap], button: Union[PySide6.QtGui.QBrush, PySide6.QtCore.Qt.BrushStyle, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor, PySide6.QtGui.QGradient, PySide6.QtGui.QImage, PySide6.QtGui.QPixmap], light: Union[PySide6.QtGui.QBrush, PySide6.QtCore.Qt.BrushStyle, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor, PySide6.QtGui.QGradient, PySide6.QtGui.QImage, PySide6.QtGui.QPixmap], dark: Union[PySide6.QtGui.QBrush, PySide6.QtCore.Qt.BrushStyle, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor, PySide6.QtGui.QGradient, PySide6.QtGui.QImage, PySide6.QtGui.QPixmap], mid: Union[PySide6.QtGui.QBrush, PySide6.QtCore.Qt.BrushStyle, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor, PySide6.QtGui.QGradient, PySide6.QtGui.QImage, PySide6.QtGui.QPixmap], text: Union[PySide6.QtGui.QBrush, PySide6.QtCore.Qt.BrushStyle, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor, PySide6.QtGui.QGradient, PySide6.QtGui.QImage, PySide6.QtGui.QPixmap], bright_text: Union[PySide6.QtGui.QBrush, PySide6.QtCore.Qt.BrushStyle, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor, PySide6.QtGui.QGradient, PySide6.QtGui.QImage, PySide6.QtGui.QPixmap], base: Union[PySide6.QtGui.QBrush, PySide6.QtCore.Qt.BrushStyle, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor, PySide6.QtGui.QGradient, PySide6.QtGui.QImage, PySide6.QtGui.QPixmap], window: Union[PySide6.QtGui.QBrush, PySide6.QtCore.Qt.BrushStyle, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor, PySide6.QtGui.QGradient, PySide6.QtGui.QImage, PySide6.QtGui.QPixmap]) -> None: ...def setCurrentColorGroup(self, cg: PySide6.QtGui.QPalette.ColorGroup) -> None: ...def setResolveMask(self, mask: int) -> None: ...def shadow(self) -> PySide6.QtGui.QBrush: ...def swap(self, other: Union[PySide6.QtGui.QPalette, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor]) -> None: ...def text(self) -> PySide6.QtGui.QBrush: ...def toolTipBase(self) -> PySide6.QtGui.QBrush: ...def toolTipText(self) -> PySide6.QtGui.QBrush: ...def window(self) -> PySide6.QtGui.QBrush: ...def windowText(self) -> PySide6.QtGui.QBrush: ...

QPalette 类有两个基本的概念,一个是颜色组ColorGroup,另一个是颜色角色ColorRole。 

1、颜色角色ColorRole:

from PySide6.QtWidgets import QApplication, QLabel
from PySide6.QtGui import QColor, QPaletteapp = QApplication([])
palette = QPalette()    # 创建调色板
color_red = QColor(255, 0, 0)  # 定义红色
color_green = QColor(0, 255, 0)  # 定义绿色
color_gray = QColor(130, 130, 130)  # 定义灰色palette.setColor(QPalette.ColorRole.WindowText, color_red)    # 将调色板的窗口文字设置为红色
palette.setColor(QPalette.ColorRole.Window, color_green)    # 将调色板的窗口颜色设置为绿色label = QLabel("Hello World!")    # 创建部件
label.setPalette(palette)          # 将调色板应用到部件
label.show()                       # 显示部件app.exec()

 运行结果:这里通过setColor的方法将调色板的窗口文字和背景颜色方便设置为了红色和绿色,并应用到部件。

还可使用 palette()的方法来获取一个既有的调色板,以及通过color()来获取调色板中的某一个具体颜色:

例如:

p = label.palette()    # p是一个既有的部件label的调色板

color1 = p.color(p.ColorRole.WindowText)     # 获取调色板中的窗口文字的颜色

demo:

import timefrom PySide6.QtWidgets import QApplication, QLabel
from PySide6.QtGui import QColor, QPaletteapp = QApplication([])
palette = QPalette()    # 创建调色板
color_red = QColor(255, 0, 0)  # 定义红色
color_green = QColor(0, 255, 0)  # 定义绿色
color_gray = QColor(130, 130, 130)  # 定义灰色palette.setColor(QPalette.ColorRole.WindowText, color_red)    # 将调色板的窗口文字设置为红色
palette.setColor(QPalette.ColorRole.Window, color_green)    # 将调色板的窗口颜色设置为绿色label = QLabel("Hello World!")    # 创建部件
label.setPalette(palette)          # 将调色板应用到部件
label.show()                       # 显示部件time.sleep(5)   # 延时5秒p = label.palette()      # 获取已有部件label的调色板
color1 = p.color(p.ColorRole.WindowText)    # 获取窗口文字的颜色
color2 = p.color(p.ColorRole.Window)        # 获取背景色palette.setColor(QPalette.ColorRole.WindowText, color2)    # 重新设置调色板的窗口文字颜色
palette.setColor(QPalette.ColorRole.Window, color1)    # 重新设置调色板的背景色
label.setPalette(palette)          # 将调色板应用到部件app.exec()

运行之后可以看到,首先显示了一个绿底红字的部件。 

5秒钟后,变成如下:

 


2、颜色组 ColorGroup:

ColorGroup 分为3 种情况
·  激活状态(Active,获得焦点)、 
·  非激活状态(Inactive,失去焦点) 
·  失效状态(Disabled,不可用),例如进行多窗口操作时.单击其中的一个窗口,可以在窗口中输人数据,则这个窗口是激活状态,其他窗口是非活跃状态。 将
ColorGroup 和ColorRole 结合起来,可以为控件不同部分不同状态设置不同的颜色。 

import timefrom PySide6.QtWidgets import QApplication, QLabel
from PySide6.QtGui import QColor, QPaletteapp = QApplication([])
palette = QPalette()  # 创建调色板
color_red = QColor(255, 30, 30)  # 定义红色
color_green = QColor(30, 255, 30)  # 定义绿色
color_gray = QColor(130, 130, 130)  # 定义灰色
color_black = QColor(10, 10, 10)  # 定义黑色palette.setColor(QPalette.ColorRole.WindowText, color_red)  # 将调色板的窗口文字设置为红色
palette.setColor(QPalette.ColorRole.Window, color_green)  # 将调色板的窗口颜色设置为绿色
disable_color_group = QPalette.ColorGroup(QPalette.ColorGroup.Disabled)  # 获取Disabled的颜色组
palette.setColor(disable_color_group, QPalette.ColorRole.WindowText, color_black)  # 将Disabled的颜色组的窗口文本设为灰色
palette.setColor(disable_color_group, QPalette.ColorRole.Window, color_gray)  # 将Disabled的颜色组的窗口背景设为黑色label = QLabel("Hello World!")  # 创建部件
label.setPalette(palette)  # 将调色板应用到部件
label.show()  # 显示部件time.sleep(3)  # 延时3秒
label.setDisabled(True)   # 禁用部件app.exec()

 运行截图:

相关文章:

pyside6的调色板QPalette的简单应用

使用调色板需要先导入:from PySide6.QtGui import QPalette 调色板QPalette的源代码: class QPalette(Shiboken.Object):class ColorGroup(enum.Enum):Active : QPalette.ColorGroup ... # 0x0Normal : QPalette.ColorGrou…...

苍穹外卖项目

Day01 收获 补习git Git学习之路-CSDN博客 nginx 作用:反向代理和负载均衡 swagger Swagger 与 Yapi Swagger: 可以自动的帮助开发人员生成接口文档,并对接口进行测试。 项目接口文档网址: http://localhost:8080/doc.html Da…...

error: Execution was interrupted, reason: signal SIGABRT

c json解析时&#xff0c; error: Execution was interrupted, reason: signal SIGABRT const Json::Value points root["shapes"]; if (points.isArray()) { for (unsigned int i 0; i < points.size(); i) { std::cout << " - [" <<…...

HarmaonyOS鸿蒙应用科普课

一、什么是鸿蒙OS&#xff1f; 1.概念&#xff1a; 先给大家讲讲今天讲课的主题&#xff0c;鸿蒙OS是什么&#xff1f;鸿蒙系统大家都知道&#xff0c;就是一个操作系统&#xff0c;我们未来是为的成为鸿蒙程序员。所以我们不要将鸿蒙os完全等同于手机操作系统&#xff0c;太…...

数码管的显示

静态数码管显示 数码管有两种一种的负电压促发,一种是正电压促发,上图是单数码管的引脚 上图是数码管模组的引脚,采用了引脚复用技术 咱们这个单片机由8个单数码管,所以要用上38译码器,如下图 74138使能端,单片机上电直接就默认接通了 74HC245的作用是稳定输入输出,数据缓冲作…...

关于海康相机和镜头参数的记录

对比MV-CS020-10UC和大家用的最多的MV-CS016-10UC 其实前者适合雷达站使用&#xff0c;后者适合自瞄使用 一&#xff1a;MV-CS020-10UC的参数 二&#xff1a;对比 三&#xff1a;海康镜头选型工具...

【JavaScript】运算符

算术运算符 1. 加法运算符&#xff08;&#xff09; 加法运算符用于将两个值相加。如果两个操作数都是数字&#xff0c;则它们将被加在一起。如果其中一个操作数是字符串&#xff0c;则另一个操作数将被转换为字符串&#xff0c;然后执行字符串连接。 运算子不同&#xff0c…...

LabVIEW航空发动机主轴承试验器数据采集与监测

LabVIEW航空发动机主轴承试验器数据采集与监测 随着航空技术的迅速发展&#xff0c;对航空发动机性能的测试与监测提出了更高的要求。传统的数据采集与监测方法已难以满足当前高精度和高可靠性的需求&#xff0c;特别是在主轴承试验方面。基于LabVIEW的航空发动机主轴承试验器…...

CVE-2022-2602:unix_gc 错误释放 io_uring 注册的文件从而导致的 file UAF

前言 复现该漏洞只是为了学习相关知识&#xff0c;在这里仅仅做简单记录下 exp&#xff0c;关于漏洞的详细内容请参考其他文章&#xff0c;最后在 v5.18.19 内核版本上复现成功&#xff0c;v6.0.2 复现失败 漏洞利用 diff --git a/include/linux/skbuff.h b/include/linux/s…...

LSTM实战笔记(部署到C++上)——更新中

前几天由于自己的个人原因停止了学习 接下里继续更新一些自己项目中所用到的神经网络等 ——————————————————————————————————————————— LSTM代码介绍 建立LSTM模型时需要设置一些参数&#xff0c;包括输入数据的形状、LSTM层的…...

鸿蒙内核源码分析(消息队列篇) | 进程间如何异步传递大数据

基本概念 队列又称消息队列&#xff0c;是一种常用于任务间通信的数据结构。队列接收来自任务或中断的不固定长度消息&#xff0c;并根据不同的接口确定传递的消息是否存放在队列空间中。 任务能够从队列里面读取消息&#xff0c;当队列中的消息为空时&#xff0c;挂起读取任务…...

Sentinel流量防卫兵

1、分布式服务遇到的问题 服务可用性问题 服务可用性场景 服务雪崩效应 因服务提供者的不可用导致服务调用者的不可用,并将不可用逐渐放大的过程&#xff0c;就叫服务雪崩效应导致服务不可用的原因&#xff1a; 在服务提供者不可用的时候&#xff0c;会出现大量重试的情况&…...

微信小程序:14.什么是wxs,wxs的使用

wxs是小程序独有的一套脚本语言&#xff0c;结合wxml&#xff0c;可以构建出页面的结构 wxs的应用场景 wxml中无法调用在页面的js中定义的函数&#xff0c;但是wxml可以调用wxs中定义的函数。因此小程序中wxs的典型应用场景就是过滤器 wxs和js的关系 wxs有自己的数据类型 …...

Django运行不提示网址问题

问题描述&#xff1a;运行django项目不提示网址信息&#xff0c;也就是web没有起来&#xff0c;无法访问。 (my-venv-3.8) PS D:\Project\MyGitCode\public\it_blog\blog> python .\manage.py runserver INFO autoreload 636 Watching for file changes with StatReloader …...

web安全---xss漏洞/beef-xss基本使用

what xss漏洞----跨站脚本攻击&#xff08;Cross Site Scripting&#xff09;&#xff0c;攻击者在网页中注入恶意脚本代码&#xff0c;使受害者在浏览器中运行该脚本&#xff0c;从而达到攻击目的。 分类 反射型---最常见&#xff0c;最广泛 用户将带有恶意代码的url打开&a…...

第一天学习(GPT)

1.图片和语义是如何映射的&#xff1f; **Dalle2&#xff1a;**首先会对图片和语义进行预训练&#xff0c;将二者向量存储起来&#xff0c;然后将语义的vector向量转成图片的向量&#xff0c;然后基于这个图片往回反向映射&#xff08;Diffusion&#xff09;——>根据这段描…...

【C++之AVL树旋转操作的详细图解】

C++学习笔记---022 C++之AVL树旋转操作的详细图解1、AVL树的简单介绍1.1、基本概念1.2、平衡因子1.3、AVL树的特性2、C++中pair的介绍2.1、定义和初始化2.2、访问元素2.3、作为容器的元素2.4、作为函数的返回值3、AVL树节点的定义4、AVL的插入规则探究5、AVL树的旋转操作5.1、R…...

制作Android分区镜像

1 python生成一个sector数据 def get_oem_bootmode(): # Header size SECTOR_SIZE_IN_BYTES 512 header [0 for i in \ range(SECTOR_SIZE_IN_BYTES)] # magic # The ord() built-in function in # Python converts a character # into …...

如何代码激活service——packageKit 系统更新番外

在访问packageKit服务的过程中&#xff0c;服务一直访问失败&#xff0c;PackageKit::Daemon::global()->isRunning() 一直返回false&#xff0c;他是一个用于检查 PackageKit 守护进程是否正在运行的函数调用。在 Qt 和 PackageKit 的集成中&#xff0c;isRunning 方法通常…...

音视频常用工具

VLC 播放器简介 VLC 播放器 VLC支持多种常见音视频格式&#xff0c;支持多种流媒体传输协议&#xff0c;也可当作本地流媒体服务器使用&#xff0c;功能十分强大。官网下载地址: https://www.videolan.org/ VLC media player VLC 是一款自由、开源的跨平台多媒体播放器及框架&…...

Ubuntu系统下交叉编译openssl

一、参考资料 OpenSSL&&libcurl库的交叉编译 - hesetone - 博客园 二、准备工作 1. 编译环境 宿主机&#xff1a;Ubuntu 20.04.6 LTSHost&#xff1a;ARM32位交叉编译器&#xff1a;arm-linux-gnueabihf-gcc-11.1.0 2. 设置交叉编译工具链 在交叉编译之前&#x…...

Mybatis逆向工程,动态创建实体类、条件扩展类、Mapper接口、Mapper.xml映射文件

今天呢&#xff0c;博主的学习进度也是步入了Java Mybatis 框架&#xff0c;目前正在逐步杨帆旗航。 那么接下来就给大家出一期有关 Mybatis 逆向工程的教学&#xff0c;希望能对大家有所帮助&#xff0c;也特别欢迎大家指点不足之处&#xff0c;小生很乐意接受正确的建议&…...

pam_env.so模块配置解析

在PAM&#xff08;Pluggable Authentication Modules&#xff09;配置中&#xff0c; /etc/pam.d/su 文件相关配置含义如下&#xff1a; 配置解析 auth required pam_env.so1. 字段分解 字段值说明模块类型auth认证类模块&#xff0c;负责验证用户身份&am…...

Objective-C常用命名规范总结

【OC】常用命名规范总结 文章目录 【OC】常用命名规范总结1.类名&#xff08;Class Name)2.协议名&#xff08;Protocol Name)3.方法名&#xff08;Method Name)4.属性名&#xff08;Property Name&#xff09;5.局部变量/实例变量&#xff08;Local / Instance Variables&…...

ESP32读取DHT11温湿度数据

芯片&#xff1a;ESP32 环境&#xff1a;Arduino 一、安装DHT11传感器库 红框的库&#xff0c;别安装错了 二、代码 注意&#xff0c;DATA口要连接在D15上 #include "DHT.h" // 包含DHT库#define DHTPIN 15 // 定义DHT11数据引脚连接到ESP32的GPIO15 #define D…...

【CSS position 属性】static、relative、fixed、absolute 、sticky详细介绍,多层嵌套定位示例

文章目录 ★ position 的五种类型及基本用法 ★ 一、position 属性概述 二、position 的五种类型详解(初学者版) 1. static(默认值) 2. relative(相对定位) 3. absolute(绝对定位) 4. fixed(固定定位) 5. sticky(粘性定位) 三、定位元素的层级关系(z-i…...

什么是库存周转?如何用进销存系统提高库存周转率?

你可能听说过这样一句话&#xff1a; “利润不是赚出来的&#xff0c;是管出来的。” 尤其是在制造业、批发零售、电商这类“货堆成山”的行业&#xff0c;很多企业看着销售不错&#xff0c;账上却没钱、利润也不见了&#xff0c;一翻库存才发现&#xff1a; 一堆卖不动的旧货…...

ardupilot 开发环境eclipse 中import 缺少C++

目录 文章目录 目录摘要1.修复过程摘要 本节主要解决ardupilot 开发环境eclipse 中import 缺少C++,无法导入ardupilot代码,会引起查看不方便的问题。如下图所示 1.修复过程 0.安装ubuntu 软件中自带的eclipse 1.打开eclipse—Help—install new software 2.在 Work with中…...

UR 协作机器人「三剑客」:精密轻量担当(UR7e)、全能协作主力(UR12e)、重型任务专家(UR15)

UR协作机器人正以其卓越性能在现代制造业自动化中扮演重要角色。UR7e、UR12e和UR15通过创新技术和精准设计满足了不同行业的多样化需求。其中&#xff0c;UR15以其速度、精度及人工智能准备能力成为自动化领域的重要突破。UR7e和UR12e则在负载规格和市场定位上不断优化&#xf…...

Pinocchio 库详解及其在足式机器人上的应用

Pinocchio 库详解及其在足式机器人上的应用 Pinocchio (Pinocchio is not only a nose) 是一个开源的 C 库&#xff0c;专门用于快速计算机器人模型的正向运动学、逆向运动学、雅可比矩阵、动力学和动力学导数。它主要关注效率和准确性&#xff0c;并提供了一个通用的框架&…...