qt-designer

Qt designer: How to add widget to a layout in the designer when the layout appears infinitely thin?

倾然丶 夕夏残阳落幕 提交于 2019-12-03 04:15:30
I am using Qt Designer, and I would like to move a couple of top-level widgets into a horizontal layout. I have dragged a "Horizontal Layout" object into the form. I am now attempting to drag the desired widgets into the layout. Unfortunately, the new Horizontal Layout widget is infinitely thin: ... and I cannot drag my "Import Progress" label widget or my progress bar widget into the new horizontal layout widget. Note that when I attempt to drag the desired widgets over the new horizontal layout widget, Qt Designer does not do anything useful for me in terms of expanding the drop region to

Custom Qt Widgets with python for Qt Designer

巧了我就是萌 提交于 2019-12-03 04:04:11
I am trying to write a custom widget for the Qt Designer using only Python. I was following a couple of tutorials I found online but none of them were working or anything close to what I would call to be a minimum working example. So my questions are: What steps are involved to make a a custom widget appear in the Widget Box of Qt Designer? If you can spare the time: Please provide a minimum working example (like a widget with a label in it saying "A truly minimal working Qt custom widget example"). Or is it maybe not possible at all to include a custom widget using only python? swdev I found

Qt Designer vs Handcoding

最后都变了- 提交于 2019-12-03 01:10:31
问题 Every time I start a project with some graphical toolkit, one of the first conflicts happen with the decision of how to deal with the visual design and the widget layout: A graphical tool or handcoding? This is a quite tricky/subjective question because most people will decide based on personal preference. It also depends greatly on the quality of the graphical tool. In this case I would like to focus just on the latest version of the QT library. I do not intend to discuss which method is

Qt get children from layout

╄→гoц情女王★ 提交于 2019-12-03 01:09:37
I try to hide all widgets in layout. But looks like findChildren doesn't work for layout. Here's my sample code: QLayout * layout = widget -> findChild<QLayout *> (layoutName); QList<QWidget *> list = layout -> findChildren<QWidget *> (); cout << list.size() << endl; size is 0, but inside this layout I have a few widgets. But the same code works fine if I try to get widgets from parent widget. How I can get them from appropriate layout? Frank Osterfeld The layout does not "inject" itself in the parent-child tree, so the widgets stay (direct) children of their parent widget. You could use

applying python functions directly to Qt designer as signals

南楼画角 提交于 2019-12-02 21:07:24
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 output to z. Is there any way to do this directly in Qt Designer by adding the function f(x,y) written

Qt Designer vs Handcoding

…衆ロ難τιáo~ 提交于 2019-12-02 14:29:45
Every time I start a project with some graphical toolkit, one of the first conflicts happen with the decision of how to deal with the visual design and the widget layout: A graphical tool or handcoding? This is a quite tricky/subjective question because most people will decide based on personal preference. It also depends greatly on the quality of the graphical tool. In this case I would like to focus just on the latest version of the QT library. I do not intend to discuss which method is better. I am convinced that the best answer is: depends on the project. What I want is a reference to a

Displaying 2nd Window Issue

我是研究僧i 提交于 2019-12-02 11:06:03
问题 I am dealing with 2 windows . One is created by Qt Designer and i import it on test.py program . what i did i make a Widget on the test program and than add a button to it and on click event I try to popup the other window(gui1.py) created by Qt Designer but it never pop ups and when i use break and do line by line debugging it shows me this message after running this command "myapp2 = MyForm()" on line number 35 test.py . QCoreApplication::exec: The event loop is already running and once i

Using QT Designer to create TableView to Postgres Database

谁说胖子不能爱 提交于 2019-12-02 09:43:30
I'm creating a plugin in Quantum GIS that is using Postgres as the back end and QT Designer to make the GUI. I'm using psycopg2 to run scripts in the database and even fetch results of queries to set the values of labels in the GUI. This stuff is working fine for me. What I would like to do now after some queries are run by clicking a 'calculate' button is for the resulting table to be shown in the plugin as a TableView. I know there widget exists expressly for the purpose of viewing tables but I can't quite figure out how to go about it. I'm not sure if I should be using psycopg2 or PySide,

Using a custom PySide2 widget in Qt Designer

£可爱£侵袭症+ 提交于 2019-12-02 05:10:40
I'm searching for a way to use custom widgets in Qt Designer written with Qt for Python (PySide2) effectively. I found out, that it is possible to design the GUI with the base widget, then just swap out the class to my custom widget in the UI File and informing the QUiLoader about the subclass loader.registerCustomWidget(MyMainWindow) , but then opening it again in Qt Designer doesn't work that well. I read in this similar question for PyQt that you have to write a Plugin for the custom widget. Does this possibility also exist for PySide2? Some example code: custom_widget.py: import sys from

PySide2 paint on widget created by designer

放肆的年华 提交于 2019-12-02 04:56:41
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, MainForm and Drawer. The MainForm contains implementation of UI and I'm trying to get a widget (named