pyside2

How can I get the maximum and current value of the verticalScrollBar when displaying html with QWebEngineView

强颜欢笑 提交于 2019-12-24 11:50:01
问题 I'm attempting to create a UI in Maya (Python 2.7.11 and Maya Qt 5.6.1. and PySide2) where the OK button is grayed out until the user scrolls to the bottom. I can do this easily with QTextEdit by grabbing the value and maximum from the verticalScrollBar but I can't seem to find similar objects in QWebEngineView or QWebEnginePage. Any Ideas? 回答1: In the case you want to get some information from the DOM you have to do it with javascript, in this case we will create an object that will have the

PySide2 | Finding out which QKeySequence was pressed 2

自闭症网瘾萝莉.ら 提交于 2019-12-24 10:25:03
问题 I had a previous question about QKeySequence here. It worked but when I applied it to my code there seemed to be an error when the QKeySequence comes after line when the button click event goes before the QKeySequence line. Note: The GUI consists of only two buttons: self.btnDSR and self.btnOther. Taking from the answer of eyllanesc in the previous question, my code follows: class MainWindow(QtWidgets.QMainWindow, test_mainWindow.Ui_MainWindow): def __init__(self, parent=None): super

add feature for previous question PySide2 QListView and QTableView

99封情书 提交于 2019-12-24 10:15:12
问题 The previous question was PySide2 QListView QTableView sync problem Imagine to have another dict4 in the data structure: 'dict4':{'k8':'v8', 'EXISTING_DICT':'dict2'}, Meaning, that a dictionary could include another existing dictionary. So the representation in the QTableView shouldn't be directly showed, but: 1) Show just the name of it in the QTableView: k1 | v1 ------- k2 | v2 ------- k3 | v3 ------- dict2 2) If double click it on it: select the existing dictionary in the QListView, which

In a PySide2 app, how can I get the ID for a QWindow?

前提是你 提交于 2019-12-24 07:58:13
问题 In the version of PySide2 that ships with Maya2017, the winId method on the QWindow class seems to be missing: w.winId() Error: AttributeError: file <maya console> line 1: 'PySide2.QtGui.QWindow' object has no attribute 'winId' # Is there a way to get this value from an existing instance of QWindow? 回答1: I used Maya 2018 for macOS 10.11.6. Try this code. It works. from maya import OpenMayaUI as omui try: from PySide2.QtCore import * from PySide2.QtGui import * from PySide2.QtWidgets import *

PyCharm fails to debug Qt5 (PySide2) code - Error 'Shiboken.ObjectType' object is not iterable

邮差的信 提交于 2019-12-24 07:57:39
问题 I have some experience with Python console applications and now trying to start with Qt for Python (Qt 5.12, PySide2). Actually I'm trying some basic tutorials to understand how it should work. So, I created very simple view.qml : import QtQuick 2.0 import QtQuick.Controls 2.13 ApplicationWindow { visible: true Button { id: button text: qsTr("ClickOnMe") } Connections { target: button onClicked: con.say_hello() } } and have following python code to work with it: from PySide2.QtCore import

PySide2 v5.12 : Creating a FileDialog on a click of a button

南楼画角 提交于 2019-12-24 01:23:59
问题 I designed a basic UI in the QtDesigner. Now i am trying to pop a simple file dialog on click of a button, below given is my GUI Code : from PySide2 import QtCore, QtGui, QtWidgets class Ui_MainWindow(object): def setupUi(self, MainWindow): ..... ..... self.input_Image_GraphicsView = QtWidgets.QGraphicsView(self.centralwidget) self.input_Image_GraphicsView.setGeometry(QtCore.QRect(730, 110, 480, 320)) self.input_Image_GraphicsView.setObjectName("input_Image_GraphicsView") ...... self.output

python multiprocessing - sending child process logging to GUI running in parent

泪湿孤枕 提交于 2019-12-24 00:25:04
问题 I'm building an interface on top of some analysis code I've written that executes some SQL and processes the query results. There's logging surrounding a number of the events in this analysis code that I would like to expose to the user. Because the analysis code is rather long-running, and because I don't want the UI to block, thus far I've done this through putting the analysis function in to its own thread. Simplified example of what I have now (complete script): import sys import time

How to detect button click inside Qwebengine in pyside2

我的未来我决定 提交于 2019-12-22 08:23:12
问题 I wrote an app in pyside2, which opening a webpage in QWebEngine. That web page has 2 buttons, I am not understanding how can I detect a button click in pyside2 app module, I need to perform other operation on that button click. Example below is my code from PySide2.QtWidgets import QApplication from PySide2.QtWebEngineWidgets import QWebEngineView, QWebEnginePage from PySide2.QtCore import QUrl class WebEnginePage(QWebEnginePage): def __init__(self, *args, **kwargs): QWebEnginePage.__init__

How to detect button click inside Qwebengine in pyside2

試著忘記壹切 提交于 2019-12-22 08:22:43
问题 I wrote an app in pyside2, which opening a webpage in QWebEngine. That web page has 2 buttons, I am not understanding how can I detect a button click in pyside2 app module, I need to perform other operation on that button click. Example below is my code from PySide2.QtWidgets import QApplication from PySide2.QtWebEngineWidgets import QWebEngineView, QWebEnginePage from PySide2.QtCore import QUrl class WebEnginePage(QWebEnginePage): def __init__(self, *args, **kwargs): QWebEnginePage.__init__

How can I change all the points in an XYSeries in qml or PySide2?

一个人想着一个人 提交于 2019-12-20 04:24:26
问题 I'm kinda new to PySide2 and QML and I really need a way to replace all the points in an XYSeries at once. Since the QML item does not have a function that does so, I thought I had to create a custom class (that would inherits from QtCharts.QXYSeries), implement the function I need and then register the new type with PySide2.QtQml.qmlRegisterType, but I don't know how that should be done and I haven't been able to find an answer online (or at least one that I could understand). So, to cut a