Comments (3)
Just took me 45 min to figure this out myself. Here's the cause of the problem: The menuTray
method in your example creates QAction
objects. The problem is that once the method exits, the Python interpreter believes that these objects are no longer needed (because they are not referenced by any other Python code; They're only referenced by Qt). One solution is to save the actions in @cached_property
s:
@cached_property
def menuTray(self):
menu = QMenu()
menu.addAction(self.action)
menu.addAction(self.action2)
return menu
@cached_property
def action(self):
return QAction("A menu item")
@cached_property
def action2(self):
return QAction("Menu item 2")
An alternative solution might be a function called sip.transferTo
.
from fbs.
Thanks @mherrmann ! The first solution worked.
from fbs.
Glad I could help :-)
from fbs.
Related Issues (20)
- UnicodeDecodeError: 'utf-8' codec can't decode byte 0xba in position 114: invalid start byte HOT 1
- Pro -- Updates beyond 1 year? HOT 2
- I want to use Sparkle Is that okay
- freeze on macOS Monterey gives warnings HOT 7
- Sentry exception events occurring in main thread are not flushed to Sentry (fbs Pro feature) HOT 3
- Double-clicking <AppName>.app does not launch application on macOS HOT 1
- fbs installer encoding issue + different error messages in and out of IDE
- Icons in src/main/icons are not carried over into the installation HOT 1
- PyInstaller >= 5.6 does not require `_fix_sparkle_delta_updates()` when freezing on MacOS HOT 2
- Issue with openpyxl library when running fbs freeze HOT 1
- FBS with Pyqt6 HOT 4
- "fbs freeze" does not work with the default program HOT 8
- When Running fbs release get cannot upload HOT 1
- FBS cannot find makensis even though it is installed HOT 2
- (Pro) No module named 'fbs_runtime.application_context' when running app that was released via buildvm/runvm HOT 6
- installer exe permission HOT 3
- fbs buildvm ubuntu command failing HOT 3
- QTabwidget Tab text area is white when selected, nothing can be seen HOT 3
- fbs pro experiencing problems with PySide2 (`no module named 'inspect'`) HOT 2
- how to build x86_64 and arm64 target on macos in Apple M1 chip
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fbs.