File: Widg_addPolyOpt.py

package info (click to toggle)
asymptote 2.69%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 18,532 kB
  • sloc: cpp: 61,286; ansic: 48,418; python: 8,585; javascript: 4,283; sh: 4,069; perl: 1,564; lisp: 1,505; makefile: 609; yacc: 554; lex: 446
file content (31 lines) | stat: -rw-r--r-- 883 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env python3

from pyUIClass.widg_addPolyOpt import Ui_Form
import PyQt5.QtWidgets as Qw
import PyQt5.QtGui as Qg
import PyQt5.QtCore as Qc

import sys


class Widg_addPolyOpt(Qw.QWidget):
    def __init__(self, info):
        super().__init__()
        self.ui = Ui_Form()
        self.info = info
        self.ui.setupUi(self)
        self.setFixedSize(self.size())

        self.ui.chkInscribed.setChecked(self.info['inscribed'])
        self.ui.txtSides.setText(str(self.info['sides']))
        self.ui.txtSides.setValidator(Qg.QIntValidator())

        self.ui.chkInscribed.stateChanged.connect(self.chkInscribedUpdate)
        self.ui.txtSides.textChanged.connect(self.txtSidesUpdate)

    def chkInscribedUpdate(self, checked):
        self.info['inscribed'] = checked

    def txtSidesUpdate(self, text):
        if text:
            self.info['sides'] = int(text)