Category : pyqt

I want to show a Widget (QMainWindow for example) in primary screen and second monitor. This widget will show information that is constantly updated. from PyQt5 import QtCore from PyQt5.QtWidgets import QGridLayout,QWidget, QApplication, QPushButton,QLabel,QMainWindow,QStatusBar from PyQt5.QtWidgets import QApplication, QDesktopWidget, QMainWindow import sys class ShowResaults(QMainWindow): def __init__(self): super().__init__() self.resize(600,600) display_monitor = 1 monitor = QDesktopWidget().screenGeometry(display_monitor) self.move(monitor.left(), ..

Read more

I would like to add a title to my two QListWidgets in python and pyqt5. I have tried using a QGroupBox in various permutations, but wasn’t able to have it display the way I wanted it with the layout configuration. self.emailListGroupBox = QGroupBox(self.centralwidget) self.emailListGroupBox.setGeometry(QtCore.QRect(15,60,350,120)) self.emailListGroupBox.setObjectName("EmailNotificationSettings") self.emailListGroupBox.setTitle(f"{self.event_name} Email Notification Settings") self.emailListGroupBox.setStyleSheet(‘QGroupBox:title {‘ ‘subcontrol-origin: margin;’ ‘subcontrol-position: top ..

Read more

Iam trying to open ftp url in file explorer. url = QUrl("ftp://192.168.1.127:15010/intrusionfiles/detectionfiles/",QUrl.TolerantMode); url.setScheme("ftp"); QDesktopServices.openUrl(url) When I try it this way it asks how I want it to open. How do I get it to open directly in file explorer? Source: Python..

Read more

I am adding a QCheckBox item to one of the cells in my QTableWidget using the following: cell_widget = QWidget() chk_bx = QCheckBox() chk_bx.setCheckState(QtCore.Qt.Unchecked) lay_out = QHBoxLayout(cell_widget) lay_out.addWidget(chk_bx) lay_out.setAlignment(QtCore.Qt.AlignCenter) lay_out.setContentsMargins(0,0,0,0) cell_widget.setLayout(lay_out) self.definedEventsTable.setCellWidget(row, select_column, cell_widget) The variable definedEventsTable is a QTableWidget. The above code works fine and the checkbox is correctly displayed on the GUI and ..

Read more

I’ve got an issue with QPushButtons dimensions only changing horizontally and not vertically. I know this questions been asked before, and the typical routes are to either use QPushButton.setFixedSize or QPushButton.setSizePolicy(… , QtWidgets.QSizePolicy.Expanding) But nothing I can do will adjust the vertical height, despite being able to control the horizontal size. I understand that QLayout ..

Read more