qstackedwidget

Automatically create QStackedWidget pages based on Tuple

独自空忆成欢 提交于 2019-12-11 16:28:45
问题 I'm fairly new to python, and I feel this is an advanced question, with that in mind it might be out of the scope of Stack Exchange. Please bear with me. I have a QTreeWidget and QStackedWidget. I have populated the QTreeWidget using a tuple TreeList = ({ 'Header1': (( 'Item11', 'Item12', )), 'Header2': (( 'Item21', 'Item22' )) }) for key, value in TreeList.items(): root = QTreeWidgetItem(self.QTreeWidget, [key]) for val in value: root.addChild(QTreeWidgetItem([val])) I would like to use this

How to make nested StackedLayouts in PyQt5?

随声附和 提交于 2019-12-11 02:22:05
问题 I am creating a PyQt5 application in Python for a university project that uses QStackedLayout to make it a single-windowed app, however, I can not figure out how to nest a Stacked Widget inside a Stacked Widget. When running the code (degraded for the question), you can see the main menu with a QPushButton in it. When clicking it, the window changes with a QListWidget in it. What I want to achieve is a Stacked Widget to the right of the QListWidget , which changes respectively with the chosen

Resize QStackedWidget to the page which is opened [duplicate]

北战南征 提交于 2019-12-07 04:49:42
问题 This question already has answers here : Qt QStackedWidget Resizing Issue (3 answers) Closed 5 years ago . I want my QStackedWidget to resize to the page which is opened. I got a lot of widgets attached to the first page, but the rest pages have only one button. So they stay so big, and the first page is ok. How can I make my QStackedWidget to have the size of the page being viewed. The reason why i want to do this is that I have three different options, and after that I have other things. If

Resize QStackedWidget to the page which is opened [duplicate]

 ̄綄美尐妖づ 提交于 2019-12-05 10:33:31
This question already has answers here : Qt QStackedWidget Resizing Issue (3 answers) Closed 5 years ago . I want my QStackedWidget to resize to the page which is opened. I got a lot of widgets attached to the first page, but the rest pages have only one button. So they stay so big, and the first page is ok. How can I make my QStackedWidget to have the size of the page being viewed. The reason why i want to do this is that I have three different options, and after that I have other things. If I change to the mode where there is a button and then a lot of white space, I don´t see why doesn´t it

Using QStackedWidget for multi-windowed PyQt application

半腔热情 提交于 2019-12-05 09:46:52
问题 I have a multi-windowed PyQt5 (Python 3.6.2 with Qt 5.9.0) application which works perfectly when run in a standard desktop (i.e. window managed) environment. My target platform is an embedded device (Raspberry Pi, i.MX6, etc. for example), where I won't be using the X11 window system. I'm currently testing the embedded device with the eglfs platform, which doesn't support multiple windows. I'm considering either using the QtWayland platform, or modifying my approach to use a QtStackedWidget

Qt QStackedWidget Resizing Issue

北城以北 提交于 2019-12-04 03:26:50
I have a simple QStackedWidget with 3 different QWidgets in it. The minimum sizes of the QWidgets are (350x200), (200x100), and (450x450). So the problem I'm having is when I resize the QStackedWidget, it has a minimum size of the largest QWidget within it. So if I switch to the second QWidget, (which is the QWidget with the size of (200x100)), the QStackedWidget will only size down (450x450) because of the largest QWidget inside of it. I would like it to size down to fit the current QWidget being displayed, and remove that minimum size. I think that the most straightforward solution is to

Using QStackedWidget for multi-windowed PyQt application

依然范特西╮ 提交于 2019-12-03 22:42:09
I have a multi-windowed PyQt5 (Python 3.6.2 with Qt 5.9.0) application which works perfectly when run in a standard desktop (i.e. window managed) environment. My target platform is an embedded device (Raspberry Pi, i.MX6, etc. for example), where I won't be using the X11 window system. I'm currently testing the embedded device with the eglfs platform, which doesn't support multiple windows. I'm considering either using the QtWayland platform, or modifying my approach to use a QtStackedWidget to contain the 'windows' as individual pages within the stack. How can I modify the below high-level

Switching between frames without erasing contents of each frame

一世执手 提交于 2019-12-02 12:04:15
I've been writing a GUI using the below setCentralWidget method (simplified here) for transitioning between frames - but didn't realize until pretty far in that it erased each window upon moving to the next (which I need to avoid). My actual code has entry boxes that need to be kept in their completed state for when the user goes back to that frame to revise, etc. I'd like to rewrite with as little change to my hierarchy as possible - most likely using QStackedWidget or something similar. The only examples I've found online are not written within the class hierarchy (each page within its own

PyQt: How to switch widgets in QStackedWidget

扶醉桌前 提交于 2019-11-27 08:29:08
问题 I have two buttons ( wgtbtnA & wgtbtnB ) placed on two different pages ( page1 and page2 , respectively) inside a parent object (objectName: stackedWidget ). My dilemma is this: when I run the code, the arrows don't display in PyQt. Why? How do I alternate from page1 to page2 and vice-versa? Here is an image of runtime, which conveys what I am asking for: Qt Designer: I'd like to keep those small back arrows. Below is my code: # -*- coding: utf-8 -*- # Form implementation generated from