pyqt5

QTreeView with QFileSystemModel is not working properly

…衆ロ難τιáo~ 提交于 2021-01-28 05:08:27
问题 I set QFileSystemModel root path and then set it as QTreeView model, but if I try to find index of a speciffic file it is giving me D: I am sure the file is there ! self.model = QtWidgets.QFileSystemModel() self.model.setNameFilters(['*.ma']) self.model.setFilter(QtCore.QDir.Files)#QtCore.QDir.AllDirs | QtCore.QDir.NoDotAndDotDot | QtCore.QDir.AllEntries) self.model.setNameFilterDisables(False) self.model.setRootPath(path) self.tree_local_file.setModel(self.model) self.tree_local_file

pyqtgraph ImageView Freezes when multithreaded

为君一笑 提交于 2021-01-28 04:09:45
问题 I have multiple cameras that are hooked up wirelessly via wifi and I'm trying to stream the data to a client, which displays the streams on a GUI. My issue is that the pyqtgraph ImageItems seem to stop repainting after about 30 seconds, or if I click out of the window, or if I adjust the controls on one of the images. After that, I can manage to get the images to repaint by resizing the window, but that's kind of tedious. I thought maybe pyqtgraph wasn't threadsafe, but I don't even know if I

PyQt5 Event Filter Object Detection

杀马特。学长 韩版系。学妹 提交于 2021-01-28 03:44:52
问题 I want to report the mouse position whenever I click on a point within a QGraphicsView widget. class App(QMainWindow, Ui_MainWindow): def __init__(self, parent=None): super(App, self).__init__(parent) self.setupUi(self) self.graphicsView.viewport().installEventFilter(self) self.graphicsView_2.viewport().installEventFilter(self) def eventFilter(self, a0: 'QObject', a1: 'QEvent') -> bool: if a0 == self.graphicsView: if a1.type() == QtCore.QEvent.MouseButtonPress: mousePosition = a1.pos() print

can not build qtermwidget from source

北城余情 提交于 2021-01-27 21:31:51
问题 I'm trying to build qtermwidget from source, but it gives me error. I've successfully built lxqt-build-tools and then installed pyqt5 from both pip3 and apt: sudo -H pip3 install -U pyqt5 pyqtwebengine sudo apt install python3-sip-dev python3-pyqt5 and then I ran this: mkdir -p /tmp/EAF && cd /tmp/EAF git clone https://github.com/lxqt/qtermwidget cd qtermwidget mkdir build && cd build cmake .. -DQTERMWIDGET_BUILD_PYTHON_BINDING=ON -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=/usr and it

Values of QMessageBox.Yes/QMessageBox.No

有些话、适合烂在心里 提交于 2021-01-27 21:23:20
问题 I learn PyQt5 (which looks quite complicated for me) and I am wondering why QMessageBox.Yes (or no) has some special value, for me it is 16384 . That is what I mean: from PyQt5 import QApplication, QWidget, QMessageBox class App(QWidget): def message_box(self): resp = QMessageBox.question(self, 'foo', 'bar', QMessageBox.Yes | QMessageBox.No, QMessageBox.No) print(resp) It prints 16384 (if you click Yes) or 65536 (if you click No), why not True or False? I understand that I can compare it

How to write an infinite loop for receiving UDP data?

浪尽此生 提交于 2021-01-27 21:14:52
问题 I'm trying to make an app that receives UDP data and shows the data in a list view using python (PyQt5). When I start the receiver, the app gets stuck and does not respond. How can I fix this? See code below. import sys import os import socket from PyQt5.QtGui import * from PyQt5.QtWidgets import * class udpReceiverApp(): app = QApplication (sys.argv) x = 1 ip = "192.168.1.4" port =515 server_start = True sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sock.bind((ip,port)) def __init_

How to load and parse whole content of a dynamic page that use infinity scroll

别等时光非礼了梦想. 提交于 2021-01-27 21:12:40
问题 I am trying to solve my problems making searches, reading documentations. The problem I want to get all youtube titles from an youtube channel using python beautiful soup. Youtube loads dynamically, i think with JavaScript, without pyqt5 I just can not get any title, So i used the pyqt5 I was able to get titles from youtube channel. The problem is that i need to load all the videos. I can just load the 29 ou 30 first ones. I am thinking on simulating a scroll down or somthing like that. I can

How should I connect CheckBox clicked signals in Table Widgets in PyQt5?

我的未来我决定 提交于 2021-01-27 21:08:51
问题 I would like to add various widgets to various cells in a Table Widget, and I would like to trigger commands when those widgets' values are changed. I can get the widgets into the table as desired, but I'm having problems connecting signals so that I know which widget has generated the signal. Below is a simple example explaining the problem, using just checkboxes: from PyQt5 import QtWidgets, QtGui, QtCore class Main(QtWidgets.QMainWindow): def __init__(self, parent=None): super().__init__

PyQt5 QML treeview example

让人想犯罪 __ 提交于 2021-01-27 17:54:01
问题 I try to setup a simple treeview example with PyQt5.6 (Python 3.4) and QML. I just found a few C++ examples, but nothing related to PyQt. I picked up the simpletreemodel example comming with PyQt source and modified it (https://github.com/baoboa/pyqt5/tree/master/examples/itemviews/simpletreemodel). Most likely something is wrong with the model. I got two error messages: simpletreemodel.qml:13:5: QML TreeView: Binding loop detected for property "model" ...qt/5.6/gcc_64/qml/QtQuick/Controls

PyQt5: Can't see close buttons in QTabBar

痞子三分冷 提交于 2021-01-27 12:04:37
问题 I can't see the close button on individual tabs when using PyQt5. I can close the individual tabs when I click where I know the close button should be, but can't see the button outright: #!/bin/python3 import sys from PyQt5.QtWidgets import (QApplication, QVBoxLayout, QTabBar, QFrame) class App(QFrame): def __init__(self): super().__init__() self.setWindowTitle("Web Browser") self.setBaseSize(683, 384) self.CreateApp() def CreateApp(self): self.layout = QVBoxLayout() self.tab_Bar = QTabBar