0
点赞
收藏
分享

微信扫一扫

k8s中的层级结构,及节点组件的作用

小桥流水2016 2024-09-08 阅读 4

先给QLabel 固定高度

 # 这里让背景框适配聊天框
        font_metrics = QFontMetrics(font)
        rect = font_metrics.boundingRect(QRect(0, 0, self.width(), 1920), Qt.TextFlag.TextWordWrap,text)
        newWidth = rect.width() + 40
        if rect.width() < 800:
            self.setMaximumWidth(newWidth)
        self.adjustSize()
        # 这里列表 导致高度错误 固定高度
        if is_send:
             self.setFixedHeight(self.height())

 最后效果

原来情况

 

举报

相关推荐

0 条评论