From 47da87bbfda117799d03e06a2b4438d0f312b41c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9F=B3=E6=B2=88=E6=98=8A?= Date: Mon, 13 Jun 2022 15:10:54 +0800 Subject: [PATCH] --- pic.qrc | 6 ++++++ plugins/In_one/main.py | 45 ++++++++++++++++++++++----------------- plugins/In_one/pic.py | 42 ++++++++++++++++++++++++------------ plugins/In_one/pic/1.png | Bin 0 -> 920 bytes plugins/In_one/pic/2.png | Bin 0 -> 926 bytes plugins/plugins.yaml | 7 ++++++ 6 files changed, 67 insertions(+), 33 deletions(-) create mode 100644 pic.qrc create mode 100644 plugins/In_one/pic/1.png create mode 100644 plugins/In_one/pic/2.png diff --git a/pic.qrc b/pic.qrc new file mode 100644 index 0000000..19fe577 --- /dev/null +++ b/pic.qrc @@ -0,0 +1,6 @@ + + + plugins/In_one/pic/2.png + plugins/In_one/pic/1.png + + diff --git a/plugins/In_one/main.py b/plugins/In_one/main.py index 9992438..2050cab 100644 --- a/plugins/In_one/main.py +++ b/plugins/In_one/main.py @@ -3,9 +3,10 @@ import os import pdb from threading import Thread import numpy as np +from plugins.basic_change.main import MyDialog from rscder.gui.actions import ActionManager from rscder.plugins.basic import BasicPlugin -from PyQt5.QtWidgets import QAction, QDialog, QHBoxLayout, QVBoxLayout, QPushButton,QWidget,QLabel,QLineEdit,QPushButton,QPixmap +from PyQt5.QtWidgets import QAction, QDialog, QHBoxLayout, QVBoxLayout, QPushButton,QWidget,QLabel,QLineEdit,QPushButton from PyQt5.QtGui import QIcon,QPixmap from PyQt5.QtCore import Qt from rscder.gui.layercombox import RasterLayerCombox @@ -17,11 +18,11 @@ from plugins.In_one import pic class LockerButton(QPushButton): def __init__(self,parent=NULL): super(LockerButton,self).__init__(parent) - m_imageLabel = QLabel + m_imageLabel = QLabel(self) m_imageLabel.setFixedWidth(20) m_imageLabel.setScaledContents(True) m_imageLabel.setStyleSheet("QLabel{background-color:transparent;}") - m_textLabel = QLabel + m_textLabel = QLabel(self) m_textLabel.setStyleSheet("QLabel{background-color:transparent;}") self.m_imageLabel=m_imageLabel self.m_textLabel=m_textLabel @@ -30,8 +31,8 @@ class LockerButton(QPushButton): mainLayout.addWidget(self.m_imageLabel) mainLayout.addWidget(self.m_textLabel) - mainLayout.setMargin(0) - mainLayout.setSpacing(0) + # mainLayout.set + # mainLayout.setSpacing(0) self.setLayout(mainLayout) def SetImageLabel(self, pixmap:QPixmap): self.m_imageLabel.setPixmap(pixmap) @@ -49,12 +50,13 @@ class AllInOne(QDialog): #预处理 filterWeight=QWidget(self) - self.filerButton =LockerButton(); - self.filerButton.setObjectName("LockerButton") - self.filerButton.SetTextLabel("大小") - self.filerButton.SetImageLabel(QPixmap('../pic/右箭头.png')) - self.filerButton.setStyleSheet("#LockerButton{background-color:transparent}" - "#LockerButton:hover{background-color:rgba(195,195,195,0.4)}") + filterlayout=QVBoxLayout() + filerButton =LockerButton(filterWeight); + filerButton.setObjectName("LockerButton") + filerButton.SetTextLabel("大小") + filerButton.SetImageLabel(QPixmap('../pic/右箭头.png')) + filerButton.setStyleSheet("#LockerButton{background-color:transparent;border:none;}" + "#LockerButton:hover{background-color:rgba(195,195,195,0.4);border:none;}") self.layer_combox = RasterLayerCombox(self) layer_label = QLabel('图层:') hbox = QHBoxLayout() @@ -70,27 +72,31 @@ class AllInOne(QDialog): time_label.setText('X') self.x_size_input = x_size_input self.y_size_input = y_size_input - hlayout1 = QHBoxLayout(self) + hlayout1 = QHBoxLayout() hlayout1.addWidget(size_label) hlayout1.addWidget(x_size_input) hlayout1.addWidget(time_label) hlayout1.addWidget(y_size_input) - vlayout = QVBoxLayout(self) - vlayout.addWidget(self.filerButton) + vlayout = QVBoxLayout() + # vlayout.addWidget(filerButton) vlayout.addLayout(hbox) vlayout.addLayout(hlayout1) filterWeight.setLayout(vlayout) - + filterlayout.addWidget(filerButton) + filterlayout.addWidget(filterWeight) #变化检测 changeWeight=QWidget(self) totalvlayout=QVBoxLayout() - totalvlayout.addWidget(filterWeight) + totalvlayout.addLayout(filterlayout) + + totalvlayout.addStretch() + self.setLayout(totalvlayout) - self.filerButton.clicked.connect(lambda: self.hide(self.filerButton,filterWeight)) + filerButton.clicked.connect(lambda: self.hide(filerButton,filterWeight)) def hide(self,button:LockerButton,weight:QWidget): if ((button.hide_)%2)==1: @@ -99,7 +105,7 @@ class AllInOne(QDialog): else: weight.setVisible(True) button.SetImageLabel(QPixmap('../pic/下箭头.png')) - + button.hide_=(button.hide_)%2+1 class InOnePlugin(BasicPlugin): @staticmethod def info(): @@ -119,4 +125,5 @@ class InOnePlugin(BasicPlugin): def run(self): - pass \ No newline at end of file + myDialog=AllInOne(self.mainwindow) + myDialog.show() \ No newline at end of file diff --git a/plugins/In_one/pic.py b/plugins/In_one/pic.py index 5f0182a..dc7ef9d 100644 --- a/plugins/In_one/pic.py +++ b/plugins/In_one/pic.py @@ -132,35 +132,49 @@ qt_resource_data = b"\ " qt_resource_name = b"\ +\x00\x07\ +\x07\x3b\xe0\xb3\ +\x00\x70\ +\x00\x6c\x00\x75\x00\x67\x00\x69\x00\x6e\x00\x73\ +\x00\x06\ +\x05\x04\x66\x45\ +\x00\x49\ +\x00\x6e\x00\x5f\x00\x6f\x00\x6e\x00\x65\ \x00\x03\ \x00\x00\x76\xf3\ \x00\x70\ \x00\x69\x00\x63\ -\x00\x07\ -\x0f\x07\xfb\x67\ -\x4e\x0b\ -\x7b\xad\x59\x34\x00\x2e\x00\x70\x00\x6e\x00\x67\ -\x00\x07\ -\x07\x07\xef\x47\ -\x53\xf3\ -\x7b\xad\x59\x34\x00\x2e\x00\x70\x00\x6e\x00\x67\ +\x00\x05\ +\x00\x35\x57\x47\ +\x00\x32\ +\x00\x2e\x00\x70\x00\x6e\x00\x67\ +\x00\x05\ +\x00\x34\x57\x47\ +\x00\x31\ +\x00\x2e\x00\x70\x00\x6e\x00\x67\ " qt_resource_struct_v1 = b"\ \x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\ -\x00\x00\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\ -\x00\x00\x00\x20\x00\x00\x00\x00\x00\x01\x00\x00\x03\xa2\ -\x00\x00\x00\x0c\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\ +\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\ +\x00\x00\x00\x14\x00\x02\x00\x00\x00\x01\x00\x00\x00\x03\ +\x00\x00\x00\x26\x00\x02\x00\x00\x00\x02\x00\x00\x00\x04\ +\x00\x00\x00\x42\x00\x00\x00\x00\x00\x01\x00\x00\x03\xa2\ +\x00\x00\x00\x32\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\ " qt_resource_struct_v2 = b"\ \x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\ \x00\x00\x00\x00\x00\x00\x00\x00\ -\x00\x00\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x02\ +\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\ \x00\x00\x00\x00\x00\x00\x00\x00\ -\x00\x00\x00\x20\x00\x00\x00\x00\x00\x01\x00\x00\x03\xa2\ +\x00\x00\x00\x14\x00\x02\x00\x00\x00\x01\x00\x00\x00\x03\ +\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x26\x00\x02\x00\x00\x00\x02\x00\x00\x00\x04\ +\x00\x00\x00\x00\x00\x00\x00\x00\ +\x00\x00\x00\x42\x00\x00\x00\x00\x00\x01\x00\x00\x03\xa2\ \x00\x00\x01\x81\x56\x1e\xac\xc9\ -\x00\x00\x00\x0c\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\ +\x00\x00\x00\x32\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\ \x00\x00\x01\x81\x56\x1e\xbb\xa5\ " diff --git a/plugins/In_one/pic/1.png b/plugins/In_one/pic/1.png new file mode 100644 index 0000000000000000000000000000000000000000..298ae8ac27ad6d7ebc4df200d8759e6e9fa42c26 GIT binary patch literal 920 zcmWlYe@q(%6vw~UD{a%X+?CP@W3D&1A*M@QAP%x=dqqlV;%dcia~UEetiw#S4%BT{ zdXza@XIW!d0*NujR5NfHO{Vy3j!LneOktRT&WWqVV7H7xvxHn(vwHmT-uI99KHvA= zAJ1pAnw9bmasWz8T}{29+rxQvfWrA6{nAYlb zz{FwJ#h(XcmE`k|)lILDd~nY;p-Du4X*7mw8|*maSXFp3vd73jYAMgpl21txxa{E0 zHWi#y=pu(wOh3n{u}=hN)ymF5TVBGM*v{yXFSXL;B)Uk?U9da6K@n&Lb4~>D<0`ud z9<^+kz>h|;hTszL41>Mq3zmcKV9w=3tQ5<^hP&B3$nG&Vp}RzO9bAGEnQ*i4QvZ#E zam&%n9=m|{j0#Zy``J^0rMd9ZRB$hKJKD7-cN$Ai1HZpjTR@;w+xjn!L~h_zp$LEJ zXZwuc9xOk#l}1zUSI2QNT3=}^^8;=8Y@|pOq}T&uq@*^1>?O*2fH=`t4Xz!N3?j#| zO~4fF2{DSKfei#)2$=u_o=_q32)j#+6=^_DU=elQzRaNlBl3nDHIs?en5!ZL*O z**Y;0`Lj56?5o+zp11FQbhUJ|pgT;owi1#4XRn6#DZ z(My(Tw1}hcG{tpd+X5*ZdxJ+SS@x(F4=^d%zlVY};Vj{vb0I5bgzhoo%1_dWhHG)b zMF#v7()=BSa`&G!8)gqiy}2!{Dspk)hp$IOM_wD0aJ;)gM=%flragH`FK?VF1nvH> zG`~#D`9Ik&&wSC`a-fP-8Pwl6`AdbEPzpbgtYGx6eSmkG<5vuXx#RCH%lY0R Op#qD^T63Yg$@4#4*;HQu literal 0 HcmV?d00001 diff --git a/plugins/In_one/pic/2.png b/plugins/In_one/pic/2.png new file mode 100644 index 0000000000000000000000000000000000000000..8c8c44bcca3d0533f65d906a8700d81baa853e18 GIT binary patch literal 926 zcmchW?MqW}9L2wPyKPt3Y%3+Rsdq|fiuI~cX1bN;Lo%0^8tS%6&bkkM)3#RdTB`fBTB~&I`E{*f3PcU=F(Q>*D^~+lhKTer`vC@b z5V3c50!({U-mwb+x$r^z+!m1QIMZ{>93Z2OuH~y3h+5^VZ2v#kbuDyb(U|_wx_4kn ziesg>$Y9O>Ixpx6UY*rRWfiw*dp_edEQg|XGkL%Ln~KfHP#X_DXEYdaF5n$Dt0&;C zgtFPd2cln;6SlbzL^{%vvq1ovRp-cH+W~2X)ELu<11Ex#GL1ao2&vPI9e{d5R5is4 zfcQfCsy9-A^sUn-vt|rww^HYra6pa#>H*W`rXRJygk#7d;UuwzKt@){Gd4VdTn#Wj zUONeLR}|+e`!_e>$7~uQ;7+2+Is|jk!Rvp7#VlIihfjH2Dze-O&UyIijOjxn99dk!J6R2 z5!KzbLg*wz)AjMNNFA3; zJ;hYgf^>ZXn8lC7tl{Vs@!2%Bi!Q(;hMitoZ>pCG0ZUz5DZ3ZCg9#J8V6j{=D5lYU-^>2eA