qt-designer

how to use ui file for making a simple widget?

我是研究僧i 提交于 2020-01-02 03:30:32
问题 i have a simple window with a quit button in qt.The working code is shown below #include <QApplication> #include <QDialog> #include <QPushButton> class MyWidget : public QWidget { public: MyWidget(QWidget *parent = 0); }; MyWidget::MyWidget(QWidget *parent) : QWidget(parent) { setFixedSize(200, 120); QPushButton *btquit = new QPushButton(tr("Quit"), this); btquit->setGeometry(62, 40, 75, 30); btquit->setFont(QFont("Times", 18, QFont::Bold)); connect(btquit, SIGNAL(clicked()), qApp, SLOT(quit(

PySide2 paint on widget created by designer

纵饮孤独 提交于 2019-12-31 05:12:14
问题 This issue is with VS Code on Win10 and Python 3.6.6. I'm new both to Python and PySide2. I've read a lot of topics on this here at StackOverflow and possibly this is a duplicate of another topic, but I'm not able to get my widget painted. I understand that the paintEvent() of the widget object have to be overridden somehow. Most of the examples out there does some painting on the main window but I'm not able to transfer this on widgets from an ui.file. I've created two classes in my .py-file

Error using FigureCanvasQTAgg in MatplotlibWidget pyqt5

倖福魔咒の 提交于 2019-12-31 04:13:14
问题 I would like to plot on my GUI with pyqt5 using matplotlib. I have created a class called MatplotlibWidget which create the figure and canvas of my plot. But I have a problem to generate my canvas with the FigureCanvasQTAgg function (which is a matplotlib function). Here the part of my code which is bugging: import matplotlib.pyplot as plt from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg from matplotlib.figure import Figure #Some more code...not relevant class MatplotlibWidget

QtDesigner & PySide: QTableWidget don't get accessible

二次信任 提交于 2019-12-30 10:10:49
问题 I made a form in QtDesigner. This form gets loaded from PySide with help of the function widget = loader.load(file, parent) However, the QTableWidget (with objectNname buffer_table) don't get accessible with widget.buffer_table If I use a QPushButton instead it works. How can I get this working. I'd like to fill up the table in Python. This is the ui-file i'd like to use: http://pastebin.com/6PZFrvmr EDIT: When I create a new table and try to load it, it seems to work. However, if I put it in

pyqt qtabwidget horizontal tab and horizontal text in QtDesigner

允我心安 提交于 2019-12-29 09:22:30
问题 i am having problem to change text alignment using pyqt4 desginer i have made tabs horizontal by aligning west but the text in that goes north to south that looks bad i want to change alignment of text as horizontal how can i do that...thanks in advance. this is my ui.py code # Form implementation generated from reading ui file 'untitled.ui' # # Created by: PyQt4 UI code generator 4.11.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 =

pyqt qtabwidget horizontal tab and horizontal text in QtDesigner

痴心易碎 提交于 2019-12-29 09:22:02
问题 i am having problem to change text alignment using pyqt4 desginer i have made tabs horizontal by aligning west but the text in that goes north to south that looks bad i want to change alignment of text as horizontal how can i do that...thanks in advance. this is my ui.py code # Form implementation generated from reading ui file 'untitled.ui' # # Created by: PyQt4 UI code generator 4.11.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 =

pyqt button automatically binds to on_…_clicked function without connect or pyqtSlot

旧街凉风 提交于 2019-12-29 08:21:21
问题 I've been using pyqt5 with qt-designer for some weeks now. I'm used to connect signals to handler functions with connect statements. Yesterday I made a piece of code that also automatically connected a button clicked signal to a handler function without a pyqtSlot decorator. Connecting the clicked signal to a function resulted in executing the function three times when clicking the button once. Deleting the connect statements resulted in twice executing the function when clicking the button

pyqt button automatically binds to on_…_clicked function without connect or pyqtSlot

℡╲_俬逩灬. 提交于 2019-12-29 08:21:10
问题 I've been using pyqt5 with qt-designer for some weeks now. I'm used to connect signals to handler functions with connect statements. Yesterday I made a piece of code that also automatically connected a button clicked signal to a handler function without a pyqtSlot decorator. Connecting the clicked signal to a function resulted in executing the function three times when clicking the button once. Deleting the connect statements resulted in twice executing the function when clicking the button

Drag n Drop Button and Drop-down menu PyQt/Qt designer

 ̄綄美尐妖づ 提交于 2019-12-29 01:28:12
问题 I would like to know the "best practice" to change the behavior of some buttons to do the following: I want with a click to appear a menu. Or when you drag this same button you could drop it in another and this will "draw" a line connecting them. Here is an Example: The idea is to connect those "jack" buttons to any other "input" buttons. I was using the Qt designer and I realize that the buttons properties only the "acceptDrops" property is listed, but I can't make it work. Signals/Slots

Unable to build GUI from the code from PyQt Designer

人盡茶涼 提交于 2019-12-28 18:14:39
问题 I made a GUI file from pyqt designer,which i converted to .py file.but when i load that .py code in my IDE (Pycharm and sublime text),and i try to run it,it runs without errors,but the physical aspect of GUI isn't loaded,i tried a custom code from the internet,which worked great,GUI shows up when i run that code. i will give simpler code than the one i'm currently working on,as it seems all of the code generated from pyqt designer doesn't work at all for me regarding its physical aspect. from