<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hey Kyle,</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
If it was ported, it would be exactly what I need.<br>
Unfortunately, I don't have any experience with SIP to be able to do it. But I will look into it, thanks.</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
If anyone else has other suggestions/solutions, please let me know.<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Regards,<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Matic<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Kyle Altendorf <sda@fstab.net><br>
<b>Sent:</b> Wednesday, June 26, 2019 1:23 PM<br>
<b>To:</b> Matic Kukovec<br>
<b>Cc:</b> pyqt@riverbankcomputing.com<br>
<b>Subject:</b> Re: [PyQt] Upgrading from static to dock widgets?</font>
<div> </div>
</div>
<div style="font-size:10pt">
<p>Side note, perhaps something like below would be of interest to you. It would require wrapping it for Python but hopefully SIP would make that 'easy'. I've been meaning to do that myself for awhile but haven't gotten to it yet.</p>
<p><a href="https://github.com/richardjdare/Qt-Advanced-Docking-System">https://github.com/richardjdare/Qt-Advanced-Docking-System</a></p>
<p>Cheers,</p>
<p>-kyle</p>
<p><br>
</p>
<p>On 2019-06-26 05:33, Matic Kukovec wrote:</p>
<blockquote type="cite" style="padding:0 0.4em; border-left:#1010ff 2px solid; margin:0">
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:#000000">
Hi guys,</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:#000000">
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:#000000">
I have an application that uses three QTabWidgets in a QGroupBox as the central widget.<br>
This works great and I have implemented dragging of tabs between these three widgets.</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:#000000">
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:#000000">
To upgrade to docking, I would wrap each QTabWidget in a QDockWidget and remove it's titlebar with 'setTitleBarWidget', as I don't want a titlebar. I would also remove the central widget and just have three QDockWidget's docked somewhere.</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:#000000">
My questions are:</div>
<ul>
<li><span style="font-family:Calibri,Helvetica,sans-serif">I would upgrade the QTabWidget to wrap a dragged tab by putting it inside a new QTabWidget and putting it into a QDockWidget automatically on the fly.<br>
How can I then manually initiate a 'dock move' when I drag one of the tabs from a QTabWidget after the dragged tab widget was wrapped as described in the previous sentence?</span></li><li><span style="font-family:Calibri,Helvetica,sans-serif">I tried playing around with QDockWidgets to figure out how to make them movable to any space (above, below, left, right) of any other QDockWidget, but the way in which they can be moved is limited to
what area they were initialized in. For example if I add 4 dockwidgets to the QMainWindow with the '</span><span style="font-family:Calibri,Helvetica,sans-serif">self.addDockWidget(Qt.TopDockWidgetArea, dockwidget)</span><span style="font-family:Calibri,Helvetica,sans-serif">',
I can only move them side-by-side, I cannot move one above or below another. What am I missing? My test Example:</span><br>
<span style="font-family:Calibri,Helvetica,sans-serif"></span><span style="font-family:Calibri,Helvetica,sans-serif"><span style="font-family:Calibri,Helvetica,sans-serif"><span style="font-size:10pt; line-height:normal">from PyQt5.QtWidgets import *</span><span><br>
</span></span></span>
<div><span style="font-size:10pt; line-height:normal">from PyQt5.QtGui import *</span></div>
<div><span style="font-size:10pt; line-height:normal">from PyQt5.QtCore import *</span></div>
<div><span style="font-size:10pt; line-height:normal">import sys</span></div>
<div> </div>
<div><span style="font-size:10pt; line-height:normal">class Window(QMainWindow):</span></div>
<div><span style="font-size:10pt; line-height:normal"> def __init__(self):</span></div>
<div><span style="font-size:10pt; line-height:normal"> super().__init__()</span></div>
<div> </div>
<div><span style="font-size:10pt; line-height:normal"> title = "DockAble Application"</span></div>
<div><span style="font-size:10pt; line-height:normal"> top = 400</span></div>
<div><span style="font-size:10pt; line-height:normal"> left = 400</span></div>
<div><span style="font-size:10pt; line-height:normal"> width = 600</span></div>
<div><span style="font-size:10pt; line-height:normal"> height = 500</span></div>
<div> </div>
<div><span style="font-size:10pt; line-height:normal"> self.setWindowTitle(title)</span></div>
<div><span style="font-size:10pt; line-height:normal"> self.setGeometry(top,left, width, height)</span></div>
<div> </div>
<div><span style="font-size:10pt; line-height:normal"> self.dockAble()</span></div>
<div> </div>
<div><span style="font-size:10pt; line-height:normal"> def dockAble(self):</span></div>
<div><span style="font-size:10pt; line-height:normal"> for i in range(3):</span></div>
<div><span style="font-size:10pt; line-height:normal"> dock = QDockWidget("Test widget", self)</span></div>
<div><span style="font-size:10pt; line-height:normal"> dock.setAllowedAreas(Qt.AllDockWidgetAreas)</span></div>
<div><span style="font-size:10pt; line-height:normal"> self.addDockWidget(Qt.TopDockWidgetArea, dock)</span></div>
<div> </div>
<div><span style="font-size:10pt; line-height:normal">app = QApplication(sys.argv)</span></div>
<div><span style="font-size:10pt; line-height:normal">window = Window()</span></div>
<div><span style="font-size:10pt; line-height:normal">window.show()</span></div>
<span style="font-family:Calibri,Helvetica,sans-serif"><span style="font-size:10pt; line-height:normal">app.exec()</span></span></li></ul>
<div><span style="font-family:Calibri,Helvetica,sans-serif"><span style="font-size:12pt; line-height:normal; font-family:Calibri,Helvetica,sans-serif"> </span></span></div>
<div><span style="font-family:Calibri,Helvetica,sans-serif"><span style="font-size:12pt; line-height:normal; font-family:Calibri,Helvetica,sans-serif">Thanks</span><span style="font-size:10pt; line-height:normal">,</span></span></div>
<div><span style="font-family:Calibri,Helvetica,sans-serif"><span style="font-size:12pt; line-height:normal">Matic</span><span style="font-size:10pt; line-height:normal"><br>
</span></span></div>
<div> </div>
<br>
<div class="x_pre" style="margin:0; padding:0; font-family:monospace">_______________________________________________<br>
PyQt mailing list <a href="mailto:PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a><br>
<a href="https://www.riverbankcomputing.com/mailman/listinfo/pyqt" target="_blank" rel="noopener noreferrer">https://www.riverbankcomputing.com/mailman/listinfo/pyqt</a></div>
</blockquote>
</div>
</body>
</html>