qdockwidget

PyQt5: How to Re-Dock back a floated QDockWidget via a QPushButton?

此生再无相见时 提交于 2021-02-11 14:10:51
问题 I which to bring back to initial state an Undocked or floated QDockWidget with a QPushButton. from PyQt5 import QtCore, QtGui, QtWidgets class Mainwindow(object): def setupUi(self, window): window.setObjectName("window") window.resize(309, 148) self.centralwidget = QtWidgets.QWidget(window) self.centralwidget.setObjectName("centralwidget") self.Undock_btn = QtWidgets.QPushButton(self.centralwidget) self.Undock_btn.setGeometry(QtCore.QRect(4, 4, 100, 22)) self.Undock_btn.setStyleSheet(

Embedding native windows inside QDockWidget

醉酒当歌 提交于 2021-01-29 08:48:04
问题 I am trying to take a native window from an other process and manage it as a docking widget in my process. This is very similar to: How to manage separate GUI processes in a Qt application? I have found the following which gets me pretty far: https://gist.github.com/torarnv/c5dfe2d2bc0c089910ce Problem is the dock window size does not match the size of the contents it's wrapping (there is a margin which it about 15px wide and 40px tall (see pictures for examples)). from PyQt5 import QtWidgets

pyqt5 multiple floating window easy implement in scroll area [closed]

折月煮酒 提交于 2020-06-23 08:25:51
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 20 hours ago . Improve this question I want to float a window by signal with param in pyqt5. I used already QDockWidget but i can launch only one float window. I need multiple floating window by some pramas. is there any easy way to do this? from PyQt5.QtWidgets import QMainWindow, QApplication, QPushButton,

How to have detachable tool windows in Qt

折月煮酒 提交于 2020-02-21 13:20:33
问题 I am developing a tool which will have some variable sized windows. I am able to achieve this using the QSplitter horizontal & vertical. Please see attached image. Now, how to make these individual windows detachable/maximize/close? How can I add cross markers at the top-right-corner of each window so that they can be closed maximized or detached from there? Just like this link :-- http://vector.com/portal/medien/ecu_testing/tae/test_automation_editor.png 回答1: You're looking for the

How to have detachable tool windows in Qt

杀马特。学长 韩版系。学妹 提交于 2020-02-21 13:12:08
问题 I am developing a tool which will have some variable sized windows. I am able to achieve this using the QSplitter horizontal & vertical. Please see attached image. Now, how to make these individual windows detachable/maximize/close? How can I add cross markers at the top-right-corner of each window so that they can be closed maximized or detached from there? Just like this link :-- http://vector.com/portal/medien/ecu_testing/tae/test_automation_editor.png 回答1: You're looking for the

How to find the height of a QDockWidget title bar?

蹲街弑〆低调 提交于 2020-01-03 10:44:49
问题 I'm trying to find the height of a QDockWidget title bar in order to do some intelligent sizing of a custom layout, but the title bar is not a separate widget, it's built into the private layout of the dock widget, and there is no member to access it. Is there some other way to find its height? 回答1: Yes, you can find the title bar's height using the pixelMetric member function of the dock's QStyle element. You'll probably also want to query the margin as well since it adds space around the

How to made a QDockWidget appears in taskbar?

谁都会走 提交于 2019-12-24 07:00:08
问题 I use a subclass of QDockWidget with a little trick. The "topLevelChanged" signal is connected to this member slot : void MyDockWidget::updateWindowFlags(bool topLevel) { if (topLevel == true) { setWindowFlags(Qt::Dialog|Qt::CustomizeWindowHint|Qt::WindowTitleHint|Qt::WindowMaximizeButtonHint|Qt::WindowCloseButtonHint); // "setWindowFlags" hides the widget, show it again show(); } } This works well (at least on Windows, which is my target) and display a "maximize" button in the title bar. Now

resize a QDockWidget

百般思念 提交于 2019-12-21 07:55:21
问题 I have a QMainWindow that contains several QDockWidget s. Only one of them should be shown at a time. My Problem is: When I hide a dockWidget and show another, the size of the newly shown is the same as the just hidden, no matter what QSizePolicys, sizeHint, sizeConstraint I set! I want the newly shown to restore its own last size but I can't find any method to resize a QDockWidget , without fixing its size with setMinimumSize and setMaximumSize . In fact there is one way but I consider it

Dragging QDockWidgets between QMainWindows

萝らか妹 提交于 2019-12-18 12:33:14
问题 I have a question regarding dragging QDockWidgets between QMainWindows. I have an application with different "DockAreas" which have a QMainWindow member with one or more QDockWidgets. Additionally, I want to make QDockWidgets drag-and-droppable into other, already floating QDockWidgets (not tabbed!). To have the nice hover-effect upon drag-and-drop, the floating QDockWidgets are embedded in a new instance of my DockArea with the QMainWindow member. Now I intercept the mousemove event of the

QDockWidget behavior when changing its content

懵懂的女人 提交于 2019-12-14 02:21:10
问题 I'm facing a problem with one of my QDockWidget . I have several QWidget items in a QDockwidget that are sometimes visible sometimes not. I would like that my QDockWidget resizes itself depending on its content... Not only when QWidgets appear in it, but also when they disappear... So far, my QDockWidget resizes itself when more QWidgets are displayed in it, but when I make them disappear, the QDockWidget stays at his previous size... Any ideas to help ? Thanks in advance! 回答1: There have