Dec-30-2018, 04:52 PM
I am working on a program to call a GUI I designed in PyQt5 Designer.
The gui looks exactly as I designed it in Windows 10, but on Linux or Mac the design is off. Like the buttons are moved, the textboxes are out of the groupboxes etc. Is there something I need to do to get it to be fixed for all OS types?
Just basic code to call the .ui file for now. see code below and screenshots.
Any help is appreciated...
The gui looks exactly as I designed it in Windows 10, but on Linux or Mac the design is off. Like the buttons are moved, the textboxes are out of the groupboxes etc. Is there something I need to do to get it to be fixed for all OS types?
Just basic code to call the .ui file for now. see code below and screenshots.
Any help is appreciated...
import os
import os.path
import sys
import subprocess
import serial.tools.list_ports
import xml.etree.ElementTree as ET
import platform
from PyQt5 import QtCore, QtGui, QtWidgets, QtSerialPort, uic
from PyQt5.QtWidgets import QFileDialog, QMessageBox
from os import path
LOCAL_DIR = os.path.dirname(os.path.realpath(__file__)) + "/"
class Main(QtWidgets.QMainWindow):
def __init__(self):
super().__init__()
self.ui = uic.loadUi(LOCAL_DIR + "ooeygui.ui", self)
self.show()
def _getosplatform(self):
global osplat, dsep
osplat = platform.system()
if osplat == "Windows":
dsep = "/"
if osplat == "Linux":
dsep = "/"
if osplat == "Darwin":
dsep = "/"
osplat = "OS X"
print(osplat)
if __name__ == '__main__':
app = QtWidgets.QApplication([])
gui = Main()
gui._getosplatform()
gui.show()
sys.exit(app.exec_())
