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

网站起域名原则智能建造论文

网站起域名原则,智能建造论文,易店无忧官网,哪家公司建别墅好在 Qt 中#xff0c;可以通过样式表#xff08;QSS#xff09;为 QTableWidget 设置各种样式。以下是一些常见的样式设置示例#xff1a; 1. 基本样式设置 tableWidget-setStyleSheet(// 表格整体样式QTableWidget { background-color: #F0F0F0;…在 Qt 中可以通过样式表QSS为 QTableWidget 设置各种样式。以下是一些常见的样式设置示例 1. 基本样式设置 tableWidget-setStyleSheet(// 表格整体样式QTableWidget { background-color: #F0F0F0; // 背景色 gridline-color: #C0C0C0; // 网格线颜色 border: 1px solid gray; // 边框}// 表头样式QHeaderView::section { background-color: #404040; // 表头背景 color: white; // 文字颜色 padding: 4px; // 内边距 border: 1px solid #505050; // 边框 min-height: 25px; // 最小高度}// 单元格样式QTableWidget::item { color: #333333; // 文字颜色 border-bottom: 1px solid #D0D0D0; // 底部边框}// 选中状态QTableWidget::item:selected { background-color: #B8D6FF; // 选中背景色 color: black; // 选中文字颜色} );2. 高级样式设置 // 交替行颜色需要开启交替行颜色功能 tableWidget-setAlternatingRowColors(true); tableWidget-setStyleSheet(QTableWidget { alternate-background-color: #F8F8F8; } );// 角部按钮样式表格左上角按钮 tableWidget-setStyleSheet(QTableCornerButton::section { background-color: #404040; border: 1px solid #505050;} );// 禁用状态样式 tableWidget-setStyleSheet(QTableWidget:disabled { color: #808080; background-color: #F0F0F0;} );// 设置特定列宽/行高 tableWidget-horizontalHeader()-setDefaultSectionSize(150); // 列宽 tableWidget-verticalHeader()-setDefaultSectionSize(30); // 行高3. 自定义单元格样式 // 通过代理自定义样式需要继承 QStyledItemDelegate class CustomDelegate : public QStyledItemDelegate { public:void paint(QPainter* painter, const QStyleOptionViewItem option, const QModelIndex index) const override {// 自定义绘制逻辑if(index.column() 0) {painter-fillRect(option.rect, QColor(#FFE4E1));}QStyledItemDelegate::paint(painter, option, index);} };// 设置代理 tableWidget-setItemDelegate(new CustomDelegate());4. 动态样式设置 // 修改特定行颜色 for(int row 0; row tableWidget-rowCount(); row) {QTableWidgetItem* item tableWidget-item(row, 0);if(item) {item-setBackground(QColor(#E6F3FF));item-setForeground(Qt::blue);} }// 设置特定单元格样式 QTableWidgetItem* specialItem new QTableWidgetItem(Important); specialItem-setData(Qt::UserRole, special); tableWidget-setItem(0, 0, specialItem);// 在样式表中添加特殊样式 tableWidget-setStyleSheet(QTableWidgetItem[special\true\] { background-color: #FFD700; font-weight: bold;} );5. 完整样式表示例 tableWidget-setStyleSheet(R(QTableWidget {background-color: #FFFFFF;alternate-background-color: #F8F8F8;gridline-color: #E0E0E0;border: 1px solid #D0D0D0;font-size: 12px;}QHeaderView::section {background-color: #0078D4;color: white;padding: 4px;border: none;min-height: 28px;}QHeaderView::section:hover {background-color: #006CBC;}QHeaderView::section:pressed {background-color: #005AA3;}QTableWidget::item {border-bottom: 1px solid #E0E0E0;padding: 4px;}QTableWidget::item:selected {background-color: #B8D6FF;color: #000000;}QTableCornerButton::section {background-color: #0078D4;border: none;}QScrollBar:vertical {width: 12px;background: #F0F0F0;}QScrollBar::handle:vertical {background: #C0C0C0;min-height: 20px;} ));注意事项 样式表优先级高于代码设置的属性使用 alternate-background-color 需要先调用 setAlternatingRowColors(true)复杂的样式建议使用 QSS 文件管理对于性能敏感的场景避免频繁修改样式表可以使用 Qt Style Sheet Reference 查看所有可用属性
http://www.dnsts.com.cn/news/242487.html

相关文章:

  • 做网站的调查问卷工业企业解决方案
  • 品牌建设的思路视频网站seo怎么做
  • 贵港网站建设wordpress手机怎么分享链接
  • 做自媒体哪家网站好如何查看网站是谁建设的
  • 太原建站的模板什么叫营销模式
  • 做asp网站的实验收获wordpress wp_post
  • 企业网站维护无锡网站优化
  • 企业网站建设大概的费用社交媒体营销案例
  • 深圳网站公司排名网站开发流程图 最
  • 网站的绝对路径怎么做陆良县住房和城乡建设局网站
  • 门户网站推广介绍方案wordpress 图片模板
  • 找公司做网站需要注意百度投放广告平台
  • 网站主题颜色国外军事新闻最新消息
  • 网站建站要多少钱阿里云虚拟主机多个网站吗
  • 360元网站建设 网络服务什么是网络营销的红海
  • 海口快速建站公司推荐上海3d网站建设
  • wordpress网站专题信誉好的东莞网站推广
  • 织梦网站怎么上传福州网站制作服务
  • 想做一个部门的网站怎么做请问聊城网站建设
  • 网站建设多少价格网站规划与建设
  • 做私人彩票网站织梦网站被黑
  • 如何做网站搜索栏装修网站线怎样做
  • 旅游网站建设规模厦门外贸商城网站建设
  • 网站中链接怎么做百度推广账号登录
  • 织梦网站2个模型怎样在拼多多平台上卖货
  • 空间设计网站推荐大连网站建设个人
  • 3d打印网站开发凌云县城乡建设局网站
  • 找设计公司上哪个网站中国电子商务官网首页
  • 戴尔官方网站建设启示网站建设用什么
  • 网站佣金怎么做凭证河北省建设工程招投标管理网站