<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); background-color: rgb(255, 255, 255);">
Hi Tony,<br>
<br>
I set the QGroupBox as the main widget of the QDockWidget like so:<br>
<blockquote style="margin-top: 0px; margin-bottom: 0px;"><br>
<span style="font-size: 10pt;">self.main_groupbox = data.QGroupBox()</span><br>
<span style="font-size: 10pt;">self.main_groupbox.setGeometry(</span><span style="font-size: 10pt;">0, 0,</span><span style="font-size: 10pt;">width, height</span><span style="font-size: 10pt;">)</span><br>
<span style="font-size: 10pt;"># Set it as the main widget</span><br>
<span style="font-size: 10pt;">self.setWidget(self.main_groupbox)</span><br>
</blockquote>
<br>
I do not know how to add the groupbox to the <font size="2"><span style="font-size:11pt;">dockWidgetsContents
</span></font>as you mentioned, can you please give me an example.<br>
<br>
Thanks,<br>
Matic<br>
<blockquote style="margin-top: 0px; margin-bottom: 0px;"></blockquote>
</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> Tony Arnold <tony.arnold@manchester.ac.uk><br>
<b>Sent:</b> Wednesday, April 11, 2018 6:20 PM<br>
<b>To:</b> pyqt@riverbankcomputing.com; kukovecmatic@hotmail.com<br>
<b>Subject:</b> Re: [PyQt] QDockWidget offset?</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Matic,<br>
<br>
<br>
On Wed, 2018-04-11 at 14:20 +0000, Matic Kukovec wrote:<br>
> Hi guys,<br>
> <br>
> I have a QDockWidget onto which I add a QGroupbox. On Windows, there<br>
> are no problems.<br>
> But on Linux there is border with a gap on top from the windows<br>
> frame, with the size similar to a system's menubar.<br>
> To illustrate this I added a screenshot in the attachment that shows<br>
> a QDockWidget that has a QGroupBox added with the 'setWidget'<br>
> function and a QPushButton added to the QGroupBox.<br>
> On the left is the Windows example and on the right is the Linux<br>
> example with the border drawn behind the QPushButton.<br>
> <br>
> How do I get rid of this border on Linux?<br>
<br>
Is your QGroupBox contained within the dockWidgetsContents widget, that<br>
is usually in a QDockWidget and is effectively a layout, or has it<br>
replaced it? I think you need to keep the dockWidgetsContent and add<br>
any other widgets to that and not to the QDockWidget directly.<br>
<br>
Your widget structure or the code that creates the QDockWidget instance<br>
would be helpful here.<br>
<br>
Regards,<br>
Tony.<br>
-- <br>
Tony Arnold MBCS, CITP | Senior IT Security Analyst | Directorate of IT Services | G64, Kilburn Building | The University of Manchester | Manchester M13 9PL | T: +44 161 275 6093 | M: +44 773 330 0039</div>
</span></font></div>
</body>
</html>