Questions tagged [pyqt]

1

votes
1

answer
46

Views

How to cancel font shadow in nuke pyside

I have a UI, which automatically sets font shadow in nuke, and how to cancel it. I want the font on this button to look like this, so there is no font shadow. This is my code,Thanks:) # -*- coding:utf-8 -*- from PySide import QtGui class MyButton(QtGui.QDialog): def __init__(self,parent=None): super...
liaokong
1

votes
1

answer
57

Views

QDateEdit - paint cell of calendarPopup

I create custom form and user interface components with Qt Designer and use Qt's integrated build tool uic, to generate code for them when the application is built. The generated code contains the form's user interface object. I have QDockWidget with QDateEdit, I want to paint cells of some date: I...
ncica
1

votes
1

answer
26

Views

Update QpushButton icon from an numpy array don't work

I'm trying to make an icon from a numpy array displayed with matplotlib imshow. I succeed in getting colors from matplotlib into a numpy array of dimension (n*n*4) I then convert this numpy array to an Qimage then into a Qpixmap in order to update the Icon of a Qpushbutton. However the icon of the b...
ymmx
1

votes
1

answer
87

Views

What is the difference between an opencv BGR image and its reverse version RGB image[:,:,::-1]?

I'm trying to show an opencv image with a QLabel. I got two different versions of the image, first one is the opencv BGR image, the second one is the RGB image using image[:,:,::-1], the BGR version works fine but the RGB version doesn't work. The following code works fine src = cv.imread('image.jpg...
Yifeng_Li
1

votes
2

answer
46

Views

PyQt - Easily add a QWidget to all Views

I have the following class MyView(QWidget): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) layout = QVBoxLayout() layout.addWidget(QLabel('Hello World')) self.setLayout(layout) class NavigationMenu(QWidget): pass # Renders a bar of full width and 15 px height What is the eas...
Andrei Cioara
1

votes
2

answer
31

Views

Listen for new signal connections on a pyqtBoundSignal

I have a PyQt5 application that has optional functionality (let's say a button) that only shows up when the application is explicitly told 'Turn on this option.' When this button is invoked, the application works some computation and then emits a signal with the result. Instead of having to explicit...
Zanilen
0

votes
0

answer
10

Views

separate functions from gui into process. lagging

first i created the functional parts of my code and later decided to add a interface to it, so i have linked the interface and and the main function of the previous code as bellow. class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow): def __init__(self, parent=None): super(MainWindow, self).__ini...
Eshaka
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...
Pavel Pereverzev
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

View additional questions