본문 바로가기

PyQt5_47

Creating a macOS Disk Image Installer 39. Creating a macOS Disk Image Installer In a previous chapter we used PyInstaller to build a macOS .app file from our application. Opening this .app will run your application, and you can technically distribute it to other people as it is. However, there’s a catch — macOS .app files are actually just folders with a special extension. This means they aren’t suited for sharing as they are — end .. 2023. 3. 13.
Creating a Windows installer with InstallForge 38. Creating a Windows installer with InstallForge So far we’ve used PyInstaller to bundle applications for distribution. The output of this bundling process is a folder, named dist which contains all the files our application needs to run. While you could share this folder with your users as a ZIP file it’s not the best user experience. Windows desktop applications are normally distributed with.. 2023. 3. 13.
Packaging with PyInstaller 37. Packaging with PyInstaller PyInstaller is a cross-platform PyQt6 packaging system which supports building desktop applications for Windows, macOS and Linux. It automatically handles packaging of your Python applications, along with any associated libraries and data files, either into a standalone one-file executable or a distributable folder you can then use to create an installer. In this c.. 2023. 3. 13.
Working with command-line arguments 36. Working with command-line arguments If you have created an application which works with specific file types — for example a video editor that opens videos, a document editor that opens document files — it can be useful to have your application open these files automatically. On all platforms, when you tell the OS to open a file with a specific application, the filename to open is passed to t.. 2023. 3. 13.
Enums & the Qt Namespace 35. Enums & the Qt Namespace When you see a line like the following in your application, you might have wondered what the Qt.ItemDataRole.DisplayRole or Qt.ItemDataRole.CheckStateRole objects actually are. ë In earlier versions of PyQt there were also shortcut names such as Qt.DisplayRole, so you may still see these in code. In PyQt6 you must always use the long-form. All examples in this book u.. 2023. 3. 13.
System tray & macOS menus 34. System tray & macOS menus System tray applications (or menu bar applications) can be useful for making common functions available in a small number of clicks. For full desktop applications they’re a useful shortcut to control apps without opening up the whole window. Qt provides a simple interface for building cross-platform system tray (Windows) or menu bar (macOS) apps. Below is a minimal .. 2023. 3. 13.
Working with Relative Paths 33. Working with Relative Paths Paths describe the location of files in your filesystem. When we load external data files into our applications we typically do this using paths. While straightforward in principle, there are a couple of ways this can trip you up. As your applications grow in size, maintaining the paths can get a bit unwieldly and it’s worth taking a step back to implement a more .. 2023. 3. 13.
Extending Signals 2023. 3. 13.
Extending Signals 32. Extending Signals We’ve seen a basic introduction to signals already, but that only scratches the surface of what you can do with them. In this chapter we’ll look at how you can create your own signals and customize the data sent with them. Custom Signals So far we’ve only looked at signals that Qt itself provides on the built-in widgets. However, you can also make use of your own custom sig.. 2023. 3. 13.