pyside2

How to create a menu bar on OSX with PySide2?

人走茶凉 提交于 2020-04-30 08:22:49
问题 I'm looking at the Data Visualization Tool Tutorial on the QT website where they have an example of creating a menu bar inside a QMainWindow : self.menu = self.menuBar() self.file_menu = self.menu.addMenu("File") This doesn't work for me on OSX 10.13.6. I've also tried using QMenuBar to create my own menu bar rather than using the default one that comes with a QMainWindow : menu_bar = QMenuBar() menu_bar.addMenu('File') self.setMenuBar(menu_bar) This also has no effect. I never see the "File"

How to create a menu bar on OSX with PySide2?

别来无恙 提交于 2020-04-30 08:21:31
问题 I'm looking at the Data Visualization Tool Tutorial on the QT website where they have an example of creating a menu bar inside a QMainWindow : self.menu = self.menuBar() self.file_menu = self.menu.addMenu("File") This doesn't work for me on OSX 10.13.6. I've also tried using QMenuBar to create my own menu bar rather than using the default one that comes with a QMainWindow : menu_bar = QMenuBar() menu_bar.addMenu('File') self.setMenuBar(menu_bar) This also has no effect. I never see the "File"

File Browser with PySide2: get the path of the file and then kill the GUI

∥☆過路亽.° 提交于 2020-04-18 05:36:06
问题 I have the following code and want to do the following: Most important point: Once I clicked on the file and get its filepath, I want the GUI to quit because I would then just feed that path to another script ( another_script ) which I would then import My problems is that, after the script successfully prints the path of the selected file, the GUI does not kill itself and i cannot run another_script and I'm stuck in the terminal import sys from PySide2.QtWidgets import QApplication, QWidget,

QApplication instance/qtbot fixture causes travis-ci to abort and core dump

你说的曾经没有我的故事 提交于 2020-04-13 16:52:31
问题 Working on understanding how to go about automated unit testing for PySide2-based applications. However, whenever I attempt to initialize a QApplication instance within the tests, be it through PySide2 itself or through pytest-qt 's qtbot fixture, travis-ci aborts the test. It works locally, however. I've attempted using the qtbot and qapp fixtures from pytest-qt , trying different travis-ci distros like xenial and trusty , as well as including the pytest-xvfb plugin as I've seen recommended

QApplication instance/qtbot fixture causes travis-ci to abort and core dump

你离开我真会死。 提交于 2020-04-13 16:51:28
问题 Working on understanding how to go about automated unit testing for PySide2-based applications. However, whenever I attempt to initialize a QApplication instance within the tests, be it through PySide2 itself or through pytest-qt 's qtbot fixture, travis-ci aborts the test. It works locally, however. I've attempted using the qtbot and qapp fixtures from pytest-qt , trying different travis-ci distros like xenial and trusty , as well as including the pytest-xvfb plugin as I've seen recommended

How to fill QTableWidget from json in Python

一曲冷凌霜 提交于 2020-04-07 06:31:04
问题 I'm working on statistical software which takes data from Cloud Firestore database, puts it into QTableWidget and then into chart. I'm able to create offline backup of database (json below). How can I achieve to fill QTableWidget with data from it? In my table, I've got 4 visible columns - Date, Type, Published, Sent and one hidden - ID (formatted date, e.g. 050719) This is .json file I get from database "{\"events\": {\"050719\": {\"Type\": \"Conference\", \"Published\": \"4\", \"Sent\": \"3

Using QSignalMapper

。_饼干妹妹 提交于 2020-04-07 05:52:10
问题 I tried to make a simple example to help understand how the concept of QSignalMapping works in PySide. I would like to dynamically create a series of buttons by iterating through a loop, and when the user pushes one of the buttons, I can activate a method that returns the appropriate label for the button that was pressed. from PySide2 import QtWidgets,QtCore,QtGui fruit_list = ["apples","oranges","pears"] def fruit_button_event(): print "this is the pressed button's label" def main(): for

Use Qt Design Studio QML with PySide2

人盡茶涼 提交于 2020-03-16 09:16:49
问题 I am new to Qt Designer Studio. I just created a simple button in Qt Design Studio and I am trying to use the QML file with PySide2 but I am getting multiple import errors. Is there a specific way to implement Qt Design Studio qml files with PySide2. The project name is Demo that I created in Qt Design Studio The Demo Project structure: Demo.qml Demo.qmlproject Demo.qmlproject.qtds imports qtquickcontrols2.conf Screen01.ui.qml The PySide2 project structure (main.py files includes the code):

The button with transparent circular edge cannot be drawn correctly above the widget embedded with LibVLC

前提是你 提交于 2020-03-04 06:25:22
问题 I have a program that plays video with LibVLC, and I want to put some circular buttons on top of the VLC Widget for a barrage effect. This is my test code. # -*- coding: utf-8 -*- import sys import os import vlc from PySide2.QtWidgets import * from PySide2.QtGui import * from PySide2.QtCore import * class demo_widget(QWidget): def __init__(self): super(demo_widget, self).__init__() self.__ui__() def __ui__(self): self.resize(600, 400) t_lay_parent = QHBoxLayout() t_lay_parent

How to create a basic custom QGraphicsEffect in Qt?

删除回忆录丶 提交于 2020-02-16 09:55:10
问题 I have been trying to create a basic QGraphicsEffect to change the colors of the widget, but first I tried to make an effect that does nothing like so: class QGraphicsSepiaEffect(QtWidgets.QGraphicsEffect): def draw(painter): pixmap = sourcePixmap() painter.drawPixmap(pixmap.rect(), pixmap) I am using PySide2. Though I checked all over the internet but couldn't find any sample, neither a template nor a real custom effect. How can I write a basic effect to alter the colors of my widget? 回答1: