<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
The window opens taking the full size of the screen even though I set it<br>
up to use a smaller size on the PI. Additionally, the top line of the<br>
window is missing. I have found no way, that works, to reduce the size<br>
of the screen. <br></blockquote><div><br></div><div>Interesting. I always find the proper use of the pyuic5 output confusing, despite the relatively clear documentation here:<br><div><br><a href="http://pyqt.sourceforge.net/Docs/PyQt5/designer.html">http://pyqt.sourceforge.net/Docs/PyQt5/designer.html</a><br><br></div>You appear to be using the "second approach" shown there exactly. <br>In the class Ui_MainWindow(object) I see,<br><br> MainWindow.resize(400, 300)<br> <br></div><div>so it should not be more than 400px across and 300 high plus the menu bar. I also see<br><br> self.menuBar.setGeometry(QtCore.QRect(0, 0, 400, 22))<br> <br></div><div>which suggests the menu bar will be at 0,0, that is, upper left corner. Is it?<br></div><div><br></div><div>All I can suggest is that you temporarily insert something like, self.resize(200,100) after the call to setupUi() to force the window to be <br></div><div>smaller.<span style="font-family:arial,helvetica,sans-serif"> Or you could use self.<span class="" style="max-width:75%;font-weight:100;color:rgb(26,26,26);font-size:12px;font-style:normal;font-variant:normal;letter-spacing:normal;line-height:14px;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(246,246,246)"><b>setGeometry</b></span><span style="color:rgb(49,49,49);font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:14px;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(246,246,246);display:inline!important;float:none">(50,50,200,100</span><span style="color:rgb(49,49,49);font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:14px;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(246,246,246);display:inline!important;float:none">) to ensure that the upper left corner is on the screen.<br><br></span></span></div><div><span style="color:rgb(49,49,49);font-family:Arial,Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:14px;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(246,246,246);display:inline!important;float:none"><span style="font-family:arial,helvetica,sans-serif">And add a temporary print before the exit to show the current geometry,<br> print(self.geometry().x(), self.geometry().y(),self.geometry().width(),self.geometry().height() )</span><br><br></span></div><div><span style="color:rgb(49,49,49);font-family:Arial,Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:14px;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(246,246,246);display:inline!important;float:none">Then drag the window to a desirable starting size and position; quit; and the print tells you how to set the geometry on startup. Later you can add code to save the current geometry in your Settings on exit and load it on startup.<br><br></span></div></div><br></div></div>