0

I have developed an application with pyqt5 and it is working fine on windows but when i run this app on mac osx it's graphics are not working fine like the layout of the buttons, labels and other stuff are not showing perfectly.

I have created app in PyQt5 and using Cx_freeze i made executable for windows as well as mac osx.

I tried py2app also still on mac side my application is not working.

Nilanj
  • 101
  • 12
  • 1
    Since there's zero code here and we can only guess what might be going wrong you need to add at least a *minimal* amount of code to explain the situation and help others reproduce your problem. – tadman Jul 14 '17 at 06:21
  • If you do not show your code it is impossible to help you, to ask a good question you should read the following: https://stackoverflow.com/help/how-to-ask – eyllanesc Jul 14 '17 at 06:27
  • I have developed an application with pyqt5 and it is working fine on windows but when i run this app on mac osx it's graphics are not working fine like the layout of the buttons, labels and other stuff are not showing perfectly. – eyllanesc Jul 14 '17 at 06:30
  • I can't post the code, the thing is when I run the app on client's MacBook than only it not work properly, but it is working on my MacBook, I guess this is nothing to do with code. – Nilanj Jul 14 '17 at 07:05
  • If it works fine on your Mac, but not on your client's, then I would say the problem is you and your client are running different versions of pyqt. Your client may be using a lower version than you, which may account for slight graphical differences. – Nelson Jul 14 '17 at 07:45
  • @Nelson actually after building mac app , this problem occurs, cause i don't force them to install pyqt and other dependencies on their mac. i tried building mac app using py2app and cx_freeze. – Nilanj Jul 14 '17 at 08:27
  • Yes, you are correct. py2app and cx_freeze would bundle the required dependencies, making whether they have the same version of pyqt irrelevant. You should post screenshots of the correct and incorrect GUIs. Or at least provide more detail of how the GUI is displaying incorrectly. – Nelson Jul 14 '17 at 08:31

2 Answers2

2

Actually, this is because the base of graphics are different for Windows and OSX and every other operating systems (I don't know much about graphics), here what I did so that it is working now.

QApplication.setStyle('Fusion')
app = QApplication(sys.argv)
display = myclass()
display.show()
display.start()
sys.exit(app.exec_())

Before that I did not set the style to 'Fusion', there are other window styles as well look at this information. , with the help of this setStyle API we can change graphics of Linux app to windows or others.

Miriam Farber
  • 18,986
  • 14
  • 61
  • 76
Nilanj
  • 101
  • 12
0

Most of the default styling of qt widgets are derived from the OS or the interface that you are using, try changing some style sheet properties to get the desired layout and since there are no code, I can't pinpoint to what can be done to change.

Nevin Baiju
  • 305
  • 3
  • 18