qdockwidget

Qt - How to show tabs of tabified dockwidget at the top instead of the bottom

こ雲淡風輕ζ 提交于 2019-12-05 14:48:21
In Qt, you can tabify dockWidgets. If I do that, the tabs show on the bottom of the dockWidgets, as is shown in the left sketch. This is the behavior I get under Windows 7 with the latest Qt4 and PyQt4. How can I tell Qt to place the tabs on the dockWidgets top as shown in the right sketch? default: tabs on bottom I want: tabs on top +--------------------+ +------+-----+ | dockWidget1 | | tab1 | tab2|-------+ | | | | | tab1 | tab2|-------| | dockWidget1 | +------+-----+ +--------------------+ You can call QMainWindow.setTabPosition (self, Qt.DockWidgetAreas areas, QTabWidget.TabPosition

How to have detachable tool windows in Qt

白昼怎懂夜的黑 提交于 2019-12-05 10:22:09
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 huysentruitw You're looking for the QDockWidget class: The QDockWidget class provides a widget that can be docked inside a QMainWindow or

How to resize QMainWindow after removing all DockWidgets?

◇◆丶佛笑我妖孽 提交于 2019-12-05 07:58:59
I’m trying to make an application consisting of a QMainWindow , the central widget of which is a QToolBar (it may not be usual, but for my purpose the toolbar’s well suited). Docks are allowed below only. I added a QDockWidget to it, and a QAction on the QToolBar toggles the QDockWidget on and off with removeDockWidget() and restoreDockWidget() . The default size of the QMainWindow is 800 by 24, QToolBar ’s maximumHeight is set to 24 too. Right after the removeDockWidget() is called, QMainWindow ’s geometry is set back to (0,0,800,24) with setGeometry() . What I want to achieve is to resize

QDockWidget - window with no borders when floating

怎甘沉沦 提交于 2019-12-04 16:29:17
Win 7, Qt 5.3 I use a QDockWidget with my application. Works as intended. Now I hide the title bar by setting setTitleBarWidget(new QWidget(this)) to a default constructed widget. This is the standard way according to Qt documentation. Also works, title bar is gone. In order to undock my widget as window, I use myDockWidget->setFloating(true) (in my own slot). But now, when the widget is undocked, the floating window has no longer borders (hence cannot be moved). If I comment out setTitleBarWidget , also myDockWidget->setFloating(true) works. So the original title bar seems to incorporate some

Create a QDockWidget that resizes to it's contents

本秂侑毒 提交于 2019-12-01 22:26:31
问题 I have an application where fixed-size child widgets need to be added programatically to a dock widget at run time based on user input. I want to add these widgets to a dock on the Qt::RightDockArea, from top to bottom until it runs out of space, then create a new column and repeat (essentially just the reverse of the flow layout example here, which I call a fluidGridLayout) I can get the dock widget to resize itself properly using an event filter, but the resized dock's geometry doesn't

Dragging QDockWidgets between QMainWindows

落爺英雄遲暮 提交于 2019-11-30 07:38:09
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 dragged QDockWidget and change its parent when it hovers over another QMainWindow of my DockArea.

QDockWidget Draggable Tabs

别说谁变了你拦得住时间么 提交于 2019-11-30 06:19:04
I am using QDockWidgets and placing two of them on the left side of my application so that tabs can be used to select between them. However, Qt's default behavior for this looks horrible and is unintuitive. Instead of being able to drag the tabs to move the widgets, it places another bar below the selected tab (with the same name) that must be dragged instead. As a user, it would be hard to figure this out. (My QDockWidgets are "Attributes" and "Library") Is there a way to get rid of this second bar and make it so I can move my QDockWidgets by dragging the tabs themselves? If you are adding

C++ resize a docked Qt QDockWidget programmatically?

筅森魡賤 提交于 2019-11-30 04:34:41
I've just started working on a new C++/Qt project. It's going to be an MDI-based IDE with docked widgets for things like the file tree, object browser, compiler output, etc. One thing is bugging me so far though: I can't figure out how to programmatically make a QDockWidget smaller. For example, this snippet creates my bottom dock window, "Build Information": m_compilerOutput = new QTextEdit; m_compilerOutput->setReadOnly(true); dock = new QDockWidget(tr("Build Information"), this); dock->setWidget(m_compilerOutput); addDockWidget(Qt::BottomDockWidgetArea, dock); When launched, my program

QDockWidget Draggable Tabs

余生长醉 提交于 2019-11-29 06:07:23
问题 I am using QDockWidgets and placing two of them on the left side of my application so that tabs can be used to select between them. However, Qt's default behavior for this looks horrible and is unintuitive. Instead of being able to drag the tabs to move the widgets, it places another bar below the selected tab (with the same name) that must be dragged instead. As a user, it would be hard to figure this out. (My QDockWidgets are "Attributes" and "Library") Is there a way to get rid of this

C++ resize a docked Qt QDockWidget programmatically?

陌路散爱 提交于 2019-11-29 05:11:07
问题 I've just started working on a new C++/Qt project. It's going to be an MDI-based IDE with docked widgets for things like the file tree, object browser, compiler output, etc. One thing is bugging me so far though: I can't figure out how to programmatically make a QDockWidget smaller. For example, this snippet creates my bottom dock window, "Build Information": m_compilerOutput = new QTextEdit; m_compilerOutput->setReadOnly(true); dock = new QDockWidget(tr("Build Information"), this); dock-