[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: [PyQt] Simple Window Problem.
From: Felix Bearden <felix-biz () felixlovesliz ! com>
Date: 2015-03-21 18:04:50
Message-ID: 550DB2C2.6090202 () felixlovesliz ! com
[Download RAW message or body]
Possibly a NewBe problem -- In converting an application from a Fedora
20 based system to a Raspberry PI I have encountered a problem with the
"main" window size.
The window opens taking the full size of the screen even though I set it
up to use a smaller size on the PI. Additionally, the top line of the
window is missing. I have found no way, that works, to reduce the size
of the screen. I put together a smaller version of the program to
illustrate the problem and have included the necessary files and am
hopeful someone can point me to a solution.
OS: Rasbian
QtCreator: 2.5.0
Python: 2.7.3
PyQt-gpl-5.4.1
Qt: 5.2.0
Thanks in advance for considering the problem.
Felix
["mainwindow.py" (text/x-python)]
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'mainwindow.ui'
#
# Created by: PyQt5 UI code generator 5.4.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(400, 300)
self.centralWidget = QtWidgets.QWidget(MainWindow)
self.centralWidget.setObjectName("centralWidget")
MainWindow.setCentralWidget(self.centralWidget)
self.menuBar = QtWidgets.QMenuBar(MainWindow)
self.menuBar.setGeometry(QtCore.QRect(0, 0, 400, 22))
self.menuBar.setObjectName("menuBar")
self.menuFile = QtWidgets.QMenu(self.menuBar)
self.menuFile.setObjectName("menuFile")
MainWindow.setMenuBar(self.menuBar)
self.mainToolBar = QtWidgets.QToolBar(MainWindow)
self.mainToolBar.setObjectName("mainToolBar")
MainWindow.addToolBar(QtCore.Qt.TopToolBarArea, self.mainToolBar)
self.statusBar = QtWidgets.QStatusBar(MainWindow)
self.statusBar.setObjectName("statusBar")
MainWindow.setStatusBar(self.statusBar)
self.actionExit = QtWidgets.QAction(MainWindow)
self.actionExit.setObjectName("actionExit")
self.menuFile.addSeparator()
self.menuFile.addAction(self.actionExit)
self.menuBar.addAction(self.menuFile.menuAction())
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
self.menuFile.setTitle(_translate("MainWindow", "File"))
self.actionExit.setText(_translate("MainWindow", "Exit"))
["simplewindow.py" (text/x-python)]
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from PyQt5 import QtWidgets, QtCore, QtGui
from mainwindow import Ui_MainWindow
class Editor(QtWidgets.QMainWindow):
def __init__(self):
super(Editor, self).__init__()
self.ui=Ui_MainWindow()
self.ui.setupUi(self)
self.show()
"""
Menu Connections
"""
self.ui.actionExit.triggered.connect(self.doactionexit)
"""
self.ui.actionOpen.triggered.connect(self.openFile)
self.ui.actionNew.triggered.connect(self.newFile)
self.ui.actionClose.triggered.connect(self.closeFile)
"""
"""
Pushbuttons
"""
"""
Actions
"""
def doactionexit(self):
sys.exit()
def main():
import pylab
from math import pi
app = QtWidgets.QApplication(sys.argv)
ex = Editor()
sys.exit(app.exec_())
if __name__ == '__main__':
main()
["mainwindow.ui" (application/x-designer)]
[Attachment #6 (text/plain)]
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic