qt-designer

How do I add matplotlib plugin to Qt5.4 Designer plugins?

北城余情 提交于 2019-12-23 02:36:45
问题 For a project I have to combine matplotlib with a pyqt5-gui designed with the Qt5.4 Designer . The tutorial for adding PyQtdesignerplugins version 1.1 doesn't work. Install was correctly build with pip3 and the export of the env-variable s were written to the bashrc as followed by a re-log-in. In Tools of Qt Creator 3.3.2 based on Qt5.4.1 built on March, 4th, 2015, I found under "form Editor" -> "About Qt Designer Plugins" . Next I get a dialog which just informs me what plugins were found. I

Qt Designer generate C++ code

江枫思渺然 提交于 2019-12-22 14:05:41
问题 Is it possible to see C++ code with Qt Designer ? I can draw my interface and have it saved as a .ui file. Also, I can generate python code from .ui file using a .bat file. But I cannot view C++/Qt code generated from the UI, which I would like to get. I looked for it and all I can find is doc. about how to generate the python from the .ui, which I can do but is not what I am looking for. Thanks 回答1: The menu item "Form/View Code" is exactly what you expect - it shows the generated C++ code:

Replacing the existing MainWindow with a new window with Python, PyQt, Qt Designer

筅森魡賤 提交于 2019-12-21 13:01:12
问题 I'm new to Python GUI programming I'm have trouble making a GUI app. I have a main window with only a button widget on it. What i want to know is how to replace the existing window with a new window when an event occurs (such as a button click). An answer to a similar question here Replace CentralWidget in MainWindow, suggests using QStackedWidgets but they did not use Qt Designer to make their GUI apps whereas I have two .py files, one is the main window file and the other of window that i

Hello world in pyqt?

血红的双手。 提交于 2019-12-21 06:08:02
问题 Currently I'm using pycharm to develop python web application. I want to develop desktop application with QT framework. I've installed pyqt. I've searched about hello world in pyqt and find this: from PyQt4 import QtGui, QtCore class Window(QtGui.QWidget): def __init__(self): QtGui.QWidget.__init__(self) self.button = QtGui.QPushButton('Test', self) self.button.clicked.connect(self.handleButton) layout = QtGui.QVBoxLayout(self) layout.addWidget(self.button) def handleButton(self): print (

Apply chrome like tabs in Qt

南楼画角 提交于 2019-12-21 02:28:38
问题 Ivan made this -- see http://ivan.fomentgroup.org/blog/2009/03/29/instant-chrome/ -- but I don't know how since I am new to Qt. Does anyone have Idea how to achieve this? 回答1: The first trick is that the window does not have window manager decorations. This is a hint you need to give to the window manager using the NetWM stuff. The good thing is that Qt exports that functionality for you: http://doc.qt.digia.com/4.5/qwidget.html#windowFlags-prop You see, they have the Qt::FramelessWindowHint,

applying python functions directly to Qt designer as signals

て烟熏妆下的殇ゞ 提交于 2019-12-20 10:24:54
问题 I am new to Qt and GUI programming overall but i have done a fair bit of coding in python - writing modules and so on. I need to develop simple GUIs for some of my old modules. What i am trying to do can be represented by the following simple example: def f(x, y): z = x + y return z For this function i will give two line-edits for x and y and one for z. Now i create a push-button 'calculate' and when i do that i want it to take x and y from the line-edits run the function f(x,y) and give the

Spawning one window from another window on button click in qt4

南楼画角 提交于 2019-12-20 07:08:55
问题 I've created two windows using qt4 designer, and would like to link them together. I put them both in a folder and created a file outside the directory, which I'm importing them with. I can open both windows at the same time, but that's not what I would like to do. I would like to make it so that when a button is pushed on one window, it opens the other window, then closes the first window, so the second window is the only one left open. This is the code for the first window, with comments

How do I create a signal to open a QFileDialog in Qt Designer?

和自甴很熟 提交于 2019-12-20 02:43:25
问题 In Qt Designer 5, how do I create a signal to open a QFileDialog ? I'm using Python and PyQt. I've tried creating signals with "Edit Signals/Slots" and I can select the button I want as sender, but I can't select an arbitrary function as the receiver, only existing widgets are available in the list. 回答1: In order to create custom Signal/Slots to later use in your Python application you need to add them doing a right click on the widget and clicking on Change signals/slots... , as shown in the

Working with PyQt and Qt designer ui files

百般思念 提交于 2019-12-19 10:11:50
问题 I'm new to PyQt and I'm trying to work with ui files directly from within my PyQt script. I have two ui files, mainwindow.ui and landing.ui. Clicking on a button 'pushButton' on the main window should open the landing window. However, clicking on the button does not work as I expected. Here is the code(I'm just trying to work stuff out so the code is pretty rough): from PyQt4 import QtCore, uic from PyQt4 import QtGui import os CURR = os.path.abspath(os.path.dirname('__file__')) form_class =

Design a window without a caption bar - QT Designer

孤者浪人 提交于 2019-12-19 08:28:25
问题 How can I declare a window without caption when I use QT Designer? 回答1: if you're looking to remove window title, then the easiest way would be to set the window flags in your widget's constructor, smth like this: MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent, Qt::FramelessWindowHint), //<-- this will remove the title bar ui(new Ui::MainWindow) { ui->setupUi(this); ... or call Qt::WindowFlags flags = Qt::CustomizeWindowHint; setWindowFlags(flags); more details on window types