pyqt5

How can I set Custom Key board Key press event in Qtablewidget Python?

霸气de小男生 提交于 2020-11-29 19:16:14
问题 I have a QTableWidget generated by QTDesigner in which I want to set some custom key press events. when current cell is in edit mode and if user presses Tab key, it moves to next cell in edit mode but i just want it move to next cell selected and not in edit mode. when current cell is in edit mode and if user presses Left, right, up, down- it should move to corresponding cell in select mode again and not in edit mode. both of this works well right now if current cell is just selected and not

How can I set Custom Key board Key press event in Qtablewidget Python?

风格不统一 提交于 2020-11-29 19:15:42
问题 I have a QTableWidget generated by QTDesigner in which I want to set some custom key press events. when current cell is in edit mode and if user presses Tab key, it moves to next cell in edit mode but i just want it move to next cell selected and not in edit mode. when current cell is in edit mode and if user presses Left, right, up, down- it should move to corresponding cell in select mode again and not in edit mode. both of this works well right now if current cell is just selected and not

How can I set Custom Key board Key press event in Qtablewidget Python?

試著忘記壹切 提交于 2020-11-29 19:15:22
问题 I have a QTableWidget generated by QTDesigner in which I want to set some custom key press events. when current cell is in edit mode and if user presses Tab key, it moves to next cell in edit mode but i just want it move to next cell selected and not in edit mode. when current cell is in edit mode and if user presses Left, right, up, down- it should move to corresponding cell in select mode again and not in edit mode. both of this works well right now if current cell is just selected and not

How to play videos in pyqt

筅森魡賤 提交于 2020-11-29 03:44:18
问题 I want to play video files depending the select file in this function: def abrir(): QFileDialog.getOpenFileName(None, ("Selecciona los medios"), os.getcwd(), ("Video Files (*.avi *.mp4 *.flv)")) My Question is what opcion i have to use or what module to play video files in pyqt EDIT: To play the code of S. Nick I hace to install K lite code 回答1: Try it: from PyQt5.QtGui import QIcon, QFont from PyQt5.QtCore import QDir, Qt, QUrl, QSize from PyQt5.QtMultimedia import QMediaContent,

AttributeError: QDialog object has no attribute setCentralWidget

最后都变了- 提交于 2020-11-28 09:01:12
问题 I'm trying to create a GUI with QT Designer. I've converted my .ui designer file to a .py file using the following tutorial: http://pyqt.sourceforge.net/Docs/PyQt5/designer.html. I have the following code: # # Created by: PyQt5 UI code generator 5.7 # # WARNING! All changes made in this file will be lost! import sys from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtWidgets import QApplication, QDialog class Ui_ImageDialog(object): def setupUi(self, MainWindow): MainWindow.setObjectName(

AttributeError: QDialog object has no attribute setCentralWidget

假如想象 提交于 2020-11-28 08:57:29
问题 I'm trying to create a GUI with QT Designer. I've converted my .ui designer file to a .py file using the following tutorial: http://pyqt.sourceforge.net/Docs/PyQt5/designer.html. I have the following code: # # Created by: PyQt5 UI code generator 5.7 # # WARNING! All changes made in this file will be lost! import sys from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtWidgets import QApplication, QDialog class Ui_ImageDialog(object): def setupUi(self, MainWindow): MainWindow.setObjectName(

AttributeError: QDialog object has no attribute setCentralWidget

ε祈祈猫儿з 提交于 2020-11-28 08:57:06
问题 I'm trying to create a GUI with QT Designer. I've converted my .ui designer file to a .py file using the following tutorial: http://pyqt.sourceforge.net/Docs/PyQt5/designer.html. I have the following code: # # Created by: PyQt5 UI code generator 5.7 # # WARNING! All changes made in this file will be lost! import sys from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtWidgets import QApplication, QDialog class Ui_ImageDialog(object): def setupUi(self, MainWindow): MainWindow.setObjectName(

How to create toggle switch button in qt designer?

白昼怎懂夜的黑 提交于 2020-11-28 02:20:44
问题 I am trying to create toggle button in qt designer. I refer on internet also but i couldn't find how to do that. Can anyone know how to do toggle switch button. I have attached a sample button image. EDIT I created a text box below that i want this toggle button. When i try to add it throws me error. How to add the button below the text area? i have attached the code snippet also. from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtCore import QPropertyAnimation, QRectF, QSize, Qt,

How to create toggle switch button in qt designer?

谁都会走 提交于 2020-11-28 02:10:59
问题 I am trying to create toggle button in qt designer. I refer on internet also but i couldn't find how to do that. Can anyone know how to do toggle switch button. I have attached a sample button image. EDIT I created a text box below that i want this toggle button. When i try to add it throws me error. How to add the button below the text area? i have attached the code snippet also. from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtCore import QPropertyAnimation, QRectF, QSize, Qt,

Creating PyQt5 buttons in a loop: all buttons trigger the same callback

丶灬走出姿态 提交于 2020-11-27 04:04:37
问题 I should mention that I've read these but I'm still unable to achieve my goal: [Using a dictionary in a for loop to create buttons doesn't work [QtCore.QObject.connect in a loop only affects the last instance My goal is to make a linux 'launcher' application. Button creation, placement, etc. is working like a charm but there's one problem - all buttons trigger the same callback - the last one to be connected in the button creation loop. Here's a basic version of the script to illustrate what