Comments (2)
Components are designed with the assumption that re-drawing the preview happens after some "tracked value" (usually the content of a widget) changes.
Normally the component's update
method does cause the preview to re-render, but it will only do so if the output of the component's savePreset
method changes... this is a dictionary of tracked values.
The simplest way to get the preview to re-render, is to put the image URL into a Qwidget (could be an invisible one). Use the trackWidgets
method as described in step 3 of component creation.
Something like
def widget(self, *args):
super().widget(*args)
self.page.pushButton_GetNew.clicked.connect(self.getNewImage)
self.trackWidgets({
'imagePath': self.page.label_imagePath,
'tags': self.page.lineEdit_tags,
})
Then this component would have the properties imagePath
and tags
.
The getNewImage
method can get the value of self.tags
and ask Unsplash for an image path, then set the value of the tracked Qwidget (self.page.label_imagePath
in my hypothetical) which will automatically set the value of self.imagePath
and trigger the preview to re-render. And this should make the component work with the project system and undo system, I think.
Thanks for your interest in the program and don't hesitate to ask more questions! I'll try to respond a bit sooner next time :)
from audio-visualizer-python.
ah, that worked! alright, thanks for letting me know how it works, and i'll be sure to reach out if i have any more questions! thanks for the help!
from audio-visualizer-python.
Related Issues (20)
- Relative positioning and dimensions for everything HOT 2
- setup.py broken in feature-newgui branch HOT 17
- Video component causes inaccurate progress bar HOT 4
- TypeError: 'QByteArray' does not have the buffer interface HOT 1
- Undo/redo functionality HOT 1
- No module named 'PyQt4' HOT 6
- Running the main.py shows segmentation fault!!!
- Problem
- Repo Name
- TypeError - video_thread.py tries to join a string and an int HOT 1
- Color issue HOT 2
- Changing the location of the visual effects HOT 1
- Add a screenshot and a demo video on YouTube. HOT 1
- An Appimage version of the appliacation HOT 1
- Make v2 (newgui) installable HOT 2
- Crash when exporting video in GUI mode
- Outdated macOS installation instructions
- Waveform component is too sensitive/fast
- Conway's component does not prevent infinite growth
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 audio-visualizer-python.