qt-designer

Can I have single line sized QTextEdit with simple html?

笑着哭i 提交于 2020-03-02 12:26:23
问题 I need to display simple status row with text which will contain following styles: color bold italic QTextEdit can render simple HTML. But it also forcibly expands over multiple lines: Red background was added to emphasize the dimensions of the QTextEdit . Desired size is the size of one text line. How do I achieve that? 回答1: First of all, if you've simply used a QLabel , you'd not need to do anything special: it supports rich text format, and only takes as much space as necessary: #include

Can I have single line sized QTextEdit with simple html?

筅森魡賤 提交于 2020-03-02 12:18:31
问题 I need to display simple status row with text which will contain following styles: color bold italic QTextEdit can render simple HTML. But it also forcibly expands over multiple lines: Red background was added to emphasize the dimensions of the QTextEdit . Desired size is the size of one text line. How do I achieve that? 回答1: First of all, if you've simply used a QLabel , you'd not need to do anything special: it supports rich text format, and only takes as much space as necessary: #include

how to make a graph fill all the window

谁说我不能喝 提交于 2020-02-27 08:43:27
问题 I am ploting a graph in an application created with QtDesigner, the problem is that, when the grapth is showed, a big "grey edge" appears between the graph space and the mplwidget space. That makes the plot smaller, so how could I delete this big "grey border" that appears when I show my graph in the main Window?? I would like my graph to fill all the available space for the widget. 回答1: The short answer is: "Use fig.tight_layout() ." Let me give a bit more explanation about what's going on,

Qt Designer: could not find custom PyQt widget plugins

≡放荡痞女 提交于 2020-02-23 07:04:59
问题 I wrote a lot of custom widget plug-ins for using them in the Qt Designer and my Pipeline. This is working fine on my Mac (Mavericks, PyQt4, Python 2.7), and this week I wanted to implement those plugins on my Windows environment as well. But it wasn't working. The plug-ins are not appear in the Qt Designer's Widget Box on the left (Windows 7, PyQt4, Python 2.7). After a lot of try's, I downloaded the PyQt4 example files and followed the instructions from: PyQt Reference Guide and also the

Qt Designer: could not find custom PyQt widget plugins

女生的网名这么多〃 提交于 2020-02-23 07:04:23
问题 I wrote a lot of custom widget plug-ins for using them in the Qt Designer and my Pipeline. This is working fine on my Mac (Mavericks, PyQt4, Python 2.7), and this week I wanted to implement those plugins on my Windows environment as well. But it wasn't working. The plug-ins are not appear in the Qt Designer's Widget Box on the left (Windows 7, PyQt4, Python 2.7). After a lot of try's, I downloaded the PyQt4 example files and followed the instructions from: PyQt Reference Guide and also the

Get focus (or tab) order

我们两清 提交于 2020-02-02 02:54:07
问题 I have designed a user interface by using Qt Designer, and I have set the tab order using the "edit tab order" mode. Now what I'd like to know (for an other reason, not so important) is how to get the tab order of a specific QWidget in the ui? I mean if I have several widgets, and say the tab order has been set, is there a way to do something like : int nb = widget1->getTabOrder(); 回答1: There is no way to get the tab order as an integer. If you look into the C++ code that the uic tool creates

Qt resize widget inside another widget

戏子无情 提交于 2020-01-25 03:29:06
问题 I have the following layout: The black rectangles are QVBoxLayouts, the red one is a generic widget container and the blue little rectangle is my custom openGL widget. I already set the resize policies for all layouts and widgets, but I can't get the openGL little widget to resize to the extent of his parent's area (the red rectangle in the image). I'm a Qt beginner, perhaps I need to use signals and slots to resize the little blue openGL widget to the red one? But how? 回答1: The QGLWidget

Get QComboBox item text triggered by event in separate class method/function

妖精的绣舞 提交于 2020-01-24 19:39:12
问题 I'm having trouble getting any information from a QComboBox other than the index in a function. Most similar examples provides the function in the same class as the triggered event. I'm trying to get this from an external class (and file). Folder structure is as provided in the answer here: PySide2 paint on widget created by designer In paintEventTest.py I've created a list which is used to populate the combobox with items. ComboEvent is instantiated from EventMethods.py and I'm trying to

Python & qtDesigner uic pop-up window lineEdit access

谁说我不能喝 提交于 2020-01-22 01:16:45
问题 I'm newbie. I want to click a pushButton to open a new window and take text from main window lineEdit and copy to new pop-up window lineEdit. So far I an create new window but can't access lineEdit. No errors, app is not responding. This is what I have: from PyQt5.QtWidgets import QApplication from PyQt5 import uic app = QApplication([]) #Main Window ui = uic.loadUi(r"D:\UI_test\gui\main_gui_TT.ui") appedit = QApplication([]) #Pop-up uiedit = uic.loadUi(r"D:\UI_test\gui\input_TT.ui") def

Qt 5.7 QDockWidget default size

北慕城南 提交于 2020-01-17 12:38:25
问题 I am trying to have following setup: at start (when main window is opened) I want to have 2 QDockWidgets at left with width 400px and height 1/2 (each) of QMainWindows height. At the left, 3 QDockWidgets with width 400px and height 1/3 (each) of QMainWindows height. All of 5 widgets have to be resizable . That means using setFixSize() won't work in this case. So far I've tried changing Geometry>Width and Gemetry>Height in designed -> didn't work. Then I tried using resize() in main window