コード例 #1
0
    def __init__(self, *args, **kwargs):
        super(Widget_scriptPath, self).__init__(*args, **kwargs)
        self.installEventFilter(self)

        mainLayout = QHBoxLayout(self)
        mainLayout.setContentsMargins(0, 0, 0, 0)
        label = QLabel("Script Path : ")
        lineEdit = QLineEdit()
        button = QPushButton("...")
        button.setFixedWidth(40)
        button.clicked.connect(self.cmd_getPath)

        mainLayout.addWidget(label)
        mainLayout.addWidget(lineEdit)
        mainLayout.addWidget(button)

        self.lineEdit = lineEdit
        self.load_lineEdit_text(self.lineEdit, Widget_scriptPath.path_uiInfo)

        sizePolicy = QSizePolicy()
        sizePolicy.setVerticalPolicy(QSizePolicy.Fixed)
        sizePolicy.setHorizontalPolicy(QSizePolicy.Expanding)
        self.setSizePolicy(sizePolicy)

        self.lineEdit = lineEdit
コード例 #2
0
    def __init__(self, *args, **kwargs):

        super(Widget_textEdit_splitter, self).__init__(*args, **kwargs)
        self.installEventFilter(self)
        mainLayout = QVBoxLayout(self)

        w_convertButton = QWidget()
        lay_convertButton = QHBoxLayout(w_convertButton)
        label_orig = QLabel("Original")
        label_orig.setAlignment(QtCore.Qt.AlignCenter)
        label_convert = QLabel("Converted")
        label_convert.setAlignment(QtCore.Qt.AlignCenter)
        button = QPushButton(" >> ")
        lay_convertButton.addWidget(label_orig)
        lay_convertButton.addWidget(button)
        lay_convertButton.addWidget(label_convert)
        w_convertButton.setStyleSheet("font-size:13px")
        sizePolicy = QSizePolicy()
        sizePolicy.setVerticalPolicy(QSizePolicy.Fixed)
        sizePolicy.setHorizontalPolicy(QSizePolicy.Expanding)
        w_convertButton.setSizePolicy(sizePolicy)

        splitter = QSplitter()
        splitter.setStretchFactor(1, 1)

        textEdit_left = QTextEdit()
        textEdit_right = QTextEdit()
        splitter.addWidget(textEdit_left)
        splitter.addWidget(textEdit_right)

        textEdit_left.setLineWrapMode(QTextEdit.NoWrap)
        textEdit_right.setLineWrapMode(QTextEdit.NoWrap)

        mainLayout.addWidget(w_convertButton)
        mainLayout.addWidget(splitter)

        self.textEdit_left = textEdit_left
        self.textEdit_right = textEdit_right

        button.clicked.connect(self.load_convertedText)