惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

大猫的无限游戏
大猫的无限游戏
月光博客
月光博客
博客园 - Franky
博客园 - 三生石上(FineUI控件)
爱范儿
爱范儿
博客园 - 司徒正美
博客园 - 叶小钗
Apple Machine Learning Research
Apple Machine Learning Research
美团技术团队
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
The Cloudflare Blog
B
Blog RSS Feed
阮一峰的网络日志
阮一峰的网络日志
宝玉的分享
宝玉的分享
V
Visual Studio Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
IT之家
IT之家
博客园_首页
S
SegmentFault 最新的问题
A
About on SuperTechFans
Blog — PlanetScale
Blog — PlanetScale
GbyAI
GbyAI
H
Help Net Security
MongoDB | Blog
MongoDB | Blog

博客园 - 赵长青

每天fetch origin, rebase origin/xx gerrit冲突修改 安装wine 安装claude code 安装playwright vue3中 element-plus ,vein-plus的 aria-hidden问题,无障碍访问警告,辅助技术如屏幕阅读器无法识别聚集元素,违反wai-aria规范 vue3中图片、示例文件下载适应打包后路径不存在 ant-design中<a-table前端分页 ant-design中<a-table获取多分页中选择、全选问题处理 GeoScene Pro试用申请 nuget问题,程序包源找不到,安装不上 arcgis engine10.8现在都没有破解的吧,这些功能报错 超图版本cesium加载3dtiles数据要加这行 cesium 点击弹窗鼠标移动跟随,不用infobox 使用超图SuperMap iClient3D for Cesium 2025 webstorm 右键打开项目不见src目录,删除.idea目录 删除右键"上传到夸克网盘"/"上传到百度网盘"/“上传到迅雷云盘 wsl-windows中ubuntu22.04 postgis初始sql pycharm2023的intepreter 路径存在哪儿呢 ?太多要清理一下 qq小程序不能创建
pyqt5+qgis 01-修改界面颜色
赵长青 · 2025-06-17 · via 博客园 - 赵长青
import sys
import os
from qgis.core import *
from qgis.gui import *
from PyQt5.QtWidgets import (QApplication, QMainWindow, QAction, QLineEdit,
                             QVBoxLayout, QWidget)
from PyQt5.QtGui import QIcon

class MyApp(QMainWindow):
    def __init__(self):
        super().__init__()

        # 1. 设置环境变量
        os.environ['QT_PLUGIN_PATH'] = r"C:\Program Files\QGIS 3.28.0\apps\Qt5\plugins"
        os.environ['PATH'] = r"C:\Program Files\QGIS 3.28.0\bin;" + os.environ['PATH']

        # 2. 初始化QGIS应用
        QgsApplication.setPrefixPath(r"C:\Program Files\QGIS 3.28.0\apps\qgis", True)
        self.qgs = QgsApplication([], False)
        self.qgs.initQgis()

        # 3. 设置主窗口
        self.setWindowTitle("QGIS独立应用")
        self.resize(800, 600)

        # 创建中央部件和主布局
        central_widget = QWidget()
        self.setCentralWidget(central_widget)
        main_layout = QVBoxLayout()
        central_widget.setLayout(main_layout)

        # 添加工具栏
        toolbar = self.addToolBar("Tools")
        toolbar.setStyleSheet("background-color: yellow")

        zoom_in = QAction(QIcon("zoom_in.png"), "放大", self)
        toolbar.addAction(zoom_in)

        # 创建编辑框并添加到主布局
        self.nameEdit = QLineEdit()
        self.nameEdit.setStyleSheet("""
            color: blue;
            background-color: yellow;
            selection-color: white;
            selection-background-color: green;
        """)

        # 将编辑框添加到主布局(工具栏下方)
        main_layout.addWidget(self.nameEdit)

        # 添加地图画布到主布局
        self.canvas = QgsMapCanvas()
        self.canvas.setStyleSheet("color: blue; background-color: green")  #无效
        main_layout.addWidget(self.canvas)


if __name__ == '__main__':
    app = QApplication(sys.argv)
    window = MyApp()
    window.show()
    sys.exit(app.exec_())

 

posted on 2025-06-17 16:30  赵长青  阅读(71)  评论()    收藏  举报