Questions tagged [pyqt]

1

votes
2

answer
43

Views

Embedding second animated graph to PyQt5 GUI

I want to add a second animated graph to the GUI holding my first animated graph with both graphs animating at the same time, but I'm not sure how. Here is my code : import sys import numpy as np from matplotlib.backends.qt_compat import QtWidgets from matplotlib.backends.backend_qt5agg import ( Fig...
Edgar Nash
0

votes
1

answer
14

Views

Completely stop running pyqt5 application

I want my pyqt app stop whenever I press 'cancel' button. For instance this app should be looping features from two tables. I can set a trigger that will always will check it's condition (true/false) depending on pressing the 'cancel' button. But is there any way to set the global trigger which wil...
0

votes
0

answer
12

Views

Move QLabel in absolute position with mouse move

I'm new to qt (pyqt). I want to move the QLabel with the mouse movement (not like Drag&drop, 'object' disappears while moving). Clicked - moved - released. I did it to some extent, but I ran into a problem. QLabel shrinks as I move it or even dissapers (like shrinks to 0 width). How to fix it or wha...
1

votes
1

answer
30

Views

What is Dummy in threading.current_thread()?

I am trying to understand the code in this How to use QThread correctly in pyqt with moveToThread()? The portion that has: mainwin.__init__ : MainThread, 140221684574016, GenericWorker.__init__ : MainThread, 140221684574016, GenericWorker.run : Dummy-1, 140221265458944, mainwin.add...
Man Wa kileleshwa
1

votes
1

answer
107

Views

Overriding virtual protected slot of QListView at runtime

I am using PyQt 5.9.1, and I want to connect QListView.currentChanged to a function at runtime. But for some reason, I can do it only before calling setModel(). If I call setModel() (even with a None argument) beforehand, then my currentChanged function is never called. # https://www.pythoncentral.i...
Winand
1

votes
0

answer
226

Views

Parent Qt to non-qt window with PyQt

I am trying to parent a QMainWindow to a non-qt application (the application may change). Any ideas on how to do this? The qt window opens fine and i can interact with the python API in the applications however the qt window goes behind the application window if i click on the application. I could u...
Mafster
1

votes
1

answer
29

Views

add Line_Edit while program is running

I am using Pyqt5 and Qt Designer to build GUIs. i want to know if there is any way to make a Gui that it can build a new line edit with a push button while running by clicking on another push button (add button for example) a picture of what i mean new line
Ahmad
1

votes
0

answer
2.9k

Views

Python - How do I get my GUI to display in Spyder

I'm new to creating GUI's in Python and can't seem to get over the first hurdle. I'm using Anaconda - Spyder and I normally run all (mainly mathematical) code through this (and the IPython console?). My issue is that when I run the code below I'm expecting it to display a simple blank window but not...
Steven Goddard
1

votes
0

answer
442

Views

Integrating a PyQt3D window into a QMainWindow

We can use QWidget.createWindowContainer to add a 3D view into a QMainWindow (a window with menus, status bar, etc). However, I found that this approach does not work, the windows opens up but fails to render the 3D contents. It also displays the error QOpenGLContext::swapBuffers() called with non-e...
Overdrivr
1

votes
1

answer
154

Views

How to select an item in a QComboBox using the Tab key?

I have a shiny QComboBox that has three (3) items to select. Here's the code to create the ComboBox: class TabComboBox(QComboBox): def __init__(self, parent=None): super().__init__(parent) # Populate combobox self.addItems(['Dog', 'Cat', 'Bird']) Here's the screenshot of the ComboBox I want to confi...
Jero Bado
1

votes
1

answer
2.7k

Views

How to install PyQt4 with Python 3.6.4 (Error: Make sure you have a working Qt qmake on your PATH. )

I am having real trouble with installing PyQt4 package. I have read many documentations about this but still have not figured it out. So my first question is when I download the PyQt4 zip fail, where I have to extract it? I have tried to extract it to the \Lib\site-packages and then from there run...
Sstenn
1

votes
0

answer
85

Views

How to get movable graphical items inside a QGraphicsItemGroup?

My goal is to write a software that displays two movable disks that live inside the same QGraphicsItemGroup. I'd like to use QGraphicsItemGroup because in this way each disk can access the position of the other. To make the objects movable, I use the flag ItemIsMovable which unfortunately doesn't se...
Llewlyn
1

votes
0

answer
155

Views

'Windows Explorer file right click menu' in a PyQt application

I have a pyqt application that opens some data files. The files are displayed in a list. I want to add windows explorer right click context menu for the opened file. Something like this. I don't want to add anything in the windows explorer right click context menu. The actions listed in menu should...
inxp
1

votes
0

answer
103

Views

pyqt5 qsettings cannot restore a geometry if the name like“maindow/gemotry”

this question from 《Rapid GUI Programming with Python and Qt》.of course it's about pyqt4 and python2. I'm trying to rebuild by pyqt5 and python3 in the chapter 06,something like this seems run error: class Window(QMainWindow): def __init__(self, parent=None): super(Window, self).__init__(parent...
Chenglong Zhang
1

votes
1

answer
40

Views

TypeError: javaScriptConfirm() takes exactly 1 argument (3 given) python

self.browser = QWebView() self.page = MyWebPage() self.browser.setPage(self.page) the MyWebPage() class is: class MyWebPage(QWebPage): def javaScriptAlert(self): pass def javaScriptConfirm(self): pass def javaScriptConsoleMessage(self): pass def javaScriptPrompt(self): pass then I get the type error...
Sam Moldenha
1

votes
0

answer
88

Views

QGraphicsPixmapItem.setScale set pixel boundaries at inconsistant positions

I want to zoom on an image using QGraphicsPixmapItem.setScale. However the scaling starts being very shaky at high magnification levels, i.e. when only a few pixels fill the window. I observe the same phenomenon in PyQt 4.8.7 and 5.6.0, on Windows 10 as well as Ubuntu 16.10. EDIT: tested on the more...
P-Gn
1

votes
0

answer
148

Views

QTextEdit and QPrintPreview works slowly with large HTML table

I'm trying to create reports like MS Access, and thanks to QTextEdit example everything works very nicely. But when I open a large HTML table (about 5000 rows), it takes about 35 seconds to load the table - so it's very slow. How can I optimise the print-preview? Maybe load only one page and change...
pythoff
1

votes
1

answer
366

Views

How to set equal scale for axes in pyqtgraph plot?

In docs of AxisItem I found phrase 'By default, the axis scaling is 1.0'. But when executing simplest program with line plotWidget = pg.plot() scales for x and y are different. How to adjust them?
DSblizzard
1

votes
0

answer
84

Views

Add global hotkey to toogle the display of GUI for PyQt5

I created a program with PyQt5. By default the GUI is hidden in system tray. I can right click the icon in the system try to open the GUI. I am wondering if I can set a global hotkey so I can toggle the main GUI shown and hidden. It will save me a few mouse click. Thanks.
user890207
1

votes
0

answer
68

Views

Why does QTranslator (PyQt5) refuse to work after Update to 5.10?

I have a GUI that makes use of PyQt5 standard dialogs and the following script kept translating the buttons. This worked fine until the update from 5.9.2 to 5.10 was released. Suddenly, the translator stopped doing its job without any changes in the script. app = QApplication(sys.argv) translator =...
alex_555
1

votes
0

answer
120

Views

cx_Freeze cannot find libicuuc.so.56 and libQt5EglFSDeviceIntegration.so.5

I'm trying to freeze and package a PyQt5 app on Ubuntu 16.04.02 into an exe file, but cx_Freeze reports that it can't find libicuuc.so.56, libicudata.so.56 and libQt5EglFSDeviceIntegration.so.5. When I search for the icu files on my system, I find that version 55 is currently installed. $ apt-cache...
trinkner
1

votes
0

answer
112

Views

pyqtgraph's exporter shifts plot components

I have a sample code that produces a standard scatterplot with pairs of X & Y. For the project I'm working on, we cannot use matplotlib, but stick to pyqtgraph instead (it is part of a PyQt project). from PyQt4 import QtGui import pyqtgraph as pg import pyqtgraph.exporters import numpy as np x = np...
offeltoffel
1

votes
0

answer
127

Views

Window Icon Not Displaying when Frozen with cx_Freeze

I’m using Python 3.6, PyQt5, and cx_Freeze in a Windows environment. The portion of code I use to display the icon on the main window and children windows is: if getattr(sys, 'frozen', False): # If frozen with cx_Freeze homePath = os.path.dirname(sys.executable) else: # Otherwise, if running unfr...
slalomchip
1

votes
1

answer
93

Views

PyQt4 Application takes time on startup for the very fist time

I have developed an application using Python 2.7 and PyQt4. Usually when I start my application it start within a second, but when I do start/restart my computer an than I start application for the very first time, It takes countable amount of time. I did following module import to my application....
Binit Amin
1

votes
0

answer
292

Views

Pyqt5 QAbstractTableModel dataChanged not updating data

I am trying to update my QTableView after I receive a notice via pydispatcher of a change in the system. I did create the following functions def rowCount(self, parent=None): return len(self.m_list) def columnCount(self, parent=None): return len(self.table_def) def headerData(self, col, orientation,...
PBareil
1

votes
1

answer
76

Views

How fix empty border line after spanning cells in table?

I am working about python script and I use PyQt4. When I try spanning with function setSpan(row, col, rowSpanWidth, colSpanWidth) and apply on cell with 'author'. I am getting this result, borderline cleared and I do not know why. Spanning works fine on cells inside table or another (right) side/edg...
Dave
1

votes
1

answer
27

Views

pyqt thread seperating makes the program crash

I'm testing some gui interactions between threads to apply it to my program, but the program just suddenly crashes if I try it. from PyQt4.QtCore import * from PyQt4.QtGui import * class Window(QWidget): def __init__(self): super().__init__() qv = QVBoxLayout() self.board = QLabel(self) self.board.s...
Riddle Aaron
1

votes
0

answer
529

Views

Pyqt5 QWebEngineView and QWebEnginePage

Can Someone please explain the usage of QWebEngineView and QWebEnginePage in PyQt5. I want to intercept all the requests and thereby override the acceptNavigationRequest() method belonging to the QWebEnginePage class. But I am not using any QWebEnginePage object but directly implementing the QWebEn...
Praneet Mehta
1

votes
0

answer
290

Views

load qml in pyqt fron resource file

I am having a doubt about pyQt resource system. I am using multiple qml files in my application hence i created a resource file of qml files named qml.qrc BasicStatistics.qml CentralView.qml CheckBoxStyle.qml DataSummary.qml DataSummaryInfoPopup.qml DropDownItem.qml FileBrowser.qml Filters.qml GE_B...
Neethu
1

votes
0

answer
347

Views

Install labelme annotation tools

I tried to install labelme annotation tools on Mac os 10.11.x from this link labelme using the virtual environment method listed below: # python3 conda create --name=labelme python=3.6 source activate labelme # conda install pyqt pip3 install pyqt5 # pyqt5 can be installed via pip on python3 pip3 in...
BetterEnglish
1

votes
1

answer
102

Views

PyQt4 - how to add scrollbar into tabbed windows of fixed size?

Simplest case: How do you add a scrollbar to a tabbed GUI window of fixed size? Full case: I'm working with a GUI with non-scaleable objects (scenes) in each tabbed frame, and would like the user to still be able to drag-scale the window down on itself (whereby the objects in the scene don't scale,...
ees
1

votes
1

answer
177

Views

Generating pyqtProperty methods

I have the following code: class Channel(QObject): nameChanged = pyqtSignal() def __init__(self, props, *args, **kwargs): super().__init__(*args, **kwargs) self._name = props['name'] @pyqtProperty('QString', notify=nameChanged) def name(self): return self._name @name.setter def name(self, name): sel...
alexandernst
1

votes
1

answer
128

Views

QGraphicesItem emit a signal upon hoverEnterEvent

What is the best method/practice for emitting a signal upon entering either a QGraphicsWidget or a QGraphicsItem ? In my MWE I would like to trigger a call to MainWindow.update, from Square.hoverEnterEvent, whenever the user mouse(s) over an item in a QGraphicsScene. The trouble is that QGraphicsIte...
Carel
1

votes
1

answer
234

Views

Maya API/ PySide2 , wrong argument in wrapInstance

Trying to learn some PySide2 for Maya, but there is no clear documentation for PySide2 yet, so after searching in internet coming here again for help... I will go straight to the problem - from PySide2 import QtWidgets, QtGui import maya.cmds as cmds import maya.OpenMayaUI as mui import shiboken2 d...
Vladlen Afanasjev
1

votes
1

answer
105

Views

PyQt5 Text Color in Dictionary Iteration

I've searched for a while now and can't seem to find a good answer to the question of how best to handle font colors in PyQt5. What I've found are large stylesheets with many, many options. It seems unwieldy, but maybe that's just QT. Say I have some code like this: for k, v in do_something.items():...
SomeClown
1

votes
2

answer
120

Views

PyQt progress jumps to 100% after it starts

When I run the code in the in the doWork method, by clicking the button1, the progress bar works as expected. However, when I pass the list to the doWork method from other methods (i.e. btn2, btn3), the progress bar just jumps to 100% after it starts. from PyQt5 import QtCore, QtGui, QtWidgets from...
Joe T. Boka
1

votes
1

answer
204

Views

PyQt: How to move widgets inside QStackedWidget object?

I've created window with button named 'First', the window shows me next button named 'Second' after clicking on the button 'First', but button 'Second' isn't moved by: self.b2.move(50,50) Whats the problem? import sys from PyQt5 import QtWidgets class Window(QtWidgets.QMainWindow): def __init__(sel...
Artem Getmanskiy
1

votes
0

answer
373

Views

Imshow in pyQt is not centered

I write a code to put an imshow in a pyqt environment but the imshow is not centered in the figure: from PyQt5.QtGui import * from PyQt5.QtCore import * from PyQt5.QtWidgets import * import numpy as np import sys import matplotlib.pyplot as plt from matplotlib.backends.backend_qt5agg import FigureCa...
ymmx
1

votes
1

answer
107

Views

Qt5 - QWebEngine CORS for own uri type

So, the basic gist is, I have javascript resources like https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js that I use in the QWebEngine. The intention is, that the program also works offline, so I made a QWebEngineUrlRequestInterceptor that changes those addresses to my own local handl...
Berserker
1

votes
0

answer
180

Views

Qt multiple views and same model with selected row

I've been working with Qt for around a year now and I still struggle the most with working with custom Models/Views. Especially tree like structures. I have a class called Account which represents website like account objects: class Account: def __init__(website, name, cookies): self.website = webs...
Wallboy

View additional questions