def setupUi(self, PageLiensFilms): PageLiensFilms.setObjectName("PageLiensFilms") PageLiensFilms.resize(800, 500) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(47, 47, 47)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(47, 47, 47)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(127, 127, 127)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(47, 47, 47)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(47, 47, 47)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) PageLiensFilms.setPalette(palette) self.TitrePage = QtWidgets.QLabel(PageLiensFilms) self.TitrePage.setGeometry(QtCore.QRect(0, -10, 801, 81)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(234, 144, 221)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 243, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(234, 144, 221)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 243, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(127, 127, 127)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(127, 127, 127)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) self.TitrePage.setPalette(palette) font = QtGui.QFont() font.setFamily("Haettenschweiler") font.setPointSize(100) font.setBold(True) font.setWeight(75) self.TitrePage.setFont(font) self.TitrePage.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter) self.TitrePage.setObjectName("TitrePage") self.Affiche1 = QtWidgets.QLabel(PageLiensFilms) self.Affiche1.setGeometry(QtCore.QRect(140, 110, 211, 311)) self.Affiche1.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) self.Affiche1.setText("") self.Affiche1.setPixmap( QtGui.QPixmap("Images/classic-poster1-movie.jpg")) self.Affiche1.setScaledContents(True) self.Affiche1.setObjectName("Affiche1") self.Affiche2 = QtWidgets.QLabel(PageLiensFilms) self.Affiche2.setGeometry(QtCore.QRect(450, 110, 211, 311)) self.Affiche2.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) self.Affiche2.setText("") self.Affiche2.setPixmap( QtGui.QPixmap("Images/classic-poster1-movie.jpg")) self.Affiche2.setScaledContents(True) self.Affiche2.setObjectName("Affiche2") self.Titre1 = QtWidgets.QLabel(PageLiensFilms) self.Titre1.setGeometry(QtCore.QRect(90, 430, 311, 20)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(247, 253, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(247, 253, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(127, 127, 127)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush) self.Titre1.setPalette(palette) font = QtGui.QFont() font.setPointSize(18) self.Titre1.setFont(font) self.Titre1.setAlignment(QtCore.Qt.AlignCenter) self.Titre1.setObjectName("Titre1") self.Titre2 = QtWidgets.QLabel(PageLiensFilms) self.Titre2.setGeometry(QtCore.QRect(400, 430, 311, 20)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(247, 253, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(247, 253, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(127, 127, 127)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush) self.Titre2.setPalette(palette) font = QtGui.QFont() font.setPointSize(18) self.Titre2.setFont(font) self.Titre2.setAlignment(QtCore.Qt.AlignCenter) self.Titre2.setObjectName("Titre2") self.JolisPoints = QtWidgets.QLabel(PageLiensFilms) self.JolisPoints.setGeometry(QtCore.QRect(370, 220, 61, 61)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(127, 127, 127)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush) self.JolisPoints.setPalette(palette) font = QtGui.QFont() font.setPointSize(78) self.JolisPoints.setFont(font) self.JolisPoints.setObjectName("JolisPoints") self.PointDroit = QtWidgets.QLabel(PageLiensFilms) self.PointDroit.setGeometry(QtCore.QRect(680, -10, 91, 311)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(127, 127, 127)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush) self.PointDroit.setPalette(palette) font = QtGui.QFont() font.setPointSize(400) self.PointDroit.setFont(font) self.PointDroit.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) self.PointDroit.setObjectName("PointDroit") self.PointGauche = QtWidgets.QLabel(PageLiensFilms) self.PointGauche.setEnabled(False) self.PointGauche.setGeometry(QtCore.QRect(20, -10, 91, 311)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(127, 127, 127)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush) self.PointGauche.setPalette(palette) font = QtGui.QFont() font.setPointSize(400) self.PointGauche.setFont(font) self.PointGauche.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) self.PointGauche.setObjectName("PointGauche") self.PointDroitFleche = QLabel3(PageLiensFilms) self.PointDroitFleche.setGeometry(QtCore.QRect(718, 253, 31, 41)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(47, 47, 47)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(47, 47, 47)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(127, 127, 127)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush) self.PointDroitFleche.setPalette(palette) font = QtGui.QFont() font.setPointSize(50) self.PointDroitFleche.setFont(font) self.PointDroitFleche.setCursor( QtGui.QCursor(QtCore.Qt.PointingHandCursor)) self.PointDroitFleche.setObjectName("PointDroitFleche") self.PointGaucheFleche = QLabel3(PageLiensFilms) self.PointGaucheFleche.setGeometry(QtCore.QRect(53, 253, 31, 41)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(47, 47, 47)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(47, 47, 47)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(127, 127, 127)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush) self.PointGaucheFleche.setPalette(palette) font = QtGui.QFont() font.setPointSize(50) self.PointGaucheFleche.setFont(font) self.PointGaucheFleche.setCursor( QtGui.QCursor(QtCore.Qt.PointingHandCursor)) self.PointGaucheFleche.setObjectName("PointGaucheFleche") self.Cadre2 = QLabel2(PageLiensFilms) self.Cadre2.setGeometry(QtCore.QRect(450, 110, 211, 311)) self.Cadre2.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) self.Cadre2.setText("") self.Cadre2.setScaledContents(True) self.Cadre2.setObjectName("Cadre2") self.Cadre1 = QLabel2(PageLiensFilms) self.Cadre1.setGeometry(QtCore.QRect(140, 110, 211, 311)) self.Cadre1.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) self.Cadre1.setText("") self.Cadre1.setScaledContents(True) self.Cadre1.setObjectName("Cadre1") self.retranslateUi(PageLiensFilms) QtCore.QMetaObject.connectSlotsByName(PageLiensFilms)
def paintEvent(self, e): qp = QtGui.QPainter() qp.begin(self) qp.setBrush(QtGui.QColor(0, 0, 0, 120)) qp.drawRect(-1, -1, self.width(), self.height()) qp.end()
def drawPoints(self, event, qp): qp.setPen(QtGui.QColor(255, 1, 1)) qp.setFont(QtGui.QFont("Helvetiva", 15)) qp.drawText(370, 20, str(self.points))
def setupUi(self, Dialog): Dialog.setObjectName("Dialog") Dialog.resize(780, 600) Dialog.setMinimumSize(QtCore.QSize(740, 600)) Dialog.setMaximumSize(QtCore.QSize(800, 1200)) Dialog.setMouseTracking(True) self.verticalLayout_2 = QtWidgets.QVBoxLayout(Dialog) self.verticalLayout_2.setObjectName("verticalLayout_2") self.verticalLayout = QtWidgets.QVBoxLayout() self.verticalLayout.setObjectName("verticalLayout") self.tabWidget = QtWidgets.QTabWidget(Dialog) self.tabWidget.setMaximumSize(QtCore.QSize(1200, 1200)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(242, 255, 253)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(242, 255, 253)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(242, 255, 253)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(242, 255, 253)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(242, 255, 253)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(242, 255, 253)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(242, 255, 253)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(242, 255, 253)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(242, 255, 253)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) self.tabWidget.setPalette(palette) font = QtGui.QFont() font.setPointSize(-1) self.tabWidget.setFont(font) self.tabWidget.setFocusPolicy(QtCore.Qt.StrongFocus) self.tabWidget.setContextMenuPolicy(QtCore.Qt.DefaultContextMenu) self.tabWidget.setToolTip("") self.tabWidget.setWhatsThis("") self.tabWidget.setLayoutDirection(QtCore.Qt.LeftToRight) self.tabWidget.setAutoFillBackground(False) self.tabWidget.setStyleSheet("font-size:25px;\n" "background-color: rgb(242, 255, 253);") self.tabWidget.setInputMethodHints(QtCore.Qt.ImhNone) self.tabWidget.setTabPosition(QtWidgets.QTabWidget.North) self.tabWidget.setTabShape(QtWidgets.QTabWidget.Rounded) self.tabWidget.setIconSize(QtCore.QSize(20, 20)) self.tabWidget.setElideMode(QtCore.Qt.ElideRight) self.tabWidget.setUsesScrollButtons(False) self.tabWidget.setTabBarAutoHide(True) self.tabWidget.setObjectName("tabWidget") self.tabWidgetPage1 = QtWidgets.QWidget() self.tabWidgetPage1.setObjectName("tabWidgetPage1") self.horizontalLayout = QtWidgets.QHBoxLayout(self.tabWidgetPage1) self.horizontalLayout.setObjectName("horizontalLayout") self.tv = QtWidgets.QTableView(self.tabWidgetPage1) self.tv.setFocusPolicy(QtCore.Qt.NoFocus) self.tv.setContextMenuPolicy(QtCore.Qt.NoContextMenu) self.tv.setToolTip("") self.tv.setStatusTip("") self.tv.setWhatsThis("") self.tv.setAccessibleName("") self.tv.setAccessibleDescription("") self.tv.setFrameShape(QtWidgets.QFrame.NoFrame) self.tv.setObjectName("tv") self.horizontalLayout.addWidget(self.tv) self.tabWidget.addTab(self.tabWidgetPage1, "") self.tabWidgetPage2 = QtWidgets.QWidget() self.tabWidgetPage2.setObjectName("tabWidgetPage2") self.horizontalLayout_6 = QtWidgets.QHBoxLayout(self.tabWidgetPage2) self.horizontalLayout_6.setObjectName("horizontalLayout_6") self.tv2 = QtWidgets.QTableView(self.tabWidgetPage2) self.tv2.setFocusPolicy(QtCore.Qt.NoFocus) self.tv2.setContextMenuPolicy(QtCore.Qt.NoContextMenu) self.tv2.setToolTip("") self.tv2.setStatusTip("") self.tv2.setWhatsThis("") self.tv2.setAccessibleName("") self.tv2.setAccessibleDescription("") self.tv2.setFrameShape(QtWidgets.QFrame.NoFrame) self.tv2.setObjectName("tv2") self.horizontalLayout_6.addWidget(self.tv2) self.tabWidget.addTab(self.tabWidgetPage2, "") self.tabWidgetPage3 = QtWidgets.QWidget() self.tabWidgetPage3.setObjectName("tabWidgetPage3") self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.tabWidgetPage3) self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.tv3 = QtWidgets.QTableView(self.tabWidgetPage3) self.tv3.setFocusPolicy(QtCore.Qt.NoFocus) self.tv3.setContextMenuPolicy(QtCore.Qt.NoContextMenu) self.tv3.setToolTip("") self.tv3.setStatusTip("") self.tv3.setWhatsThis("") self.tv3.setAccessibleName("") self.tv3.setAccessibleDescription("") self.tv3.setFrameShape(QtWidgets.QFrame.NoFrame) self.tv3.setObjectName("tv3") self.horizontalLayout_2.addWidget(self.tv3) self.tabWidget.addTab(self.tabWidgetPage3, "") self.verticalLayout.addWidget(self.tabWidget) self.horizontalLayout_3 = QtWidgets.QHBoxLayout() self.horizontalLayout_3.setObjectName("horizontalLayout_3") self.btn_gorevEkle = QtWidgets.QPushButton(Dialog) self.btn_gorevEkle.setMinimumSize(QtCore.QSize(0, 60)) font = QtGui.QFont() font.setPointSize(17) self.btn_gorevEkle.setFont(font) self.btn_gorevEkle.setCursor( QtGui.QCursor(QtCore.Qt.PointingHandCursor)) self.btn_gorevEkle.setStyleSheet( "\n" "background-color: qlineargradient(spread:reflect, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(175, 255, 255, 255), stop:0.845771 rgba(245, 255, 255, 255));\n" "color: rgb(45, 59, 62);") self.btn_gorevEkle.setIconSize(QtCore.QSize(80000, 10000)) self.btn_gorevEkle.setShortcut("") self.btn_gorevEkle.setAutoRepeat(False) self.btn_gorevEkle.setAutoDefault(False) self.btn_gorevEkle.setDefault(True) self.btn_gorevEkle.setFlat(False) self.btn_gorevEkle.setObjectName("btn_gorevEkle") self.horizontalLayout_3.addWidget(self.btn_gorevEkle) self.btn_gorev_sil = QtWidgets.QPushButton(Dialog) self.btn_gorev_sil.setMinimumSize(QtCore.QSize(0, 60)) font = QtGui.QFont() font.setPointSize(17) self.btn_gorev_sil.setFont(font) self.btn_gorev_sil.setCursor( QtGui.QCursor(QtCore.Qt.PointingHandCursor)) self.btn_gorev_sil.setStyleSheet( "\n" "background-color: qlineargradient(spread:reflect, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(175, 255, 255, 255), stop:0.845771 rgba(245, 255, 255, 255));\n" "color: rgb(45, 59, 62);") self.btn_gorev_sil.setIconSize(QtCore.QSize(80000, 10000)) self.btn_gorev_sil.setShortcut("") self.btn_gorev_sil.setAutoRepeat(False) self.btn_gorev_sil.setAutoDefault(False) self.btn_gorev_sil.setDefault(True) self.btn_gorev_sil.setFlat(False) self.btn_gorev_sil.setObjectName("btn_gorev_sil") self.horizontalLayout_3.addWidget(self.btn_gorev_sil) self.btn_tumunu_sil = QtWidgets.QPushButton(Dialog) self.btn_tumunu_sil.setMinimumSize(QtCore.QSize(0, 60)) font = QtGui.QFont() font.setPointSize(17) self.btn_tumunu_sil.setFont(font) self.btn_tumunu_sil.setCursor( QtGui.QCursor(QtCore.Qt.PointingHandCursor)) self.btn_tumunu_sil.setStyleSheet( "\n" "background-color: qlineargradient(spread:reflect, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(175, 255, 255, 255), stop:0.845771 rgba(245, 255, 255, 255));\n" "color: rgb(45, 59, 62);") self.btn_tumunu_sil.setIconSize(QtCore.QSize(80000, 10000)) self.btn_tumunu_sil.setShortcut("") self.btn_tumunu_sil.setAutoRepeat(False) self.btn_tumunu_sil.setAutoDefault(False) self.btn_tumunu_sil.setDefault(True) self.btn_tumunu_sil.setFlat(False) self.btn_tumunu_sil.setObjectName("btn_tumunu_sil") self.horizontalLayout_3.addWidget(self.btn_tumunu_sil) self.verticalLayout.addLayout(self.horizontalLayout_3) self.verticalLayout_2.addLayout(self.verticalLayout) self.retranslateUi(Dialog) self.tabWidget.setCurrentIndex(0) QtCore.QMetaObject.connectSlotsByName(Dialog)
def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(960, 540) MainWindow.setMinimumSize(QtCore.QSize(960, 540)) MainWindow.setMaximumSize(QtCore.QSize(960, 540)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Light, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Midlight, brush) brush = QtGui.QBrush(QtGui.QColor(127, 127, 127)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Dark, brush) brush = QtGui.QBrush(QtGui.QColor(170, 170, 170)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Mid, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.BrightText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Shadow, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.AlternateBase, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipBase, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0, 128)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.PlaceholderText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Light, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Midlight, brush) brush = QtGui.QBrush(QtGui.QColor(127, 127, 127)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Dark, brush) brush = QtGui.QBrush(QtGui.QColor(170, 170, 170)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Mid, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.BrightText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Shadow, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.AlternateBase, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipBase, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0, 128)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.PlaceholderText, brush) brush = QtGui.QBrush(QtGui.QColor(127, 127, 127)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Light, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Midlight, brush) brush = QtGui.QBrush(QtGui.QColor(127, 127, 127)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Dark, brush) brush = QtGui.QBrush(QtGui.QColor(170, 170, 170)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Mid, brush) brush = QtGui.QBrush(QtGui.QColor(127, 127, 127)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.BrightText, brush) brush = QtGui.QBrush(QtGui.QColor(127, 127, 127)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Shadow, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.AlternateBase, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 220)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipBase, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0, 128)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.PlaceholderText, brush) MainWindow.setPalette(palette) MainWindow.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor)) self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.add_user_button = QtWidgets.QPushButton(self.centralwidget) self.add_user_button.setGeometry(QtCore.QRect(636, 9, 141, 41)) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.add_user_button.sizePolicy().hasHeightForWidth()) self.add_user_button.setSizePolicy(sizePolicy) font = QtGui.QFont() font.setFamily("Microsoft YaHei UI") font.setPointSize(12) self.add_user_button.setFont(font) self.add_user_button.setObjectName("add_user_button") self.remove_user_button = QtWidgets.QPushButton(self.centralwidget) self.remove_user_button.setGeometry(QtCore.QRect(790, 0, 151, 41)) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.remove_user_button.sizePolicy().hasHeightForWidth()) self.remove_user_button.setSizePolicy(sizePolicy) font = QtGui.QFont() font.setFamily("Microsoft YaHei UI") font.setPointSize(12) self.remove_user_button.setFont(font) self.remove_user_button.setObjectName("remove_user_button") self.tableWidget = QtWidgets.QTableWidget(self.centralwidget) self.tableWidget.setGeometry(QtCore.QRect(9, 9, 571, 167)) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.tableWidget.sizePolicy().hasHeightForWidth()) self.tableWidget.setSizePolicy(sizePolicy) font = QtGui.QFont() font.setFamily("Microsoft YaHei UI Light") font.setPointSize(12) self.tableWidget.setFont(font) self.tableWidget.setFocusPolicy(QtCore.Qt.NoFocus) self.tableWidget.setObjectName("tableWidget") self.tableWidget.setColumnCount(4) self.tableWidget.setRowCount(0) item = QtWidgets.QTableWidgetItem() self.tableWidget.setHorizontalHeaderItem(0, item) item = QtWidgets.QTableWidgetItem() self.tableWidget.setHorizontalHeaderItem(1, item) item = QtWidgets.QTableWidgetItem() self.tableWidget.setHorizontalHeaderItem(2, item) item = QtWidgets.QTableWidgetItem() item.setBackground(QtGui.QColor(255, 255, 255, 0)) self.tableWidget.setHorizontalHeaderItem(3, item) self.clear_choose_button = QtWidgets.QPushButton(self.centralwidget) self.clear_choose_button.setGeometry(QtCore.QRect(202, 401, 75, 29)) font = QtGui.QFont() font.setFamily("Microsoft YaHei UI") font.setPointSize(12) self.clear_choose_button.setFont(font) self.clear_choose_button.setObjectName("clear_choose_button") self.textBrowser = QtWidgets.QTextBrowser(self.centralwidget) self.textBrowser.setEnabled(True) self.textBrowser.setGeometry(QtCore.QRect(565, 280, 381, 151)) font = QtGui.QFont() font.setFamily("Microsoft YaHei UI Light") font.setPointSize(12) self.textBrowser.setFont(font) self.textBrowser.viewport().setProperty( "cursor", QtGui.QCursor(QtCore.Qt.IBeamCursor)) self.textBrowser.setObjectName("textBrowser") self.choose_form = QtWidgets.QListWidget(self.centralwidget) self.choose_form.setGeometry(QtCore.QRect(10, 280, 521, 51)) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.choose_form.sizePolicy().hasHeightForWidth()) self.choose_form.setSizePolicy(sizePolicy) font = QtGui.QFont() font.setFamily("Microsoft YaHei UI") font.setPointSize(16) self.choose_form.setFont(font) self.choose_form.setFrameShape(QtWidgets.QFrame.StyledPanel) self.choose_form.setFlow(QtWidgets.QListView.LeftToRight) self.choose_form.setProperty("isWrapping", False) self.choose_form.setObjectName("choose_form") self.choose_delimiter = QtWidgets.QComboBox(self.centralwidget) self.choose_delimiter.setGeometry(QtCore.QRect(580, 220, 75, 27)) font = QtGui.QFont() font.setFamily("Microsoft YaHei UI") font.setPointSize(12) self.choose_delimiter.setFont(font) self.choose_delimiter.setObjectName("choose_delimiter") self.choose_delimiter.addItem("") self.choose_delimiter.addItem("") self.choose_delimiter.addItem("") self.choose_delimiter.addItem("") self.choose_delimiter.addItem("") self.choose_delimiter.addItem("") self.generate_result_button = QtWidgets.QPushButton(self.centralwidget) self.generate_result_button.setGeometry(QtCore.QRect( 660, 210, 131, 41)) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.generate_result_button.sizePolicy().hasHeightForWidth()) self.generate_result_button.setSizePolicy(sizePolicy) font = QtGui.QFont() font.setFamily("Microsoft YaHei UI") font.setPointSize(12) self.generate_result_button.setFont(font) self.generate_result_button.setObjectName("generate_result_button") self.layoutWidget = QtWidgets.QWidget(self.centralwidget) self.layoutWidget.setGeometry(QtCore.QRect(9, 217, 457, 46)) self.layoutWidget.setObjectName("layoutWidget") self.horizontalLayout = QtWidgets.QHBoxLayout(self.layoutWidget) self.horizontalLayout.setContentsMargins(0, 0, 0, 0) self.horizontalLayout.setSpacing(22) self.horizontalLayout.setObjectName("horizontalLayout") self.choose_studentId = QtWidgets.QPushButton(self.layoutWidget) font = QtGui.QFont() font.setFamily("Microsoft YaHei UI") font.setPointSize(16) self.choose_studentId.setFont(font) self.choose_studentId.setCursor( QtGui.QCursor(QtCore.Qt.PointingHandCursor)) self.choose_studentId.setMouseTracking(False) self.choose_studentId.setFlat(True) self.choose_studentId.setObjectName("choose_studentId") self.horizontalLayout.addWidget(self.choose_studentId) self.choose_classId = QtWidgets.QPushButton(self.layoutWidget) font = QtGui.QFont() font.setFamily("Microsoft YaHei UI") font.setPointSize(16) self.choose_classId.setFont(font) self.choose_classId.setCursor( QtGui.QCursor(QtCore.Qt.PointingHandCursor)) self.choose_classId.setMouseTracking(False) self.choose_classId.setFlat(True) self.choose_classId.setObjectName("choose_classId") self.horizontalLayout.addWidget(self.choose_classId) self.choose_name = QtWidgets.QPushButton(self.layoutWidget) font = QtGui.QFont() font.setFamily("Microsoft YaHei UI") font.setPointSize(16) self.choose_name.setFont(font) self.choose_name.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) self.choose_name.setMouseTracking(False) self.choose_name.setFlat(True) self.choose_name.setObjectName("choose_name") self.horizontalLayout.addWidget(self.choose_name) self.choose_custom = QtWidgets.QPushButton(self.layoutWidget) font = QtGui.QFont() font.setFamily("Microsoft YaHei UI") font.setPointSize(16) self.choose_custom.setFont(font) self.choose_custom.setCursor( QtGui.QCursor(QtCore.Qt.PointingHandCursor)) self.choose_custom.setMouseTracking(False) self.choose_custom.setDefault(False) self.choose_custom.setFlat(True) self.choose_custom.setObjectName("choose_custom") self.horizontalLayout.addWidget(self.choose_custom) self.generate_clipbord_button = QtWidgets.QPushButton( self.centralwidget) self.generate_clipbord_button.setGeometry( QtCore.QRect(800, 220, 181, 29)) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.generate_clipbord_button.sizePolicy().hasHeightForWidth()) self.generate_clipbord_button.setSizePolicy(sizePolicy) font = QtGui.QFont() font.setFamily("Microsoft YaHei UI") font.setPointSize(12) self.generate_clipbord_button.setFont(font) self.generate_clipbord_button.setObjectName("generate_clipbord_button") MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtWidgets.QMenuBar(MainWindow) self.menubar.setGeometry(QtCore.QRect(0, 0, 960, 26)) self.menubar.setObjectName("menubar") MainWindow.setMenuBar(self.menubar) self.statusbar = QtWidgets.QStatusBar(MainWindow) self.statusbar.setObjectName("statusbar") MainWindow.setStatusBar(self.statusbar) self.retranslateUi(MainWindow) self.choose_form.setCurrentRow(-1) QtCore.QMetaObject.connectSlotsByName(MainWindow)
def __init__(self, proc, cmdLine, name, reader, depth): self.__depth__ = depth self.__proc__ = proc self.__reader__ = reader self.__name__ = name self.__dialog__ = QtWidgets.QDialog() self.__procDetails__ = uic.loadUi(os.path.join(os.path.dirname(__file__), "./ui/processdetails.ui"), baseinstance=self.__dialog__) self.__dialog__.show() self.__dialog__.setWindowTitle(proc+":"+cmdLine+" Properties") self.__processGone__ = False self.__y__ = range(self.__depth__) self.__tcpConnections__ = [] self.__tcpStat__ = None self.__TCPHist__ = [0] * self.__reader__.getHistoryDepth(self.__proc__) self.__prevtcpipbytes__ = 0 self.__envData = procreader.reader.UNKNOWN #tell reader that a singleprocess GUI is using its data, for optimization self.__reader__.setListener(self.__proc__) #-------- top plot CPU usage------------------------------------------------------------------- #Curves for CPU usage self.__curveCpuHist__ = Qwt.QwtPlotCurve("CPU History") pen = QtGui.QPen(QtGui.QColor(0,255,0)) pen.setWidth(2) #work around to get better plotting. self.__curveCpuHistExt__ = Qwt.QwtPlotCurve("CPU History extra") self.__curveCpuHistExt__.setPen(QtGui.QPen(QtGui.QColor(0,255,0))) self.__curveCpuHistExt__.attach(self.__procDetails__.qwtPlotCpuHist) self.__curveCpuHist__.setPen(pen) self.__curveCpuHist__.setBrush(QtGui.QColor(0,170,0)) self.__curveCpuHist__.attach(self.__procDetails__.qwtPlotCpuHist) #Curve for kernel usage self.__curveCpuKernelHist__ = Qwt.QwtPlotCurve("CPU Kernel History") pen = QtGui.QPen(QtGui.QColor(255,0,0)) pen.setWidth(1) self.__curveCpuKernelHist__.setPen(pen) self.__curveCpuKernelHist__.setBrush(QtGui.QColor(170,0,0)) self.__curveCpuKernelHist__.attach(self.__procDetails__.qwtPlotCpuHist) #work around to get better plotting. self.__curveCpuKernelHistExt__ = Qwt.QwtPlotCurve("CPU Kernel History extra") self.__curveCpuKernelHistExt__.setPen(QtGui.QPen(QtGui.QColor(255,0,0))) self.__curveCpuKernelHistExt__.attach(self.__procDetails__.qwtPlotCpuHist) #self.__procDetails__.qwtPlotCpuHist.setAxisScale(0,0,self.__depth__,10) self.__curveCpuPlotGrid__ = Qwt.QwtPlotGrid() self.__curveCpuPlotGrid__.setMajorPen(QtGui.QPen(QtGui.QColor(0,100,0), 0, QtCore.Qt.SolidLine)) self.__curveCpuPlotGrid__.setMinorPen(QtGui.QPen(QtGui.QColor(0,100,0), 0, QtCore.Qt.SolidLine)) self.__curveCpuPlotGrid__.enableXMin(True) self.__curveCpuPlotGrid__.attach(self.__procDetails__.qwtPlotCpuHist) #---------------------------------------------------------------------------------------------- #-------- Middle plot memory usage------------------------------------------------------------- #Curve for memory usage self.__curveRssHist__ = Qwt.QwtPlotCurve("Rss History") pen = QtGui.QPen(QtGui.QColor(248,248,0)) pen.setWidth(1) self.__curveRssHist__.setPen(pen) self.__curveRssHist__.setBrush(QtGui.QColor(190,190,0)) self.__curveRssHist__.attach(self.__procDetails__.qwtPlotRssHist) self.__curveRssHistExt__ = Qwt.QwtPlotCurve("Rss extra") self.__curveRssHistExt__.setPen(QtGui.QPen(QtGui.QColor(248,248,0))) self.__curveRssHistExt__.attach(self.__procDetails__.qwtPlotRssHist) #self.__procDetails__.qwtPlotRssHgetThreist.setAxisScale(0,0,100,10) self.__RssPlotGrid__ = Qwt.QwtPlotGrid() self.__RssPlotGrid__.setMajorPen(QtGui.QPen(QtGui.QColor(0,100,0), 0, QtCore.Qt.SolidLine)) self.__RssPlotGrid__.setMinorPen(QtGui.QPen(QtGui.QColor(0,100,0), 0, QtCore.Qt.SolidLine)) self.__RssPlotGrid__.enableXMin(True) self.__RssPlotGrid__.attach(self.__procDetails__.qwtPlotRssHist) #---------------------------------------------------------------------------------------------- #-------- Bottom plot IO usage ---------------------------------------------------------------- #Curve for memory usage self.__curveIOHist__ = Qwt.QwtPlotCurve("IO History") pen = QtGui.QPen(QtGui.QColor(0,214,214)) pen.setWidth(1) self.__curveIOHist__.setPen(pen) self.__curveIOHist__.setBrush(QtGui.QColor(0,150,150)) self.__curveIOHist__.attach(self.__procDetails__.qwtPlotIoHist) self.__curveIOHistExt__ = Qwt.QwtPlotCurve("IO History extra") self.__curveIOHistExt__.setPen(QtGui.QPen(QtGui.QColor(0,214,214))) self.__curveIOHistExt__.attach(self.__procDetails__.qwtPlotIoHist) #self.__procDetails__.qwtPlotIoHist.setAxisScale(0,0,100,10) self.__IOPlotGrid__ = Qwt.QwtPlotGrid() self.__IOPlotGrid__.setMajorPen(QtGui.QPen(QtGui.QColor(0,100,0), 0, QtCore.Qt.SolidLine)) self.__IOPlotGrid__.setMinorPen(QtGui.QPen(QtGui.QColor(0,100,0), 0, QtCore.Qt.SolidLine)) self.__IOPlotGrid__.enableXMin(True) self.__IOPlotGrid__.attach(self.__procDetails__.qwtPlotIoHist) #---------------------------------------------------------------------------------------------- #-------- TCP IO usage ---------------------------------------------------------------- self.__curveTcpipHist__ = Qwt.QwtPlotCurve("TCPIP History") pen = QtGui.QPen(QtGui.QColor(0,214,214)) pen.setWidth(1) self.__curveTcpipHist__.setPen(pen) self.__curveTcpipHist__.setBrush(QtGui.QColor(196,60,210)) self.__curveTcpipHist__.attach(self.__procDetails__.qwtPlotTcpipHist) self.__curveTcpipHistExt__ = Qwt.QwtPlotCurve("TCPIP History extra") self.__curveTcpipHistExt__.setPen(QtGui.QPen(QtGui.QColor(215,124,224))) self.__curveTcpipHistExt__.attach(self.__procDetails__.qwtPlotTcpipHist) #self.__procDetails__.qwtPlotIoHist.setAxisScale(0,0,100,10) self.__TcpipPlotGrid__ = Qwt.QwtPlotGrid() self.__TcpipPlotGrid__.setMajorPen(QtGui.QPen(QtGui.QColor(0,100,0), 0, QtCore.Qt.SolidLine)) self.__TcpipPlotGrid__.setMinorPen(QtGui.QPen(QtGui.QColor(0,100,0), 0, QtCore.Qt.SolidLine)) self.__TcpipPlotGrid__.enableXMin(True) self.__TcpipPlotGrid__.attach(self.__procDetails__.qwtPlotTcpipHist) #---------------------------------------------------------------------------------------------- # all plots ---------------------------------------------------------------------------------- self.__procDetails__.qwtPlotCpuHist.setCanvasBackground(QtGui.QColor(0,0,0)) self.__procDetails__.qwtPlotRssHist.setCanvasBackground(QtGui.QColor(0,0,0)) self.__procDetails__.qwtPlotIoHist.setCanvasBackground(QtGui.QColor(0,0,0)) self.__procDetails__.qwtPlotTcpipHist.setCanvasBackground(QtGui.QColor(0,0,0)) self.__procDetails__.qwtPlotCpuHist.enableAxis(0, False ) self.__procDetails__.qwtPlotCpuHist.enableAxis(2, False ) self.__procDetails__.qwtPlotRssHist.enableAxis(0, False ) self.__procDetails__.qwtPlotRssHist.enableAxis(2, False ) self.__procDetails__.qwtPlotIoHist.enableAxis(0, False ) self.__procDetails__.qwtPlotIoHist.enableAxis(2, False ) self.__procDetails__.qwtPlotTcpipHist.enableAxis(0, False ) self.__procDetails__.qwtPlotTcpipHist.enableAxis(2, False ) #---------------------------------------------------------------------------------------------- self._availableLabel = QtWidgets.QLabel(" ", parent=self.__procDetails__.qwtPlotTcpipHist ) font = QtGui.QFont("Arial", pointSize=12) self._availableLabel.setFont(font) self._availableLabel.setStyleSheet("QLabel { color : grey; }"); self._availableLabel.show() self.__procDetails__.pushButtonOK.clicked.connect(self.__onClose__) # Fill some field only at construction time self.__procDetails__.filterEdit.textEdited.connect(self.__onFilterTextEdit__) self.__lddoutput__ = None self._tcpstat = tcpip_stat.tcpStat() self._tcpstat.start() self.update_sockets()
def draw_active_cuts(self, painter): ''' If the spacing supports it, highlight the active cuts and draw their limits ''' f = self.geom.spacing.cursor_cut if f is None: return pen = QtGui.QPen() pen.setWidthF(0) # get the perimeter of the cursor cursor_poly = self.cut_polygon(self.geom.boards[0].bottom_cuts[f]) # initialize limits xminG = self.geom.boards[0].width xmaxG = 0 # draw the active cuts filled, and track the limits painter.save() brush = QtGui.QBrush(QtGui.QColor(255, 0, 0, 75)) painter.setBrush(brush) pen.setColor(QtCore.Qt.red) painter.setPen(pen) fcolor = QtGui.QColor(self.colors['board_background']) fcolor.setAlphaF(1.0) for f in self.geom.spacing.active_cuts: poly = self.cut_polygon(self.geom.boards[0].bottom_cuts[f]) painter.drawPolygon(poly) # keep track of the limits (xmin, xmax) = self.geom.spacing.get_limits(f) xminG = min(xminG, xmin) xmaxG = max(xmaxG, xmax) # label the polygon with its index xText = 0.5 * (poly[0].x() + poly[1].x()) yText = 0.5 * (poly[0].y() + poly[1].y()) text = '%d' % f flags = QtCore.Qt.AlignHCenter | QtCore.Qt.AlignBottom paint_text(painter, text, (xText, yText), flags, (0, -5), fill_color=fcolor) painter.restore() # draw the limits # using QPointF to avoid border marks overlap with cursor painter.save() xminG += self.geom.boards[0].xL() xmaxG += self.geom.boards[0].xL() yB = self.geom.boards[0].yB() yT = self.geom.boards[0].yT() pen.setColor(QtCore.Qt.green) painter.setPen(pen) half = Decimal(0.5) painter.drawLine(QtCore.QPointF(xminG - half, yB), QtCore.QPointF(xminG - half, yT)) painter.drawLine(QtCore.QPointF(xmaxG + half, yB), QtCore.QPointF(xmaxG + half, yT)) painter.restore() # draw the perimeter of the cursor cut at the end to get it always visible painter.save() pen.setColor(QtCore.Qt.blue) painter.setPen(pen) painter.drawPolyline(cursor_poly) painter.restore()
def setupUi(self, TempWindow): TempWindow.setObjectName("TempWindow") TempWindow.resize(1280, 720) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(TempWindow.sizePolicy().hasHeightForWidth()) TempWindow.setSizePolicy(sizePolicy) self.centralwidget = QtWidgets.QWidget(TempWindow) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.centralwidget.sizePolicy().hasHeightForWidth()) self.centralwidget.setSizePolicy(sizePolicy) self.centralwidget.setObjectName("centralwidget") self.FieldView = QtWidgets.QGraphicsView(self.centralwidget) self.FieldView.setGeometry(QtCore.QRect(10, 40, 900, 600)) self.FieldView.setAutoFillBackground(False) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.NoBrush) self.FieldView.setBackgroundBrush(brush) self.FieldView.setObjectName("FieldView") self.CameraView = QtWidgets.QGraphicsView(self.centralwidget) self.CameraView.setGeometry(QtCore.QRect(940, 40, 320, 240)) self.CameraView.setObjectName("CameraView") self.widget = QtWidgets.QWidget(self.centralwidget) self.widget.setGeometry(QtCore.QRect(950, 300, 301, 321)) self.widget.setObjectName("widget") self.Command_Ver = QtWidgets.QVBoxLayout(self.widget) self.Command_Ver.setContentsMargins(0, 0, 0, 0) self.Command_Ver.setObjectName("Command_Ver") self.Robot1_Ver = QtWidgets.QVBoxLayout() self.Robot1_Ver.setObjectName("Robot1_Ver") self.Robot1_Des_Hor = QtWidgets.QHBoxLayout() self.Robot1_Des_Hor.setObjectName("Robot1_Des_Hor") self.Robot1 = QtWidgets.QLabel(self.widget) self.Robot1.setObjectName("Robot1") self.Robot1_Des_Hor.addWidget(self.Robot1) self.Robot1_Con = QtWidgets.QPushButton(self.widget) self.Robot1_Con.setObjectName("Robot1_Con") self.Robot1_Des_Hor.addWidget(self.Robot1_Con) self.Robot1_Cam = QtWidgets.QPushButton(self.widget) self.Robot1_Cam.setObjectName("Robot1_Cam") self.Robot1_Des_Hor.addWidget(self.Robot1_Cam) self.Robot1_Ver.addLayout(self.Robot1_Des_Hor) self.Robot1_Pos_Hor = QtWidgets.QHBoxLayout() self.Robot1_Pos_Hor.setObjectName("Robot1_Pos_Hor") self.Robot1_X = QtWidgets.QLabel(self.widget) self.Robot1_X.setObjectName("Robot1_X") self.Robot1_Pos_Hor.addWidget(self.Robot1_X) self.Robot1_Xnum = QtWidgets.QLabel(self.widget) self.Robot1_Xnum.setObjectName("Robot1_Xnum") self.Robot1_Pos_Hor.addWidget(self.Robot1_Xnum) self.Robot1_Y = QtWidgets.QLabel(self.widget) self.Robot1_Y.setObjectName("Robot1_Y") self.Robot1_Pos_Hor.addWidget(self.Robot1_Y) self.Robot1_Ynum = QtWidgets.QLabel(self.widget) self.Robot1_Ynum.setObjectName("Robot1_Ynum") self.Robot1_Pos_Hor.addWidget(self.Robot1_Ynum) self.Robot1_Ver.addLayout(self.Robot1_Pos_Hor) self.Command_Ver.addLayout(self.Robot1_Ver) self.Robot2_Ver = QtWidgets.QVBoxLayout() self.Robot2_Ver.setObjectName("Robot2_Ver") self.Robot2_Des_Hor = QtWidgets.QHBoxLayout() self.Robot2_Des_Hor.setObjectName("Robot2_Des_Hor") self.Robot2 = QtWidgets.QLabel(self.widget) self.Robot2.setObjectName("Robot2") self.Robot2_Des_Hor.addWidget(self.Robot2) self.Robot2_Con = QtWidgets.QPushButton(self.widget) self.Robot2_Con.setObjectName("Robot2_Con") self.Robot2_Des_Hor.addWidget(self.Robot2_Con) self.Robot2_Cam = QtWidgets.QPushButton(self.widget) self.Robot2_Cam.setObjectName("Robot2_Cam") self.Robot2_Des_Hor.addWidget(self.Robot2_Cam) self.Robot2_Ver.addLayout(self.Robot2_Des_Hor) self.Robot2_Pos_Hor = QtWidgets.QHBoxLayout() self.Robot2_Pos_Hor.setObjectName("Robot2_Pos_Hor") self.Robot2_X = QtWidgets.QLabel(self.widget) self.Robot2_X.setObjectName("Robot2_X") self.Robot2_Pos_Hor.addWidget(self.Robot2_X) self.Robot2_Xnum = QtWidgets.QLabel(self.widget) self.Robot2_Xnum.setObjectName("Robot2_Xnum") self.Robot2_Pos_Hor.addWidget(self.Robot2_Xnum) self.Robot2_Y = QtWidgets.QLabel(self.widget) self.Robot2_Y.setObjectName("Robot2_Y") self.Robot2_Pos_Hor.addWidget(self.Robot2_Y) self.Robot2_Ynum = QtWidgets.QLabel(self.widget) self.Robot2_Ynum.setObjectName("Robot2_Ynum") self.Robot2_Pos_Hor.addWidget(self.Robot2_Ynum) self.Robot2_Ver.addLayout(self.Robot2_Pos_Hor) self.Command_Ver.addLayout(self.Robot2_Ver) self.Robot3_Ver = QtWidgets.QVBoxLayout() self.Robot3_Ver.setObjectName("Robot3_Ver") self.Robot3_Des_Hor = QtWidgets.QHBoxLayout() self.Robot3_Des_Hor.setObjectName("Robot3_Des_Hor") self.Robot3 = QtWidgets.QLabel(self.widget) self.Robot3.setObjectName("Robot3") self.Robot3_Des_Hor.addWidget(self.Robot3) self.Robot3_Con = QtWidgets.QPushButton(self.widget) self.Robot3_Con.setObjectName("Robot3_Con") self.Robot3_Des_Hor.addWidget(self.Robot3_Con) self.Robot3_Cam = QtWidgets.QPushButton(self.widget) self.Robot3_Cam.setObjectName("Robot3_Cam") self.Robot3_Des_Hor.addWidget(self.Robot3_Cam) self.Robot3_Ver.addLayout(self.Robot3_Des_Hor) self.Robot3_Pos_Hor = QtWidgets.QHBoxLayout() self.Robot3_Pos_Hor.setObjectName("Robot3_Pos_Hor") self.Robot3_X = QtWidgets.QLabel(self.widget) self.Robot3_X.setObjectName("Robot3_X") self.Robot3_Pos_Hor.addWidget(self.Robot3_X) self.Robot3_Xnum = QtWidgets.QLabel(self.widget) self.Robot3_Xnum.setObjectName("Robot3_Xnum") self.Robot3_Pos_Hor.addWidget(self.Robot3_Xnum) self.Robot3_Y = QtWidgets.QLabel(self.widget) self.Robot3_Y.setObjectName("Robot3_Y") self.Robot3_Pos_Hor.addWidget(self.Robot3_Y) self.Robot3_Ynum = QtWidgets.QLabel(self.widget) self.Robot3_Ynum.setObjectName("Robot3_Ynum") self.Robot3_Pos_Hor.addWidget(self.Robot3_Ynum) self.Robot3_Ver.addLayout(self.Robot3_Pos_Hor) self.Command_Ver.addLayout(self.Robot3_Ver) self.Robot4_Ver = QtWidgets.QVBoxLayout() self.Robot4_Ver.setObjectName("Robot4_Ver") self.Robot4_Des_Hor = QtWidgets.QHBoxLayout() self.Robot4_Des_Hor.setObjectName("Robot4_Des_Hor") self.Robot4 = QtWidgets.QLabel(self.widget) self.Robot4.setObjectName("Robot4") self.Robot4_Des_Hor.addWidget(self.Robot4) self.Robot4_Con = QtWidgets.QPushButton(self.widget) self.Robot4_Con.setObjectName("Robot4_Con") self.Robot4_Des_Hor.addWidget(self.Robot4_Con) self.Robot4_Cam = QtWidgets.QPushButton(self.widget) self.Robot4_Cam.setObjectName("Robot4_Cam") self.Robot4_Des_Hor.addWidget(self.Robot4_Cam) self.Robot4_Ver.addLayout(self.Robot4_Des_Hor) self.Robot4_Pos_Hor = QtWidgets.QHBoxLayout() self.Robot4_Pos_Hor.setObjectName("Robot4_Pos_Hor") self.Robot4_X = QtWidgets.QLabel(self.widget) self.Robot4_X.setObjectName("Robot4_X") self.Robot4_Pos_Hor.addWidget(self.Robot4_X) self.Robot4_Xnum = QtWidgets.QLabel(self.widget) self.Robot4_Xnum.setObjectName("Robot4_Xnum") self.Robot4_Pos_Hor.addWidget(self.Robot4_Xnum) self.Robot4_Y = QtWidgets.QLabel(self.widget) self.Robot4_Y.setObjectName("Robot4_Y") self.Robot4_Pos_Hor.addWidget(self.Robot4_Y) self.Robot4_Ynum = QtWidgets.QLabel(self.widget) self.Robot4_Ynum.setObjectName("Robot4_Ynum") self.Robot4_Pos_Hor.addWidget(self.Robot4_Ynum) self.Robot4_Ver.addLayout(self.Robot4_Pos_Hor) self.Command_Ver.addLayout(self.Robot4_Ver) TempWindow.setCentralWidget(self.centralwidget) self.menubar = QtWidgets.QMenuBar(TempWindow) self.menubar.setGeometry(QtCore.QRect(0, 0, 1280, 22)) self.menubar.setObjectName("menubar") self.menuOption = QtWidgets.QMenu(self.menubar) self.menuOption.setObjectName("menuOption") TempWindow.setMenuBar(self.menubar) self.statusbar = QtWidgets.QStatusBar(TempWindow) self.statusbar.setObjectName("statusbar") TempWindow.setStatusBar(self.statusbar) self.actionInitialisation = QtWidgets.QAction(TempWindow) self.actionInitialisation.setObjectName("actionInitialisation") self.actionClose = QtWidgets.QAction(TempWindow) self.actionClose.setObjectName("actionClose") self.menuOption.addAction(self.actionInitialisation) self.menuOption.addAction(self.actionClose) self.menubar.addAction(self.menuOption.menuAction()) self.retranslateUi(TempWindow) QtCore.QMetaObject.connectSlotsByName(TempWindow)
def setupUi(self, Form): Form.setObjectName("Form") Form.resize(479, 196) Form.setMinimumSize(QtCore.QSize(479, 196)) self.gridLayout = QtWidgets.QGridLayout(Form) self.gridLayout.setObjectName("gridLayout") self.verticalLayout = QtWidgets.QVBoxLayout() self.verticalLayout.setObjectName("verticalLayout") self.label_error = QtWidgets.QLabel(Form) self.label_error.setEnabled(True) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 0, 0, 128)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.PlaceholderText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 0, 0, 128)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.PlaceholderText, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0, 128)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.PlaceholderText, brush) self.label_error.setPalette(palette) self.label_error.setAcceptDrops(False) self.label_error.setLayoutDirection(QtCore.Qt.LeftToRight) self.label_error.setText("") self.label_error.setTextFormat(QtCore.Qt.AutoText) self.label_error.setScaledContents(False) self.label_error.setAlignment(QtCore.Qt.AlignCenter) self.label_error.setWordWrap(False) self.label_error.setIndent(-2) self.label_error.setOpenExternalLinks(False) self.label_error.setTextInteractionFlags( QtCore.Qt.TextEditorInteraction) self.label_error.setObjectName("label_error") self.verticalLayout.addWidget(self.label_error) self.horizontalLayout_3 = QtWidgets.QHBoxLayout() self.horizontalLayout_3.setObjectName("horizontalLayout_3") self.formLayout_6 = QtWidgets.QFormLayout() self.formLayout_6.setObjectName("formLayout_6") self.label_city = QtWidgets.QLabel(Form) self.label_city.setObjectName("label_city") self.formLayout_6.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label_city) self.label_street = QtWidgets.QLabel(Form) self.label_street.setObjectName("label_street") self.formLayout_6.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.label_street) self.label_house = QtWidgets.QLabel(Form) self.label_house.setObjectName("label_house") self.formLayout_6.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.label_house) self.label_entr = QtWidgets.QLabel(Form) self.label_entr.setObjectName("label_entr") self.formLayout_6.setWidget(3, QtWidgets.QFormLayout.LabelRole, self.label_entr) self.comboBox_city = QtWidgets.QComboBox(Form) self.comboBox_city.setSizeAdjustPolicy( QtWidgets.QComboBox.AdjustToContents) self.comboBox_city.setObjectName("comboBox_city") self.formLayout_6.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.comboBox_city) self.comboBox_street = QtWidgets.QComboBox(Form) self.comboBox_street.setSizeAdjustPolicy( QtWidgets.QComboBox.AdjustToContents) self.comboBox_street.setObjectName("comboBox_street") self.formLayout_6.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.comboBox_street) self.comboBox_house = QtWidgets.QComboBox(Form) self.comboBox_house.setSizeAdjustPolicy( QtWidgets.QComboBox.AdjustToContents) self.comboBox_house.setObjectName("comboBox_house") self.formLayout_6.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.comboBox_house) self.spinBox_entr = QtWidgets.QSpinBox(Form) self.spinBox_entr.setMinimum(1) self.spinBox_entr.setObjectName("spinBox_entr") self.formLayout_6.setWidget(3, QtWidgets.QFormLayout.FieldRole, self.spinBox_entr) self.label_host = QtWidgets.QLabel(Form) self.label_host.setObjectName("label_host") self.formLayout_6.setWidget(4, QtWidgets.QFormLayout.LabelRole, self.label_host) self.lineEdit_host = QtWidgets.QLineEdit(Form) self.lineEdit_host.setObjectName("lineEdit_host") self.formLayout_6.setWidget(4, QtWidgets.QFormLayout.FieldRole, self.lineEdit_host) self.label_port = QtWidgets.QLabel(Form) self.label_port.setObjectName("label_port") self.formLayout_6.setWidget(5, QtWidgets.QFormLayout.LabelRole, self.label_port) self.lineEdit_port = QtWidgets.QLineEdit(Form) self.lineEdit_port.setObjectName("lineEdit_port") self.formLayout_6.setWidget(5, QtWidgets.QFormLayout.FieldRole, self.lineEdit_port) self.horizontalLayout_3.addLayout(self.formLayout_6) self.formLayout_7 = QtWidgets.QFormLayout() self.formLayout_7.setObjectName("formLayout_7") self.label_login = QtWidgets.QLabel(Form) self.label_login.setObjectName("label_login") self.formLayout_7.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label_login) self.lineEdit_login = QtWidgets.QLineEdit(Form) self.lineEdit_login.setObjectName("lineEdit_login") self.formLayout_7.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.lineEdit_login) self.label_pasw = QtWidgets.QLabel(Form) self.label_pasw.setObjectName("label_pasw") self.formLayout_7.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.label_pasw) self.lineEdit_pasw = QtWidgets.QLineEdit(Form) self.lineEdit_pasw.setObjectName("lineEdit_pasw") self.formLayout_7.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.lineEdit_pasw) self.label_fdbLogin = QtWidgets.QLabel(Form) self.label_fdbLogin.setObjectName("label_fdbLogin") self.formLayout_7.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.label_fdbLogin) self.lineEdit_fdbLogin = QtWidgets.QLineEdit(Form) self.lineEdit_fdbLogin.setObjectName("lineEdit_fdbLogin") self.formLayout_7.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.lineEdit_fdbLogin) self.label_fdbPasw = QtWidgets.QLabel(Form) self.label_fdbPasw.setObjectName("label_fdbPasw") self.formLayout_7.setWidget(3, QtWidgets.QFormLayout.LabelRole, self.label_fdbPasw) self.lineEdit_fdbPasw = QtWidgets.QLineEdit(Form) self.lineEdit_fdbPasw.setObjectName("lineEdit_fdbPasw") self.formLayout_7.setWidget(3, QtWidgets.QFormLayout.FieldRole, self.lineEdit_fdbPasw) self.label_fdbName = QtWidgets.QLabel(Form) self.label_fdbName.setObjectName("label_fdbName") self.formLayout_7.setWidget(4, QtWidgets.QFormLayout.LabelRole, self.label_fdbName) self.lineEdit_fdbName = QtWidgets.QLineEdit(Form) self.lineEdit_fdbName.setObjectName("lineEdit_fdbName") self.formLayout_7.setWidget(4, QtWidgets.QFormLayout.FieldRole, self.lineEdit_fdbName) self.label_name = QtWidgets.QLabel(Form) self.label_name.setObjectName("label_name") self.formLayout_7.setWidget(5, QtWidgets.QFormLayout.LabelRole, self.label_name) self.lineEdit_name = QtWidgets.QLineEdit(Form) self.lineEdit_name.setObjectName("lineEdit_name") self.formLayout_7.setWidget(5, QtWidgets.QFormLayout.FieldRole, self.lineEdit_name) self.horizontalLayout_3.addLayout(self.formLayout_7) self.verticalLayout.addLayout(self.horizontalLayout_3) self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") self.verticalLayout_2 = QtWidgets.QVBoxLayout() self.verticalLayout_2.setObjectName("verticalLayout_2") spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) self.verticalLayout_2.addItem(spacerItem) self.label = QtWidgets.QLabel(Form) self.label.setText("") self.label.setObjectName("label") self.verticalLayout_2.addWidget(self.label) self.horizontalLayout.addLayout(self.verticalLayout_2) spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.horizontalLayout.addItem(spacerItem1) self.pushButton_kpu = QtWidgets.QPushButton(Form) self.pushButton_kpu.setObjectName("pushButton_kpu") self.horizontalLayout.addWidget(self.pushButton_kpu) self.pushButton_save = QtWidgets.QPushButton(Form) self.pushButton_save.setObjectName("pushButton_save") self.horizontalLayout.addWidget(self.pushButton_save) self.verticalLayout.addLayout(self.horizontalLayout) self.gridLayout.addLayout(self.verticalLayout, 0, 0, 1, 1) self.retranslateUi(Form) QtCore.QMetaObject.connectSlotsByName(Form)
def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(800, 600) MainWindow.setWindowOpacity(1.0) self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.frame = QtWidgets.QFrame(self.centralwidget) self.frame.setGeometry(QtCore.QRect(0, -20, 861, 641)) self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel) self.frame.setFrameShadow(QtWidgets.QFrame.Raised) self.frame.setObjectName("frame") self.toolButton = QtWidgets.QToolButton(self.frame) self.toolButton.setGeometry(QtCore.QRect(460, 280, 111, 71)) self.toolButton.setCursor(QtGui.QCursor(QtCore.Qt.OpenHandCursor)) icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap(":/Images/Upload_icon.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.toolButton.setIcon(icon) self.toolButton.setIconSize(QtCore.QSize(40, 40)) self.toolButton.setObjectName("toolButton") self.label = QtWidgets.QLabel(self.frame) self.label.setGeometry(QtCore.QRect(580, 270, 121, 61)) font = QtGui.QFont() font.setFamily("Monospace") font.setPointSize(20) font.setBold(True) font.setItalic(True) font.setWeight(75) self.label.setFont(font) self.label.setFocusPolicy(QtCore.Qt.NoFocus) self.label.setObjectName("label") self.label_2 = QtWidgets.QLabel(self.frame) self.label_2.setGeometry(QtCore.QRect(450, 20, 281, 251)) self.label_2.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor)) self.label_2.setText("") self.label_2.setPixmap(QtGui.QPixmap(":/Images/Safety.jpeg")) self.label_2.setObjectName("label_2") self.listWidget = QtWidgets.QListWidget(self.frame) self.listWidget.setGeometry(QtCore.QRect(10, 180, 351, 381)) self.listWidget.setMinimumSize(QtCore.QSize(341, 0)) self.listWidget.viewport().setProperty( "cursor", QtGui.QCursor(QtCore.Qt.ForbiddenCursor)) self.listWidget.setObjectName("listWidget") item = QtWidgets.QListWidgetItem() font = QtGui.QFont() font.setFamily("Serif") font.setPointSize(14) font.setItalic(True) item.setFont(font) brush = QtGui.QBrush(QtGui.QColor(65, 132, 98)) brush.setStyle(QtCore.Qt.Dense7Pattern) item.setBackground(brush) self.listWidget.addItem(item) self.listWidget_2 = QtWidgets.QListWidget(self.frame) self.listWidget_2.setGeometry(QtCore.QRect(10, 50, 341, 111)) self.listWidget_2.viewport().setProperty( "cursor", QtGui.QCursor(QtCore.Qt.ForbiddenCursor)) self.listWidget_2.setObjectName("listWidget_2") item = QtWidgets.QListWidgetItem() font = QtGui.QFont() font.setFamily("Century Schoolbook L") font.setPointSize(72) font.setBold(True) font.setItalic(True) font.setUnderline(False) font.setWeight(75) item.setFont(font) brush = QtGui.QBrush(QtGui.QColor(30, 13, 158)) brush.setStyle(QtCore.Qt.BDiagPattern) item.setBackground(brush) self.listWidget_2.addItem(item) self.progressBar = QtWidgets.QProgressBar(self.frame) self.progressBar.setGeometry(QtCore.QRect(520, 480, 221, 41)) self.progressBar.setProperty("value", 0) self.progressBar.setObjectName("progressBar") self.label_3 = QtWidgets.QLabel(self.frame) self.label_3.setGeometry(QtCore.QRect(630, 310, 101, 51)) font = QtGui.QFont() font.setFamily("Monospace") font.setPointSize(20) font.setBold(True) font.setItalic(True) font.setWeight(75) self.label_3.setFont(font) self.label_3.setObjectName("label_3") self.widget = QtWidgets.QWidget(self.frame) self.widget.setGeometry(QtCore.QRect(420, 390, 321, 48)) self.widget.setObjectName("widget") self.horizontalLayout = QtWidgets.QHBoxLayout(self.widget) self.horizontalLayout.setContentsMargins(0, 0, 0, 0) self.horizontalLayout.setObjectName("horizontalLayout") self.pushButton = QtWidgets.QPushButton(self.widget) font = QtGui.QFont() font.setFamily("URW Chancery L") font.setPointSize(20) font.setBold(True) font.setItalic(True) font.setWeight(75) self.pushButton.setFont(font) self.pushButton.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) self.pushButton.setObjectName("pushButton") self.horizontalLayout.addWidget(self.pushButton) self.lineEdit = QtWidgets.QLineEdit(self.widget) font = QtGui.QFont() font.setFamily("Purisa") font.setPointSize(16) font.setBold(True) font.setItalic(True) font.setWeight(75) self.lineEdit.setFont(font) self.lineEdit.setCursor(QtGui.QCursor(QtCore.Qt.ForbiddenCursor)) self.lineEdit.setStatusTip("") self.lineEdit.setInputMask("") self.lineEdit.setObjectName("lineEdit") self.horizontalLayout.addWidget(self.lineEdit) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtWidgets.QMenuBar(MainWindow) self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 25)) self.menubar.setObjectName("menubar") self.menuMenu = QtWidgets.QMenu(self.menubar) self.menuMenu.setObjectName("menuMenu") self.menuHelp = QtWidgets.QMenu(self.menubar) self.menuHelp.setObjectName("menuHelp") MainWindow.setMenuBar(self.menubar) self.statusbar = QtWidgets.QStatusBar(MainWindow) self.statusbar.setObjectName("statusbar") MainWindow.setStatusBar(self.statusbar) self.actionQuit = QtWidgets.QAction(MainWindow) self.actionQuit.setObjectName("actionQuit") self.actionAbout = QtWidgets.QAction(MainWindow) self.actionAbout.setObjectName("actionAbout") self.menuMenu.addAction(self.actionQuit) self.menuHelp.addAction(self.actionAbout) self.menubar.addAction(self.menuMenu.menuAction()) self.menubar.addAction(self.menuHelp.menuAction()) self.actionQuit.triggered.connect(self.quit) self.toolButton.clicked.connect(self.upload) self.actionAbout.triggered.connect(self.help) self.pushButton.clicked.connect(self.status) self.retranslateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow)
def setupUi(self, Dialog_Particion): Dialog_Particion.setObjectName("Dialog_Particion") Dialog_Particion.resize(400, 175) Dialog_Particion.setMinimumSize(QtCore.QSize(400, 175)) Dialog_Particion.setMaximumSize(QtCore.QSize(400, 175)) icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap("Recursos/Logo.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off) Dialog_Particion.setWindowIcon(icon) Dialog_Particion.setStyleSheet( "background-image:url(Recursos/Fondo.jpg)") Dialog_Particion.setModal(True) self.pushButton_Aceptar = QtWidgets.QPushButton(Dialog_Particion) self.pushButton_Aceptar.setGeometry(QtCore.QRect(190, 120, 81, 31)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 123, 255, 150)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 123, 255, 150)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(0, 123, 255, 150)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 123, 255, 150)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 123, 255, 150)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(0, 123, 255, 150)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 123, 255, 150)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 123, 255, 150)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(0, 123, 255, 150)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) self.pushButton_Aceptar.setPalette(palette) font = QtGui.QFont() font.setFamily("12 MS Shell Dlg 2") font.setPointSize(8) font.setBold(True) font.setItalic(False) font.setWeight(75) self.pushButton_Aceptar.setFont(font) self.pushButton_Aceptar.setCursor( QtGui.QCursor(QtCore.Qt.PointingHandCursor)) self.pushButton_Aceptar.setStyleSheet( "background-image:url();\n" "background-color: rgb(0, 123, 255, 150);\n" "color: rgb(255, 255, 255);") self.pushButton_Aceptar.setAutoDefault(False) self.pushButton_Aceptar.setObjectName("pushButton_Aceptar") self.pushButton_Cancelar = QtWidgets.QPushButton(Dialog_Particion) self.pushButton_Cancelar.setGeometry(QtCore.QRect(300, 120, 81, 31)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 123, 255, 150)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 123, 255, 150)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(0, 123, 255, 150)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 123, 255, 150)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 123, 255, 150)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(0, 123, 255, 150)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 123, 255, 150)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 123, 255, 150)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(0, 123, 255, 150)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) self.pushButton_Cancelar.setPalette(palette) font = QtGui.QFont() font.setFamily("12 MS Shell Dlg 2") font.setPointSize(8) font.setBold(True) font.setItalic(False) font.setWeight(75) self.pushButton_Cancelar.setFont(font) self.pushButton_Cancelar.setCursor( QtGui.QCursor(QtCore.Qt.PointingHandCursor)) self.pushButton_Cancelar.setStyleSheet( "background-image:url();\n" "background-color: rgb(0, 123, 255, 150);\n" "color: rgb(255, 255, 255);") self.pushButton_Cancelar.setAutoDefault(False) self.pushButton_Cancelar.setObjectName("pushButton_Cancelar") self.label_TamanoParticion = QtWidgets.QLabel(Dialog_Particion) self.label_TamanoParticion.setGeometry(QtCore.QRect(20, 50, 241, 31)) font = QtGui.QFont() font.setPointSize(14) self.label_TamanoParticion.setFont(font) self.label_TamanoParticion.setStyleSheet("background-image:url();\n" "color: rgb(255, 255, 255);") self.label_TamanoParticion.setObjectName("label_TamanoParticion") self.spinBox_TamanoParticion = QtWidgets.QSpinBox(Dialog_Particion) self.spinBox_TamanoParticion.setGeometry(QtCore.QRect(270, 50, 81, 31)) font = QtGui.QFont() font.setPointSize(14) self.spinBox_TamanoParticion.setFont(font) self.spinBox_TamanoParticion.setLayoutDirection(QtCore.Qt.LeftToRight) self.spinBox_TamanoParticion.setStyleSheet( "color: rgb(255, 255, 255);\n" "background-color: rgb(0, 0, 0);") self.spinBox_TamanoParticion.setAlignment(QtCore.Qt.AlignCenter) self.spinBox_TamanoParticion.setMaximum(9999) self.spinBox_TamanoParticion.setSingleStep(10) self.spinBox_TamanoParticion.setObjectName("spinBox_TamanoParticion") self.retranslateUi(Dialog_Particion) QtCore.QMetaObject.connectSlotsByName(Dialog_Particion) Dialog_Particion.setTabOrder(self.pushButton_Aceptar, self.pushButton_Cancelar)
def drawRect(self, event, qp): rect = QtCore.QRect(250, 250, 100, 100) qp.setBrush(QtGui.QColor(self.displayed_stimulus)) qp.drawRoundedRect(rect, 10.0, 10.0)
def drawIntroOutroText(self, event, qp): qp.setPen(QtGui.QColor(0, 0, 0)) qp.setFont(QtGui.QFont('Decorative', 20)) qp.drawText(event.rect(), QtCore.Qt.AlignCenter, self.displayed_stimulus)
def setupUi(self, MainWindow): # 初始路径 self.fileSystem = BLL.FileSystem.FileSystem() iconPath = self.fileSystem.iconPath # 主窗口 MainWindow.resize(1200, 800) self.centralwidget = QtWidgets.QWidget(MainWindow) MainWindow.setCentralWidget(self.centralwidget) # 设置窗口背景颜色为白色 pe = QtGui.QPalette() pe.setColor(pe.Background, QtGui.QColor(255, 255, 255)) self.centralwidget.window().setPalette(pe) # 主窗口布局 gLayout = QtWidgets.QHBoxLayout(self.centralwidget) # 用户窗口初始化(主窗口布局左侧) userWidget = QtWidgets.QWidget(self.centralwidget) userWidget.setMaximumWidth(250) gLayout.addWidget(userWidget) # 用户头像 avatarLabel = QtWidgets.QLabel(userWidget) path = iconPath + '/' + "user.png" img = QtGui.QImage(path) # 设置最大长宽 maxSize = QtCore.QSize(80, 80) # 按比例放缩(最大长宽通过传入的QSize限制) avatarImg = QtGui.QPixmap.fromImage(img.scaled(maxSize, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation)) avatarLabel.setPixmap(avatarImg) # 头像居中 avatarLabel.setAlignment(QtCore.Qt.AlignCenter) # 账户标签 self.accountLabel = QtWidgets.QLabel(userWidget) self.accountLabel.setFont(QtGui.QFont("微软雅黑", 12, QtGui.QFont.Bold)) # 标签居中 self.accountLabel.setAlignment(QtCore.Qt.AlignCenter) # 统一设置按钮格式 userWidget.setStyleSheet("""QPushButton{ color:white; background-color:rgb(14 , 150 , 254); border-radius:5px; font: 微软雅黑 bold 12px; min-width: 220px; min-height: 30px; } """) # 浏览热门图片 self.browseButton = QtWidgets.QPushButton(userWidget) self.browseButton.setText("浏览热门作品") self.browseButton.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) # 查看我的作品 self.myWorkButton = QtWidgets.QPushButton(userWidget) self.myWorkButton.setText("查看我的作品") self.myWorkButton.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) # 查看指定作品 self.downLoadButton = QtWidgets.QPushButton(userWidget) self.downLoadButton.setText("查看指定作品") self.downLoadButton.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) # 生成迁移图片 self.transferButton = QtWidgets.QPushButton(userWidget) self.transferButton.setText("生成迁移图片") self.transferButton.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) # 上传本地作品 self.upLoadButton = QtWidgets.QPushButton(userWidget) self.upLoadButton.setText("上传本地作品") self.upLoadButton.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) # 列表栏(主窗口布局左下) self.listWidget = QtWidgets.QListWidget(userWidget) self.listWidget.setResizeMode(QtWidgets.QListView.Adjust) # 设置列表栏的滚动条 self.listWidget.setVerticalScrollMode(QtWidgets.QAbstractItemView.ScrollPerPixel) self.listWidget.verticalScrollBar().setSingleStep(20) # 设置列表固定宽度 self.listWidget.setMinimumSize(230, 500) self.listWidget.setMaximumSize(230, 500) # 用户窗口布局 userWidgetLayout = QtWidgets.QVBoxLayout(userWidget) userWidgetLayout.addWidget(avatarLabel) userWidgetLayout.addWidget(self.accountLabel) userWidgetLayout.addWidget(self.browseButton, 1, QtCore.Qt.AlignCenter) userWidgetLayout.addWidget(self.myWorkButton, 1, QtCore.Qt.AlignCenter) userWidgetLayout.addWidget(self.downLoadButton, 1, QtCore.Qt.AlignCenter) userWidgetLayout.addWidget(self.upLoadButton, 1, QtCore.Qt.AlignCenter) userWidgetLayout.addWidget(self.transferButton, 1, QtCore.Qt.AlignCenter) userWidgetLayout.addWidget(self.listWidget) self.pageWidget = QtWidgets.QWidget(self.centralwidget) # 布局 pageWidgetLayout = QtWidgets.QVBoxLayout(self.pageWidget) # 标题框 self.titleEdit = QtWidgets.QLabel(self.pageWidget) self.titleEdit.setMinimumHeight(50) self.titleEdit.setMaximumHeight(50) self.titleEdit.setFont(QtGui.QFont("微软雅黑", 20, QtGui.QFont.Bold)) self.titleEdit.setAlignment(QtCore.Qt.AlignCenter) # 标题框背景透明 self.titleEdit.setStyleSheet("background:transparent;border-width:0;border-style:outset") # 文本编辑窗口初始化(主窗口布局右侧) imgWidget = QtWidgets.QWidget(self.pageWidget) # 文本编辑窗口内部布局 textWidgetLayout = QtWidgets.QVBoxLayout(imgWidget) # 图片显示标签 self.imgLabel = QtWidgets.QLabel(imgWidget) self.imgLabel.setText("未选择图片") self.imgLabel.setMinimumSize(500, 500) self.imgLabel.setAlignment(QtCore.Qt.AlignCenter) # 文字显示标签 self.textLabel = QtWidgets.QLabel(imgWidget) self.textLabel.setText("") self.textLabel.setMinimumSize(500, 50) self.textLabel.setAlignment(QtCore.Qt.AlignCenter) self.textLabel.setFont(QtGui.QFont("微软雅黑", 14, QtGui.QFont.Bold)) # 点赞按钮 self.starButton = QtWidgets.QPushButton(imgWidget) path = iconPath + '/' + "star.png" self.starButton.setStyleSheet("QPushButton{border-image: url(%s)}" % path) self.starButton.setFixedSize(80, 80) self.starButton.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) # 评论按钮 self.commentButton = QtWidgets.QPushButton(imgWidget) path = iconPath + '/' + "comment.png" self.commentButton.setStyleSheet("QPushButton{border-image: url(%s)}" % path) self.commentButton.setFixedSize(80, 80) self.commentButton.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) # 导出按钮 self.saveAsButton = QtWidgets.QPushButton(imgWidget) path = iconPath + '/' + "saveAs.png" self.saveAsButton.setStyleSheet("QPushButton{border-image: url(%s)}" % path) self.saveAsButton.setFixedSize(80, 80) self.saveAsButton.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) # 删除按钮 self.deleteButton = QtWidgets.QPushButton(imgWidget) path = iconPath + '/' + "delete.png" self.deleteButton.setStyleSheet("QPushButton{border-image: url(%s)}" % path) self.deleteButton.setFixedSize(80, 80) self.deleteButton.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) # 按钮窗口 buttonWidget = QtWidgets.QWidget(imgWidget) buttonWidgetLayout = QtWidgets.QHBoxLayout(buttonWidget) buttonWidgetLayout.addWidget(self.starButton, QtCore.Qt.AlignCenter) buttonWidgetLayout.addWidget(self.commentButton, QtCore.Qt.AlignCenter) buttonWidgetLayout.addWidget(self.saveAsButton, QtCore.Qt.AlignCenter) buttonWidgetLayout.addWidget(self.deleteButton, QtCore.Qt.AlignCenter) # 文本编辑框添加进文本编辑窗口的内部布局(下方) textWidgetLayout.addWidget(self.imgLabel) textWidgetLayout.addWidget(self.textLabel) textWidgetLayout.addWidget(buttonWidget) pageWidgetLayout.addWidget(self.titleEdit) pageWidgetLayout.addWidget(imgWidget) # 文本编辑窗口添加进主窗口布局(右侧) gLayout.addWidget(self.pageWidget)
def setupUi(self, ArchitectureError): ArchitectureError.setObjectName("ArchitectureError") ArchitectureError.resize(688, 230) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(184, 184, 184, 142)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(184, 184, 184, 142)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) ArchitectureError.setPalette(palette) self.dockWidgetContents = QtWidgets.QWidget() self.dockWidgetContents.setObjectName("dockWidgetContents") self.groupBox = QtWidgets.QGroupBox(self.dockWidgetContents) self.groupBox.setGeometry(QtCore.QRect(0, -20, 691, 231)) self.groupBox.setTitle("") self.groupBox.setObjectName("groupBox") self.PluginView_4 = QtWidgets.QLineEdit(self.groupBox) self.PluginView_4.setGeometry(QtCore.QRect(0, 10, 691, 51)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(114, 159, 207)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(114, 159, 207)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) self.PluginView_4.setPalette(palette) font = QtGui.QFont() font.setPointSize(10) font.setBold(True) font.setWeight(75) self.PluginView_4.setFont(font) self.PluginView_4.setAutoFillBackground(False) self.PluginView_4.setAlignment(QtCore.Qt.AlignCenter) self.PluginView_4.setReadOnly(True) self.PluginView_4.setObjectName("PluginView_4") self.PluginView_3 = QtWidgets.QColumnView(self.groupBox) self.PluginView_3.setGeometry(QtCore.QRect(0, 60, 691, 171)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(184, 184, 184, 142)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(184, 184, 184, 142)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) self.PluginView_3.setPalette(palette) self.PluginView_3.setObjectName("PluginView_3") #self.pushButton = QtWidgets.QPushButton(self.groupBox) #self.pushButton.setGeometry(QtCore.QRect(534, 182, 81, 31)) #self.pushButton.setObjectName("pushButton") self.label = QtWidgets.QLabel(self.groupBox) self.label.setGeometry(QtCore.QRect(30, 80, 501, 101)) self.label.setTextFormat(QtCore.Qt.AutoText) self.label.setObjectName("label") self.PluginView_3.raise_() self.PluginView_4.raise_() #self.pushButton.raise_() self.label.raise_() ArchitectureError.setCentralWidget(self.dockWidgetContents) self.retranslateUi(ArchitectureError) QtCore.QMetaObject.connectSlotsByName(ArchitectureError) self.pushButton.clicked.connect(self.close_window)
def setupUi(self, scrollArea): scrollArea.setObjectName("scrollArea") scrollArea.resize(783, 705) scrollArea.setWidgetResizable(True) self.scrollAreaWidgetContents = QtWidgets.QWidget() self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 781, 703)) self.scrollAreaWidgetContents.setObjectName("scrollAreaWidgetContents") self.horizontalLayout = QtWidgets.QHBoxLayout( self.scrollAreaWidgetContents) self.horizontalLayout.setObjectName("horizontalLayout") self.verticalLayoutScroll = QtWidgets.QVBoxLayout() self.verticalLayoutScroll.setObjectName("verticalLayoutScroll") self.gridLayoutTop = QtWidgets.QGridLayout() self.gridLayoutTop.setObjectName("gridLayoutTop") self.comboRef1 = QtWidgets.QComboBox(self.scrollAreaWidgetContents) self.comboRef1.setObjectName("comboRef1") self.gridLayoutTop.addWidget(self.comboRef1, 0, 0, 1, 1) self.pushSearch = QtWidgets.QPushButton(self.scrollAreaWidgetContents) self.pushSearch.setObjectName("pushSearch") self.gridLayoutTop.addWidget(self.pushSearch, 1, 2, 1, 2) self.lineRef2 = QtWidgets.QLineEdit(self.scrollAreaWidgetContents) self.lineRef2.setObjectName("lineRef2") self.gridLayoutTop.addWidget(self.lineRef2, 1, 1, 1, 1) self.pushNewRow = QtWidgets.QPushButton(self.scrollAreaWidgetContents) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.pushNewRow.sizePolicy().hasHeightForWidth()) self.pushNewRow.setSizePolicy(sizePolicy) self.pushNewRow.setObjectName("pushNewRow") self.gridLayoutTop.addWidget(self.pushNewRow, 1, 5, 1, 2) self.labelRow = QtWidgets.QLabel(self.scrollAreaWidgetContents) self.labelRow.setObjectName("labelRow") self.gridLayoutTop.addWidget(self.labelRow, 0, 5, 1, 1) self.spinRow = QtWidgets.QSpinBox(self.scrollAreaWidgetContents) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.spinRow.sizePolicy().hasHeightForWidth()) self.spinRow.setSizePolicy(sizePolicy) self.spinRow.setMinimumSize(QtCore.QSize(100, 25)) self.spinRow.setObjectName("spinRow") self.gridLayoutTop.addWidget(self.spinRow, 0, 6, 1, 1) self.comboRef2 = QtWidgets.QComboBox(self.scrollAreaWidgetContents) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(102, 255, 204)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(102, 255, 204)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(102, 255, 204)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) self.comboRef2.setPalette(palette) self.comboRef2.setObjectName("comboRef2") self.gridLayoutTop.addWidget(self.comboRef2, 1, 0, 1, 1) self.comboSearch = QtWidgets.QComboBox(self.scrollAreaWidgetContents) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.comboSearch.sizePolicy().hasHeightForWidth()) self.comboSearch.setSizePolicy(sizePolicy) self.comboSearch.setMinimumSize(QtCore.QSize(150, 30)) self.comboSearch.setObjectName("comboSearch") self.gridLayoutTop.addWidget(self.comboSearch, 0, 2, 1, 1) self.lineRef1 = QtWidgets.QLineEdit(self.scrollAreaWidgetContents) self.lineRef1.setObjectName("lineRef1") self.gridLayoutTop.addWidget(self.lineRef1, 0, 1, 1, 1) self.lineSearch = QtWidgets.QLineEdit(self.scrollAreaWidgetContents) self.lineSearch.setObjectName("lineSearch") self.gridLayoutTop.addWidget(self.lineSearch, 0, 3, 1, 1) spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.gridLayoutTop.addItem(spacerItem, 0, 4, 1, 1) self.verticalLayoutScroll.addLayout(self.gridLayoutTop) self.scrollMiddle = QtWidgets.QScrollArea( self.scrollAreaWidgetContents) self.scrollMiddle.setWidgetResizable(True) self.scrollMiddle.setObjectName("scrollMiddle") self.scrollAreaWidgetContents_2 = QtWidgets.QWidget() self.scrollAreaWidgetContents_2.setGeometry( QtCore.QRect(0, 0, 753, 517)) self.scrollAreaWidgetContents_2.setObjectName( "scrollAreaWidgetContents_2") self.verticalLayout = QtWidgets.QVBoxLayout( self.scrollAreaWidgetContents_2) self.verticalLayout.setObjectName("verticalLayout") self.horizontalLayoutMacro = QtWidgets.QHBoxLayout() self.horizontalLayoutMacro.setObjectName("horizontalLayoutMacro") self.labelMacro = QtWidgets.QLabel(self.scrollAreaWidgetContents_2) self.labelMacro.setObjectName("labelMacro") self.horizontalLayoutMacro.addWidget(self.labelMacro) self.comboBoxMacro = QtWidgets.QComboBox( self.scrollAreaWidgetContents_2) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(32, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(128, 0, 128)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Light, brush) brush = QtGui.QBrush(QtGui.QColor(128, 128, 3)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Midlight, brush) brush = QtGui.QBrush(QtGui.QColor(128, 0, 64)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Dark, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 10)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Mid, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.BrightText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(252, 2, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(252, 1, 7)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(128, 0, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Shadow, brush) brush = QtGui.QBrush(QtGui.QColor(16, 128, 64)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.AlternateBase, brush) brush = QtGui.QBrush(QtGui.QColor(128, 64, 2)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.NoRole, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(32, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(128, 0, 128)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Light, brush) brush = QtGui.QBrush(QtGui.QColor(128, 128, 3)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Midlight, brush) brush = QtGui.QBrush(QtGui.QColor(128, 0, 64)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Dark, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 10)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Mid, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.BrightText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(252, 2, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(252, 1, 7)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(128, 0, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Shadow, brush) brush = QtGui.QBrush(QtGui.QColor(16, 128, 64)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.AlternateBase, brush) brush = QtGui.QBrush(QtGui.QColor(128, 64, 2)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.NoRole, brush) brush = QtGui.QBrush(QtGui.QColor(128, 0, 64)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(32, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush) brush = QtGui.QBrush(QtGui.QColor(128, 0, 128)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Light, brush) brush = QtGui.QBrush(QtGui.QColor(128, 128, 3)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Midlight, brush) brush = QtGui.QBrush(QtGui.QColor(128, 0, 64)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Dark, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 10)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Mid, brush) brush = QtGui.QBrush(QtGui.QColor(128, 0, 64)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.BrightText, brush) brush = QtGui.QBrush(QtGui.QColor(128, 0, 64)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(252, 1, 7)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(252, 1, 7)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(128, 0, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Shadow, brush) brush = QtGui.QBrush(QtGui.QColor(16, 128, 64)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.AlternateBase, brush) brush = QtGui.QBrush(QtGui.QColor(128, 64, 2)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.NoRole, brush) self.comboBoxMacro.setPalette(palette) self.comboBoxMacro.setObjectName("comboBoxMacro") self.comboBoxMacro.addItem("") self.comboBoxMacro.addItem("") self.horizontalLayoutMacro.addWidget(self.comboBoxMacro) self.lineMacro = QtWidgets.QLineEdit(self.scrollAreaWidgetContents_2) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(33, 255, 128)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(33, 255, 128)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(236, 236, 236)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) self.lineMacro.setPalette(palette) self.lineMacro.setObjectName("lineMacro") self.horizontalLayoutMacro.addWidget(self.lineMacro) spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.horizontalLayoutMacro.addItem(spacerItem1) self.verticalLayout.addLayout(self.horizontalLayoutMacro) self.scrollMiddle.setWidget(self.scrollAreaWidgetContents_2) self.verticalLayoutScroll.addWidget(self.scrollMiddle) self.gridLayoutBottom = QtWidgets.QGridLayout() self.gridLayoutBottom.setObjectName("gridLayoutBottom") self.lineSh2 = QtWidgets.QLineEdit(self.scrollAreaWidgetContents) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.lineSh2.sizePolicy().hasHeightForWidth()) self.lineSh2.setSizePolicy(sizePolicy) self.lineSh2.setObjectName("lineSh2") self.gridLayoutBottom.addWidget(self.lineSh2, 1, 1, 1, 1) spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.gridLayoutBottom.addItem(spacerItem2, 0, 2, 1, 1) self.lineSh1 = QtWidgets.QLineEdit(self.scrollAreaWidgetContents) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.lineSh1.sizePolicy().hasHeightForWidth()) self.lineSh1.setSizePolicy(sizePolicy) self.lineSh1.setMinimumSize(QtCore.QSize(100, 0)) self.lineSh1.setObjectName("lineSh1") self.gridLayoutBottom.addWidget(self.lineSh1, 0, 1, 1, 1) self.labelSh1 = QtWidgets.QLabel(self.scrollAreaWidgetContents) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.labelSh1.sizePolicy().hasHeightForWidth()) self.labelSh1.setSizePolicy(sizePolicy) self.labelSh1.setObjectName("labelSh1") self.gridLayoutBottom.addWidget(self.labelSh1, 0, 0, 1, 1) self.labelSh2 = QtWidgets.QLabel(self.scrollAreaWidgetContents) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.labelSh2.sizePolicy().hasHeightForWidth()) self.labelSh2.setSizePolicy(sizePolicy) self.labelSh2.setObjectName("labelSh2") self.gridLayoutBottom.addWidget(self.labelSh2, 1, 0, 1, 1) self.pushCancel = QtWidgets.QPushButton(self.scrollAreaWidgetContents) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.pushCancel.sizePolicy().hasHeightForWidth()) self.pushCancel.setSizePolicy(sizePolicy) self.pushCancel.setMinimumSize(QtCore.QSize(100, 0)) self.pushCancel.setObjectName("pushCancel") self.gridLayoutBottom.addWidget(self.pushCancel, 1, 4, 1, 1) self.pushQuit = QtWidgets.QPushButton(self.scrollAreaWidgetContents) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.pushQuit.sizePolicy().hasHeightForWidth()) self.pushQuit.setSizePolicy(sizePolicy) self.pushQuit.setMinimumSize(QtCore.QSize(100, 0)) self.pushQuit.setObjectName("pushQuit") self.gridLayoutBottom.addWidget(self.pushQuit, 1, 5, 1, 1) self.pushWrite = QtWidgets.QPushButton(self.scrollAreaWidgetContents) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.pushWrite.sizePolicy().hasHeightForWidth()) self.pushWrite.setSizePolicy(sizePolicy) self.pushWrite.setMinimumSize(QtCore.QSize(100, 0)) self.pushWrite.setObjectName("pushWrite") self.gridLayoutBottom.addWidget(self.pushWrite, 0, 4, 1, 1) self.pushHelp = QtWidgets.QPushButton(self.scrollAreaWidgetContents) self.pushHelp.setObjectName("pushHelp") self.gridLayoutBottom.addWidget(self.pushHelp, 1, 3, 1, 1) self.pushSave = QtWidgets.QPushButton(self.scrollAreaWidgetContents) self.pushSave.setObjectName("pushSave") self.gridLayoutBottom.addWidget(self.pushSave, 0, 5, 1, 1) self.verticalLayoutScroll.addLayout(self.gridLayoutBottom) self.horizontalLayout.addLayout(self.verticalLayoutScroll) scrollArea.setWidget(self.scrollAreaWidgetContents) self.retranslateUi(scrollArea) QtCore.QMetaObject.connectSlotsByName(scrollArea)
def hex2QColor(c): r=int(c[0:2],16) g=int(c[2:4],16) b=int(c[4:6],16) return QtGui.QColor(r,g,b)
def paintEvent(self, ev): p = QtGui.QPainter() p.begin(self) p.setPen(QtGui.QPen(QtGui.QColor(0, 0, 0), 1)) draw(p, self.tree, 10, 10) p.end()
def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.setWindowModality(QtCore.Qt.NonModal) MainWindow.resize(800, 600) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Light, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Midlight, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0, 128)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.PlaceholderText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Light, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Midlight, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0, 128)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.PlaceholderText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Light, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Midlight, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0, 128)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.PlaceholderText, brush) MainWindow.setPalette(palette) self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.PasswordLabel = QtWidgets.QLabel(self.centralwidget) self.PasswordLabel.setGeometry(QtCore.QRect(230, 470, 110, 30)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush) self.PasswordLabel.setPalette(palette) font = QtGui.QFont() font.setPointSize(10) font.setBold(True) font.setWeight(75) self.PasswordLabel.setFont(font) self.PasswordLabel.setObjectName("PasswordLabel") self.dollars = QtWidgets.QLabel(self.centralwidget) self.dollars.setEnabled(True) self.dollars.setGeometry(QtCore.QRect(220, 30, 360, 360)) self.dollars.setAutoFillBackground(True) self.dollars.setText("") self.dollars.setPixmap(QtGui.QPixmap("../dollars/dollars.png")) self.dollars.setScaledContents(True) self.dollars.setObjectName("dollars") self.EnterButton = QtWidgets.QPushButton(self.centralwidget) self.EnterButton.setGeometry(QtCore.QRect(310, 520, 190, 30)) font = QtGui.QFont() font.setPointSize(9) font.setBold(True) font.setWeight(75) self.EnterButton.setFont(font) self.EnterButton.setObjectName("EnterButton") self.PasswordLineEdit = QtWidgets.QLineEdit(self.centralwidget) self.PasswordLineEdit.setGeometry(QtCore.QRect(350, 470, 210, 30)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0, 128)) brush.setStyle(QtCore.Qt.NoBrush) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.PlaceholderText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0, 128)) brush.setStyle(QtCore.Qt.NoBrush) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.PlaceholderText, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0, 128)) brush.setStyle(QtCore.Qt.NoBrush) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.PlaceholderText, brush) self.PasswordLineEdit.setPalette(palette) font = QtGui.QFont() font.setPointSize(12) self.PasswordLineEdit.setFont(font) self.PasswordLineEdit.setFrame(False) self.PasswordLineEdit.setEchoMode(QtWidgets.QLineEdit.Password) self.PasswordLineEdit.setObjectName("PasswordLineEdit") self.LoginLineEdit = QtWidgets.QLineEdit(self.centralwidget) self.LoginLineEdit.setGeometry(QtCore.QRect(350, 420, 170, 30)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0, 128)) brush.setStyle(QtCore.Qt.NoBrush) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.PlaceholderText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0, 128)) brush.setStyle(QtCore.Qt.NoBrush) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.PlaceholderText, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0, 128)) brush.setStyle(QtCore.Qt.NoBrush) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.PlaceholderText, brush) self.LoginLineEdit.setPalette(palette) font = QtGui.QFont() font.setPointSize(12) self.LoginLineEdit.setFont(font) self.LoginLineEdit.setText("") self.LoginLineEdit.setFrame(False) self.LoginLineEdit.setEchoMode(QtWidgets.QLineEdit.Normal) self.LoginLineEdit.setObjectName("LoginLineEdit") self.LoginLabel = QtWidgets.QLabel(self.centralwidget) self.LoginLabel.setGeometry(QtCore.QRect(270, 420, 70, 30)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush) self.LoginLabel.setPalette(palette) font = QtGui.QFont() font.setPointSize(10) font.setBold(True) font.setWeight(75) self.LoginLabel.setFont(font) self.LoginLabel.setObjectName("LoginLabel") self.RegisterButton = QtWidgets.QPushButton(self.centralwidget) self.RegisterButton.setGeometry(QtCore.QRect(620, 20, 140, 30)) font = QtGui.QFont() font.setPointSize(9) font.setBold(True) font.setWeight(75) self.RegisterButton.setFont(font) self.RegisterButton.setObjectName("RegisterButton") self.error = QtWidgets.QLabel(self.centralwidget) self.error.setGeometry(QtCore.QRect(550, 420, 221, 31)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush) self.error.setPalette(palette) self.error.setText("") self.error.setObjectName("error") self.PasswordLabel.raise_() self.EnterButton.raise_() self.dollars.raise_() self.PasswordLineEdit.raise_() self.LoginLineEdit.raise_() self.LoginLabel.raise_() self.RegisterButton.raise_() self.error.raise_() MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtWidgets.QMenuBar(MainWindow) self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 26)) self.menubar.setObjectName("menubar") MainWindow.setMenuBar(self.menubar) self.statusbar = QtWidgets.QStatusBar(MainWindow) self.statusbar.setObjectName("statusbar") MainWindow.setStatusBar(self.statusbar) self.retranslateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow)
def handleItemEntered(self, item): item.setBackground(QtGui.QColor('moccasin'))
def setupUi(self, Dialog): Dialog.setObjectName("Dialog") Dialog.resize(481, 246) Dialog.setMinimumSize(QtCore.QSize(481, 246)) Dialog.setMaximumSize(QtCore.QSize(481, 246)) self.label = QtWidgets.QLabel(Dialog) self.label.setGeometry(QtCore.QRect(10, 10, 461, 51)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(0, 0, 127)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 127)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 127)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 127, 128)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.PlaceholderText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 127)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 127)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 127)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 127, 128)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.PlaceholderText, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0, 128)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.PlaceholderText, brush) self.label.setPalette(palette) font = QtGui.QFont() font.setPointSize(25) self.label.setFont(font) self.label.setObjectName("label") self.label_2 = QtWidgets.QLabel(Dialog) self.label_2.setGeometry(QtCore.QRect(30, 90, 181, 31)) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(0, 0, 127)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 127)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.BrightText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 127)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 127)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.ToolTipText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 127, 128)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.PlaceholderText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 127)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 127)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.BrightText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 127)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 127)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ToolTipText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 127, 128)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.PlaceholderText, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 127)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.BrightText, brush) brush = QtGui.QBrush(QtGui.QColor(120, 120, 120)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 127)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.ToolTipText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 127, 128)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.PlaceholderText, brush) self.label_2.setPalette(palette) font = QtGui.QFont() font.setPointSize(12) self.label_2.setFont(font) self.label_2.setObjectName("label_2") self.label_3 = QtWidgets.QLabel(Dialog) self.label_3.setGeometry(QtCore.QRect(100, 150, 291, 31)) self.label_3.setText("") self.label_3.setObjectName("label_3") self.retranslateUi(Dialog) QtCore.QMetaObject.connectSlotsByName(Dialog)
def create_ui(self): """Set up the user interface, signals & slots """ self.widget = QtWidgets.QWidget(self) self.setCentralWidget(self.widget) # In this widget, the video will be drawn if platform.system() == "Darwin": # for MacOS self.videoframe = QtWidgets.QMacCocoaViewContainer(0) else: self.videoframe = QtWidgets.QFrame() self.palette = self.videoframe.palette() self.palette.setColor(QtGui.QPalette.Window, QtGui.QColor(0, 0, 0)) self.videoframe.setPalette(self.palette) self.videoframe.setAutoFillBackground(True) # Create the time display self.timelabel = QtWidgets.QLabel("00:00:00", self) # Create the position slider (QSlider) self.positionslider = QtWidgets.QSlider(QtCore.Qt.Horizontal, self) self.positionslider.setToolTip("Position") self.positionslider.setMaximum(1000) self.positionslider.sliderMoved.connect(self.set_position) # self.positionslider.sliderPressed.connect(self.set_position) self.positionslider.sliderMoved.connect(self.update_time_label) # Create the "previous frame" button self.previousframe = QtWidgets.QPushButton() self.previousframe.setFixedWidth(25) self.previousframe.setIcon(self.style().standardIcon( QtWidgets.QStyle.SP_MediaSkipBackward)) self.previousframe.clicked.connect(self.on_previous_frame) # Create the play button and connect it to the play/pause function self.playbutton = QtWidgets.QPushButton() self.playbutton.setFixedWidth(40) self.playbutton.setIcon(self.style().standardIcon( QtWidgets.QStyle.SP_MediaPlay)) self.playbutton.clicked.connect(self.play_pause) # Create the "next frame" button self.nextframe = QtWidgets.QPushButton() self.nextframe.setFixedWidth(25) self.nextframe.setIcon(self.style().standardIcon( QtWidgets.QStyle.SP_MediaSkipForward)) self.nextframe.clicked.connect(self.on_next_frame) # Create the "Playback rate" label self.pb_rate_label = QtWidgets.QLabel( "Playback rate: {}x".format(self.mediaplayer.get_rate()), self) # Create the "decrease playback rate" button self.decr_pb_rate = QtWidgets.QPushButton() self.decr_pb_rate.setFixedWidth(30) self.decr_pb_rate.setIcon(self.style().standardIcon( QtWidgets.QStyle.SP_MediaSeekBackward)) self.decr_pb_rate.clicked.connect(self.decr_mov_play_rate) # Create the stop button and connect it to the stop function self.stopbutton = QtWidgets.QPushButton() self.stopbutton.setFixedWidth(30) self.stopbutton.setIcon(self.style().standardIcon( QtWidgets.QStyle.SP_MediaStop)) self.stopbutton.clicked.connect(self.stop) # Create the "increase playback rate" button self.incr_pb_rate = QtWidgets.QPushButton() self.incr_pb_rate.setFixedWidth(30) self.incr_pb_rate.setIcon(self.style().standardIcon( QtWidgets.QStyle.SP_MediaSeekForward)) self.incr_pb_rate.clicked.connect(self.incr_mov_play_rate) self.top_control_box = QtWidgets.QHBoxLayout() # Add the time and position slider to the 1st controls layout self.top_control_box.addWidget(self.timelabel) self.top_control_box.addWidget(self.positionslider) self.bottom_control_box = QtWidgets.QHBoxLayout() # Add the buttons to the 2nd controls layout self.bottom_control_box.addWidget(self.previousframe) self.bottom_control_box.addWidget(self.playbutton) self.bottom_control_box.addWidget(self.nextframe) self.bottom_control_box.addWidget(self.pb_rate_label) self.bottom_control_box.addWidget(self.decr_pb_rate) self.bottom_control_box.addWidget(self.stopbutton) self.bottom_control_box.addWidget(self.incr_pb_rate) self.vboxlayout = QtWidgets.QVBoxLayout() self.vboxlayout.addWidget(self.videoframe) self.vboxlayout.addLayout(self.top_control_box) self.vboxlayout.addLayout(self.bottom_control_box) self.widget.setLayout(self.vboxlayout) menu_bar = self.menuBar() # File menu file_menu = menu_bar.addMenu("File") # Create submenu to start new processes from file menu new_menu = QtWidgets.QMenu("Launch", self) file_menu.addMenu(new_menu) new_video_action = QtWidgets.QAction("New Video", self) new_menu.addAction(new_video_action) new_video_action.triggered.connect(on_new_video) # Create actions to load a new media file and to close the app open_action = QtWidgets.QAction("Load Video", self) close_action = QtWidgets.QAction("Close App", self) file_menu.addAction(open_action) file_menu.addAction(close_action) open_action.triggered.connect(self.open_file) close_action.triggered.connect(sys.exit)
def __init__(self): super().__init__() self.resize(1000, 1000) self._widget = QWidget(self) self.setCentralWidget(self._widget) self._widget.resize(1000, 1000) self._widget.setWindowFlags(Qt.NoDropShadowWindowHint) # VTK self._vtk_widget = QVTKRenderWindowInteractor(self._widget) self._vtk_widget.SetInteractorStyle( vtk.vtkInteractorStyleMultiTouchCamera()) self._vtk_widget.resize(1000, 1000) self.setWindowFlags(Qt.NoDropShadowWindowHint) # PAINTER # UI self._ui = Ui_Form() self._ui.setupUi(self._widget) self._ui.widget.move(30, 30) self._ui.widget.setVisible(False) self._ui.widget.setWindowFlags(Qt.NoDropShadowWindowHint) # 设置边边的颜色 self._pal = self._ui.widget.palette() self._pal.setColor(QPalette.Background, QtGui.QColor(0, 0, 0)) self._ui.widget.setAutoFillBackground(True) # 把QTapWidget的边边拿出来 self._ui.widget.setPalette(self._pal) self._ui2 = Ui_hello() self._ui2.setupUi(self._widget) self._ui2.widget.move(30, 200) self._ui2.widget.setVisible(False) self._ui2.widget.setWindowFlags(Qt.NoDropShadowWindowHint) # BTN self._btn1 = QPushButton('BTN1', self._widget) self._btn1.resize(50, 70) self._btn1.move(500, 50) self._btn1.show() self._btn2 = QPushButton('BTN2', self._widget) self._btn2.resize(50, 70) self._btn2.move(500, 150) self._btn2.show() # SIGNAL self._btn1.clicked.connect(self._set_widget1_visible) self._btn2.clicked.connect(self._set_widget2_visible) # ATTR self._ui_ena = False self._ui_ena2 = False sheet = """ QTabWidget::tab-bar { background-color: black; } QTabBar::tab { background-color: black; border-color:white; font: bold 12px 'Arial'; color: white; height:60px; } QTabBar::tab:!selected { background-color: black; color: white; } QTabWidget::pane { position: absolute; background-color: black; } """ self._ui.widget.setStyleSheet(sheet) self._ui2.widget.setAutoFillBackground(True)
from ui_nsfw_scann import Ui_dlgNsfwScanner from PyQt5 import QtWidgets, QtGui, QtCore from pathlib import Path from keras.preprocessing import image from keras.applications.imagenet_utils import preprocess_input from keras.models import model_from_json from keras import backend as K import numpy as np from time import time, sleep import itertools miniatureFolder = 'miniatures' cNormal = QtGui.QColor('green') cDanger = QtGui.QColor('red') cWarning = QtGui.QColor('silver') def searching_all_files(path: Path): dirpath = Path(path) assert(dirpath.is_dir()) file_list = [] for x in dirpath.iterdir(): if x.is_file(): file_list.append(x) elif x.is_dir(): file_list.extend(searching_all_files(x)) return file_list class Loading(QtCore.QThread): loading = QtCore.pyqtSignal(str)
def translateIt(self): unknown = self.lineEdit.text() if unknown == '': unknown = 'Stay Home' self.lineEdit.setText('Stay Home :)') unknown = unknown.lower() wordTr = tureng.get_result(unknown) wordCm = cambridge.getTranslate(unknown) if 'suggestions' not in wordTr: wordTr = tureng.translate(unknown) pass else: trSuggestList = list(wordTr.values()) wordTr = False # flag for suggestion dR = [213, 210, 159] # dark row color lR = [233, 232, 204] # light row color ###################################################### ################ TURENG WORKSPACE #################### ###################################################### if self.trLayout.count() > 0: self.trTable.setColumnCount(2) self.trTable.setRowCount(0) else: self.trTable = QtWidgets.QTableWidget(self.trFrame) self.trTable.setObjectName("trTable") self.trLayout.addWidget(self.trTable) self.trTable.setColumnCount(2) self.trTable.setRowCount(0) self.trTable.setSelectionMode(0) self.trTable.setFocusPolicy(0) self.trTable.setEditTriggers(QtWidgets.QTableWidget.NoEditTriggers) self.trTable.verticalHeader().setVisible(False) self.trTable.horizontalHeader().setStretchLastSection(True) # Strech first column header = QtWidgets.QHeaderView(QtCore.Qt.Horizontal, self.trTable) self.trTable.setHorizontalHeader(header) header.setVisible(False) header.setSectionResizeMode(0, QtWidgets.QHeaderView.Stretch) try: self.trTable.cellDoubleClicked.disconnect() except: pass if wordTr == False: #check result is suggestions suggestions = trSuggestList[0] self.trTable.setColumnCount(1) for word in suggestions: newRow = self.trTable.rowCount() + 1 currentRow = newRow - 1 self.trTable.setRowCount(newRow) self.trTable.setItem(currentRow, 0, QtWidgets.QTableWidgetItem(word)) self.trTable.item(currentRow, 0).setBackground( (QtGui.QColor(dR[0], dR[1], dR[2]))) self.trTable.cellDoubleClicked.connect(self.reTranslateTreng) else: for i in range(0, len(wordTr)): if self.trTable.rowCount() == 0: self.trTable.setRowCount(self.trTable.rowCount() + 1) tempRow = self.trTable.rowCount() - 1 self.trTable.setSpan(tempRow, 0, 1, 2) self.trTable.setItem( tempRow, 0, QtWidgets.QTableWidgetItem(wordTr[i][1])) self.trTable.item(tempRow, 0).setBackground( (QtGui.QColor(dR[0], dR[1], dR[2]))) self.trTable.setRowCount(self.trTable.rowCount() + 1) tempRow = self.trTable.rowCount() - 1 self.trTable.setItem( tempRow, 0, QtWidgets.QTableWidgetItem(wordTr[i][2])) self.trTable.setItem( tempRow, 1, QtWidgets.QTableWidgetItem(wordTr[i][3])) self.trTable.item(tempRow, 0).setBackground( (QtGui.QColor(lR[0], lR[1], lR[2]))) self.trTable.item(tempRow, 1).setBackground( (QtGui.QColor(lR[0], lR[1], lR[2]))) elif wordTr[i][1] == wordTr[i - 1][1]: self.trTable.setRowCount(self.trTable.rowCount() + 1) tempRow = self.trTable.rowCount() - 1 self.trTable.setItem( tempRow, 0, QtWidgets.QTableWidgetItem(wordTr[i][2])) self.trTable.setItem( tempRow, 1, QtWidgets.QTableWidgetItem(wordTr[i][3])) self.trTable.item(tempRow, 0).setBackground( (QtGui.QColor(lR[0], lR[1], lR[2]))) self.trTable.item(tempRow, 1).setBackground( (QtGui.QColor(lR[0], lR[1], lR[2]))) elif wordTr[i][1] != wordTr[i - 1][1]: self.trTable.setRowCount(self.trTable.rowCount() + 1) tempRow = self.trTable.rowCount() - 1 self.trTable.setSpan(tempRow, 0, 1, 2) self.trTable.setItem( tempRow, 0, QtWidgets.QTableWidgetItem(wordTr[i][1])) self.trTable.item(tempRow, 0).setBackground( (QtGui.QColor(dR[0], dR[1], dR[2]))) self.trTable.setRowCount(self.trTable.rowCount() + 1) tempRow = self.trTable.rowCount() - 1 self.trTable.setItem( tempRow, 0, QtWidgets.QTableWidgetItem(wordTr[i][2])) self.trTable.setItem( tempRow, 1, QtWidgets.QTableWidgetItem(wordTr[i][3])) self.trTable.item(tempRow, 0).setBackground( (QtGui.QColor(lR[0], lR[1], lR[2]))) self.trTable.item(tempRow, 1).setBackground( (QtGui.QColor(lR[0], lR[1], lR[2]))) self.trTable.cellDoubleClicked.connect(self.reTranslateTreng) ######################################################### ################ CAMBRIDGE WORKSPACE #################### ######################################################### if self.cmLayout.count() > 0: self.cmTable.setColumnCount(1) self.cmTable.setRowCount(0) else: self.cmTable = QtWidgets.QTableWidget(self.cmFrame) self.cmTable.setObjectName("cmTable") self.cmLayout.addWidget(self.cmTable) self.cmTable.setColumnCount(1) self.cmTable.setRowCount(0) self.cmTable.setSelectionMode(0) self.cmTable.setFocusPolicy(0) self.cmTable.setEditTriggers(QtWidgets.QTableWidget.NoEditTriggers) self.cmTable.verticalHeader().setVisible(False) self.cmTable.horizontalHeader().setVisible(False) self.cmTable.horizontalHeader().setStretchLastSection(True) try: self.cmTable.cellDoubleClicked.disconnect() except: pass if wordCm == False: #check result is suggestions suggestions = cambridge.getSuggestions(unknown) for word in suggestions: newRow = self.cmTable.rowCount() + 1 currentRow = newRow - 1 self.cmTable.setRowCount(newRow) self.cmTable.setItem(currentRow, 0, QtWidgets.QTableWidgetItem(word)) self.cmTable.item(currentRow, 0).setBackground( (QtGui.QColor(dR[0], dR[1], dR[2]))) self.cmTable.cellDoubleClicked.connect(self.reTranslateCamb) else: # write meanings to table for sentence in wordCm.keys(): newRow = self.cmTable.rowCount() + 1 currentRow = newRow - 1 self.cmTable.setRowCount(newRow) # alternative word wrapper with changing row height if len(sentence) > 38: rowHeight = ((len(sentence) // 38) + 1) * 24 self.cmTable.setRowHeight(currentRow, rowHeight) self.cmTable.setItem(currentRow, 0, QtWidgets.QTableWidgetItem(sentence)) self.cmTable.item(currentRow, 0).setBackground( (QtGui.QColor(dR[0], dR[1], dR[2]))) # write examples to table for example in wordCm[sentence]: newRow = self.cmTable.rowCount() + 1 currentRow = newRow - 1 self.cmTable.setRowCount(newRow) ## alternative word wrapper with changing row height if len(example) > 38: rowHeight = ((len(example) // 38) + 1) * 24 self.cmTable.setRowHeight(currentRow, rowHeight) self.cmTable.setItem(currentRow, 0, QtWidgets.QTableWidgetItem(example)) self.cmTable.item(currentRow, 0).setBackground( (QtGui.QColor(lR[0], lR[1], lR[2])))
def __init__(self, parent=None): """ Constructor @param parent reference to the parent widget (QWidget) - here it is EditorWindow class """ self.editorWindow = parent self.playerMainWidget = None QsciScintilla.__init__(self, parent) # # self.setFolding(5) self.setFolding(QsciScintilla.BoxedTreeFoldStyle) # self.setMarginSensitivity(3,True) lexer = QsciLexerPython() dbgMsg(lexer.keywords(1), "\n\n\n\n") syntaxErrorLexer = SyntaxErrorLexer(self) self.setLexer(syntaxErrorLexer) self.setReadOnly(True) # self.setReadOnly(False) self.setCaretLineVisible(True) # font=self.font() font = QFont("Courier New", 10) if sys.platform.startswith('da'): font = QFont("Courier New", 12) # font.setFixedPitch(True) self.setFont(font) self.setCaretLineBackgroundColor( QtGui.QColor('#E0E0F8')) # current line has this color self.setSelectionBackgroundColor( QtGui.QColor('#E0E0F8') ) # any selection in the current line due to double click has the same color too # connecting SCN_DOUBLECLICK(int,int,int) to editor double-click # notice QsciScintilla.SCN_DOUBLECLICK(int,int,int) is not the right name # self.connect(self, SIGNAL("SCN_DOUBLECLICK(int,int,int)"), self.onDoubleClick) GETFOLDLEVEL = QsciScintilla.SCI_GETFOLDLEVEL SETFOLDLEVEL = QsciScintilla.SCI_SETFOLDLEVEL HEADERFLAG = QsciScintilla.SC_FOLDLEVELHEADERFLAG LEVELBASE = QsciScintilla.SC_FOLDLEVELBASE NUMBERMASK = QsciScintilla.SC_FOLDLEVELNUMBERMASK WHITEFLAG = QsciScintilla.SC_FOLDLEVELWHITEFLAG headerLevel = LEVELBASE | HEADERFLAG lineStart = 1 lineEnd = 3 # self.SendScintilla(QsciScintilla.SCI_SETCARETSTYLE, QsciScintilla.CARETSTYLE_INVISIBLE) # make caret invisible self.lineNumberExtractRegex = re.compile( '^[\s\S]*[L|l]ine:[\s]*([0-9]*)') self.colNumberExtractRegex = re.compile( '^[\s\S]*[C|c]ol:[\s]*([0-9]*)') self.fileNameExtractRegex = re.compile('^[\s]*File:[\s]*([\S][\s\S]*)') # self.zoomRange=self.editorWindow.configuration.setting("ZoomRangeFindDisplayWidget") # self.zoomTo(self.zoomRange) dbgMsg("marginSensitivity=", self.marginSensitivity(0)) self.cc3dSender = CC3DSender.CC3DSender(self)
w = QtWidgets.QMessageBox() w.setText("Message Sent Successfully!") w.setStandardButtons(QtWidgets.QMessageBox.Ok) w.exec() except: w = QtWidgets.QMessageBox() w.setText("It seems your mobile number is DND subscribed! Sorry!") w.setStandardButtons(QtWidgets.QMessageBox.Ok) w.exec() finally: self.number.setText("") if __name__ == '__main__': import sys app = QtWidgets.QApplication(sys.argv) Dialog = QtWidgets.QDialog() ui = Ui_PyCricket() ui.selectedmatch = "" ui.totalaffected = "" ui.finalscorecard = "" p = QtGui.QPalette() gradient = QtGui.QLinearGradient(0, 0, 0, 400) gradient.setColorAt(0.0, QtGui.QColor(240, 240, 240)) gradient.setColorAt(1.0, QtGui.QColor(240, 160, 160)) p.setBrush(QtGui.QPalette.Window, QtGui.QBrush(gradient)) Dialog.setPalette(p) ui.setupUi(Dialog) Dialog.show() sys.exit(app.exec_())
def paintEvent(self, event): if self.histdata is None: return p = QtGui.QPainter() p.begin(self) p.setBackground(QtGui.QColor(16, 16, 16)) p.eraseRect(0, 0, self.width(), self.height()) p.setPen(Qt.darkGray) for i, j in enumerate(self.histdata): p.drawLine(i, 127, i, 127 - old_div(j * 126, self.norm)) if self.histdata is None: return p = QtGui.QPainter() p.begin(self) p.setBackground(QtGui.QColor(16, 16, 16)) p.eraseRect(0, 0, self.width(), self.height()) p.setPen(Qt.darkGray) for i, j in enumerate(self.histdata): p.drawLine(i, 127, i, 127 - old_div(j * 126, self.norm)) # If the user has dragged, we need to show a value if (self.probe) and (self.volume == False): p.setPen(Qt.blue) p.drawLine(self.probe[0] + 1, 0, self.probe[0] + 1, 127 - old_div(self.probe[1] * 126, self.norm)) p.setPen(Qt.red) p.drawLine(self.probe[0] + 1, 127, self.probe[0] + 1, 127 - old_div(self.probe[1] * 126, self.norm)) p.setFont(self.font) #p.drawText(200,20,"x=%d"%(self.probe[0])) #p.drawText(200,36,"%1.2f"%self.threshold) #p.drawText(200,52,"y=%d"%(self.probe[1])) #p.drawText(200,68,"%1.2f%%"%(100.0*float(self.probe[1])/self.total)) p.drawText(150, 20, "thres=%1.2f" % self.threshold) p.drawText( 150, 36, "p(t)=%1.2f%%" % (100.0 * float(self.probe[1]) / self.total)) if (self.upposition != 0) and (self.volume): #self.uppresent=0 #self.upposition=[[185,121],[185,18],[255,18]] p.setPen(QtGui.QColor(0, 0, 0)) p.setBrush(QtGui.QBrush(Qt.SolidPattern)) p.setBrush( QtGui.QColor(self.upcolor[0][0], self.upcolor[0][1], self.upcolor[0][2])) p.drawRect(self.upposition[0][0] - 2.5, self.upposition[0][1] - 2.5, 5, 5) p.setBrush(QtGui.QBrush(Qt.NoBrush)) p.setPen(QtGui.QColor(0, 0, 0)) p.setBrush(QtGui.QBrush(Qt.SolidPattern)) p.setBrush( QtGui.QColor(self.upcolor[1][0], self.upcolor[1][1], self.upcolor[1][2])) p.drawRect(self.upposition[1][0] - 2.5, self.upposition[1][1] - 2.5, 5, 5) p.setBrush(QtGui.QBrush(Qt.NoBrush)) p.setPen(QtGui.QColor(0, 0, 0)) p.setBrush(QtGui.QBrush(Qt.SolidPattern)) p.setBrush( QtGui.QColor(self.upcolor[2][0], self.upcolor[2][1], self.upcolor[2][2])) p.drawRect(self.upposition[2][0] - 2.5, self.upposition[2][1] - 2.5, 5, 5) p.setBrush(QtGui.QBrush(Qt.NoBrush)) p.setPen(Qt.yellow) presentx = self.upposition[self.uppresent][0] presenty = self.upposition[self.uppresent][1] self.uppositioned = sorted(self.upposition) p.drawLine(self.uppositioned[0][0], self.uppositioned[0][1], self.uppositioned[1][0], self.uppositioned[1][1]) p.drawLine(self.uppositioned[1][0], self.uppositioned[1][1], self.uppositioned[2][0], self.uppositioned[2][1]) self.upcolorpreserve = copy.deepcopy(self.upcolor) for i in range(3): if (self.uppositioned[i][0] == presentx) and (self.uppositioned[i][1] == presenty): self.uppresent = i for i in range(3): if self.upposition[0] == self.uppositioned[i]: self.upcolor[0] = self.upcolorpreserve[i] for i in range(3): if self.upposition[1] == self.uppositioned[i]: self.upcolor[1] = self.upcolorpreserve[i] for i in range(3): if self.upposition[2] == self.uppositioned[i]: self.upcolor[2] = self.upcolorpreserve[i] self.upposition.sort() presentthreshold = (self.upposition[self.uppresent][0] - 3) / 252.0 * (self.maxden - self.minden) + self.minden self.guiparent.level.setText("Level: %1.3f" % presentthreshold) #self.guiparent.cappingcolor.setRgb(self.upcolor[self.uppresent]) #p.setPen(QtGui.QColor(self.upcolor[1][0],self.upcolor[1][1],self.upcolor[1][2])) #p.setPen(QtGui.QColor(self.upcolor[2][0],self.upcolor[2][1],self.upcolor[2][2])) p.setPen(Qt.black) p.drawRect(0, 0, 258, 128) p.end()
def drawInfo(self, event, qp): qp.setPen(QtGui.QColor(10, 10, 10)) qp.setFont(QtGui.QFont("Decorative", 15)) qp.drawText(event.rect(), QtCore.Qt.AlignCenter, self.text)
def chooseColor(self): color = self.colorHexLine.text() color = QtWidgets.QColorDialog.getColor(QtGui.QColor(color), self) if not color.isValid(): return self.colorHexLine.setText(color.name())