qt-designer

Layout : How to make one widget 3x the rest in a vertical layout

空扰寡人 提交于 2019-12-11 02:03:44
问题 I have 3 tables (A,B and C) in a vertical layout.The size policy (Horizontal and vertical) of these 3 are set to expanding. How can I make table-A 3 times the size of B and C and always have that ratio maintained. I am doing this through QT Designer. Update: In order to test the layout stretch method. I added four QlistWidgets inside a vertical layout to a form having a horizontal layout. Here is the XML for the form <?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> <class

Ui forms: Add runtime or compile time?

和自甴很熟 提交于 2019-12-11 01:34:39
问题 I want to know which way is efficient if I am having number of UI forms. I don have any idea about memory utilization in both of case I just tried both ways in a simple example. http://qt-project.org/doc/qt-4.8/designer-using-a-ui-file.html here they described both ways. Now which one method is more efficient? 回答1: The prefered way to use ui files is to compile them with the uic. QtCreator will automatically take care of this. You can use the QUiLoader if you have special constraints - for

QDockWidget layout with no central widget

六眼飞鱼酱① 提交于 2019-12-10 16:17:49
问题 I have a problem with QDockWidget. I'm using Qt Designer, and I would like to build an app with only dock-widgets, and have a small bar above for properties. The problem is that I cannot build the app without a main QWidget (I mean with only QDockWidgets). Here is my screenshot: Annotation 1) - this is the space that I can't remove. When I remove it from xml, Qt Designer crashes. If it is not removable, how can I set the left QDockWidget and the right QDockWidget to have half of the entire

Select text of QLineEdit on focus

白昼怎懂夜的黑 提交于 2019-12-10 12:42:27
问题 I have created a dialog using QtDesigner. There is a QLineEdit object in the dialog with some default content. When the dialog initializes and the focus goes to the QLineEdit , I want the default content to be auto selected, so once the user start writing, the previous content will be overwritten. EDIT: In constructor: dialog->accept(); and connect( dialog, SIGNAL(accepted()), QlineObj, SLOT( selectAll() ) ); 回答1: Call lineEdit->selectAll(); after you set the default text. (In the dialog

Insert VTK into the right spot of layout

邮差的信 提交于 2019-12-10 12:15:46
问题 I am trying to put the VTK 3D scene widget into the right spot of pyqtgraphics.GraphicsLayout(). But either the scene does not appear if i am not assigning the window as parent or if I do - the scene does not adapt to the free area, it is just floating in the upper left corner. I am currently struggling to find a solution to put a viewbox and vtkrenderer into the same window. One of my attempts was to assign the self.w (see below this paragraph)- which is my main window as a parent to the

I'm having issues getting the qwt widget to work correctly with Qt-Creator

怎甘沉沦 提交于 2019-12-10 11:37:38
问题 I'm having issues getting qwt 6.1.0 to work correctly with Qt-Creator 5.1.0. It works correctly when I launch the stand alone version of Qt-Designer and everything compiles and runs correctly when I use Qt-Creator. However the designer that is built into Qt-Creator does not display the qwt widgets correctly on any forms nor give me the option to add new qwt widgets. I'm using Qt Creator 5.1.0 for Windows 64-bit (VS2012 with OpenGL). I've also downloaded and compiled Qwt 6.1.0 with the

HowTo draw correct CSS border in header?

你。 提交于 2019-12-10 10:25:35
问题 On the picture represented dialog window with only one widget class QTableWidget . My problem is that bottom border of the header (red square, QHeaderView class) is overlaps with left/right colored borders! What I want, is to make red squares sections view correctly, as green squares. Here is CSS code from Qt Designer which I'm using: QTableView#tableWidget QHeaderView::section:horizontal { height: 24px; border-style: none; border-left: 1px solid #ecedef; border-top: 1px solid #161618; border

Overlapping widgets in QtDesigner

夙愿已清 提交于 2019-12-10 03:56:09
问题 I want to overlay two widgets in QtDesigner: There is the big QTextBrowser, and below in the down right corner should be a non-interactiv label that I am going to use as a drag-grip to resize the window (the main widget is frameless so I need to implement it). Usually this label will sit below the QTextBrowser, which leaves on the left of the grip-label a lot of unused space. So I want to put the grip-label above the QTextBrowser. I want to achieve this in QtDesigner. But the code would look

How to organize classes in pyqt GUI programming

孤街浪徒 提交于 2019-12-09 07:01:38
问题 I have constructed a main window GUI using qt designer and pyqt. As the program grows more complex, using only one class may result in too many methods and attributes to manage. I figured that I should construct new classes in order to make things more manageable. My first question is, how do I know when do I add a new class for my application? Is there any rule of thumb as a general guide? Is it a good idea to add a new class for new windows/tabs? My second question is, if I added new

Implementing LED in PyQt Designer

核能气质少年 提交于 2019-12-09 01:56:21
问题 I am new to PyQt and QtDesigner. I want to add an LED in my GUI. can anyone kindly suggest How can I add LED in my GUI and change its color in my application? 回答1: I have implemented a green/red LED indicator in my application "Grid Control", please have a look at the code on Github it may give you some ideas. I have defined two LED icons in my resource file as follows: ICON_RED_LED = ":/icons/led-red-on.png" ICON_GREEN_LED = ":/icons/green-led-on.png" The icon can activated like this: self