qt-designer

Qt: add a file selection field on the form (QLineEdit and “browse” button)

橙三吉。 提交于 2019-12-06 16:59:08
问题 I need to display QLineEdit with "Browse" button at my form. When user clicks button, QFileDialog should be opened, and so on. This is pretty common thing, but I can't find ready-made solution for that. I expected in Qt Designer some widget like QFileSelect , or something like that, but found nothing similar. Should I implement it by hand? Or, what is the correct way to do this? 回答1: Should I implement it by hand? Or, what is the correct way to do this? Yes, I agree with you that it is a

pyqt: how to put a border frame around a widget

做~自己de王妃 提交于 2019-12-06 16:58:35
问题 I'm making some changes to an existing PyQt project. The UI was created with Qt Designer. The relevant part is a QWidget that displays text. I'm trying to put margins around the text. I'd think the simplest way to do this would be to put a border around the QWidget whose background color is the same as the QWidget's background (white). The QWidget is on a QFrame. I'd like to put a white border inside the QFrame and around the edge of the QWidget. The closest I've come is to put short vertical

Changing Pixmap image automatically at runtime in PyQt

↘锁芯ラ 提交于 2019-12-06 16:15:39
I wish to change the image of a pixmap being displayed in a window automatically using a while loop that has a defined delay and uses locations of images stored in a string list. All possibilities I tried led to the first image being displayed but not changing at runtime. Any changes gets reflected only after the program has completed all kinds of execution. from PyQt4 import QtCore, QtGui import time import sys try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: def _fromUtf8(s): return s try: _encoding = QtGui.QApplication.UnicodeUTF8 def _translate(context, text, disambig):

Embed a pyqtgraph plot into a QT .ui?

删除回忆录丶 提交于 2019-12-06 14:35:14
问题 first of all I hope you have me some patience since I'm new on these kind of projects and I also hope not to be asking dumb questions. That being said, my main objective is to create a UI for a raspberry pi 3 which will sense voltage, current, etc from a battery and from a solar panel. Since I'm working on a raspberry and have some knowledge on Python3, I decided to use QTCreator which as I understand can be translated into python3 through pyqt (https://nikolak.com/pyqt-qt-designer-getting

Qt: How to remove the default main toolbar from the mainwindow?

回眸只為那壹抹淺笑 提交于 2019-12-06 07:25:43
I am new to Qt, and I can't figure out why there is a draggable object in my main window. It starts at the top of the screen in its exapanded form. And then I can drag it and it shrinks into a square. You need to remove the main toolbar from either QtDesigner as can be seen below or from the code manually: Then, you will need to rerun qmake for the changes to take effect as the ui_mainwindow.h header file needs to be regenerated from the updated mainwindow.ui description file. 来源: https://stackoverflow.com/questions/27314748/qt-how-to-remove-the-default-main-toolbar-from-the-mainwindow

Qt Designer generate C++ code

自闭症网瘾萝莉.ら 提交于 2019-12-06 06:00:23
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 The menu item "Form/View Code" is exactly what you expect - it shows the generated C++ code: As you can see from the comments in the generated file, Qt designer also uses uic (the Qt User Interface

Qt Designer how to change background

只愿长相守 提交于 2019-12-06 00:45:54
问题 This is an repost. I am kind of new in QtDesigner and wanted to do something about the uglyness of just some buttons. All i have done yesterday was looking on the internet on how to change the background color of a screen in Qt Designer. How to change the color of a button and how to make it flow into another color on the sides. Guess what. I found nothing. I hope that some of you die-hard coders know what i need.. EDIT 1: What i mean with a color flowing into another: Here pink flows into

Accessing GUI elements from outside GUI class in PyQt

落花浮王杯 提交于 2019-12-05 21:52:01
Note : I've already read this post and I didn't understand it unfortunately. I've got a directory settings somewhat like this : Main_Folder |_ Base_Gui_File.py |_ Child_directory (a directory inside Main_Folder) |_ __init__.py |_ some_other.py I've got all the GUI code in the Base_Gui_File.py file, which was generated from designer (PyQt4). There's a Text Input Field QLineEdit , a Push Button QPushButton and a Text Area QTextBrowser . By default QTextBrowser is hidden. But, what I wanted to do was that, when some one types something in the QLineEdit and clicks the QPushButton , it'll send the

pyQt signals/slots with QtDesigner

别说谁变了你拦得住时间么 提交于 2019-12-05 21:21:03
I'm trying to write a program that will interact with QGraphicsView. I want to gather mouse and keyboard events when the happen in the QGraphicsView. For example, if the user clicks on the QGraphicsView widget I will get the mouse position, something like that. I can hard code it rather easily, but I want to use QtDesigner because the UI will be changing frequently. This is the code that I have for the gui.py. A simple widget with a QGraphicsView in it. from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: _fromUtf8 = lambda s: s class Ui

PyInstaller + UI Files - FileNotFoundError: [Errno 2] No such file or directory:

╄→гoц情女王★ 提交于 2019-12-05 16:30:15
问题 I'm trying to export my .py script to .exe using PyInstaller, which has dependencies on .ui files which were created using Qt Designer. I can confirm that my .py script works just fine when running it through PyCharm - I'm able to see the GUI I've created with the .ui files. However, when I export my .py script to .exe and launch it, I recieve the following errors in the command line: C:\Users\giranm>"C:\Users\giranm\PycharmProjects\PyQt Tutorial\dist\secSearch_demo.exe" Traceback (most