The Following 5 Users Say Thank You to robin92 For This Useful Post: | ||
![]() |
2011-06-13
, 00:54
|
Posts: 1,086 |
Thanked: 2,964 times |
Joined on Jan 2010
|
#2
|
python your_simpsons_main_filename.py
"WARNING: Phonon needs QCoreApplication::applicationName to be set to export audio output names through the DBUS interface."
if __name__ == "__main__": app = QApplication(sys.argv) QApplication.setApplicationName("Simpsons Sounds") ... rest of the file... etc
![]() |
2011-06-13
, 03:25
|
|
Posts: 476 |
Thanked: 438 times |
Joined on Nov 2010
@ Sweden
|
#3
|
Traceback (most recent call last): File "main.py", line 40, in <module> QApplication.setApplicationName("Simpsons sounds") NameError: name 'QApplication' is not defined
"WARNING: Phonon needs QCoreApplication::applicationName to be set to export audio output names through the DBUS interface."
![]() |
2011-06-13
, 09:08
|
Posts: 1,086 |
Thanked: 2,964 times |
Joined on Jan 2010
|
#4
|
Hi!
I get this after your command, It stand
And before I getCode:Traceback (most recent call last): File "main.py", line 40, in <module> QApplication.setApplicationName("Simpsons sounds") NameError: name 'QApplication' is not defined
btw how i fix porttrait?Code:"WARNING: Phonon needs QCoreApplication::applicationName to be set to export audio output names through the DBUS interface."
from PyQt4.QtGui import QApplication
![]() |
2011-06-13
, 17:40
|
|
Posts: 2,448 |
Thanked: 9,523 times |
Joined on Aug 2010
@ Wigan, UK
|
#5
|
![]() |
2011-06-13
, 19:08
|
|
Posts: 2,448 |
Thanked: 9,523 times |
Joined on Aug 2010
@ Wigan, UK
|
#6
|
![]() |
2011-06-13
, 21:25
|
|
Posts: 476 |
Thanked: 438 times |
Joined on Nov 2010
@ Sweden
|
#7
|
OK. I made a few changes to the source code:
1. Changed the .wav file paths to relative paths, e.g sounds/example.wav.
2. Corrected some typos in the 'sounds' dictionary (renamed from 'farts').
3. Removed status bar (not needed).
4. Added a Homer Simpson icon to the push button.
5. Implemented auto-rotation.
6. Set application name to 'Simpson Sounds'. Volume can now be changed using the hardware volume controls.
I have attached the modified source code and icon.
![]() |
2011-06-13
, 21:41
|
|
Posts: 2,448 |
Thanked: 9,523 times |
Joined on Aug 2010
@ Wigan, UK
|
#8
|
![]() |
2011-06-13
, 22:02
|
|
Posts: 476 |
Thanked: 438 times |
Joined on Nov 2010
@ Sweden
|
#9
|
I learned PyQt from this book: http://www.qtrac.eu/pyqtbook.html
However, I would probably recommend learning QML for coding user interfaces, at least for mobile platforms. You can still use PyQt for the backend stuff, although for something like Simpson Sounds, it would be just as easy to do everything in QtQuick using JavaScript. I can port your Simpsons Sounds using QtQuick, and post the code here, so you can observe the differences.
The Following User Says Thank You to robin92 For This Useful Post: | ||
![]() |
2011-06-13
, 22:21
|
|
Posts: 400 |
Thanked: 76 times |
Joined on Nov 2009
@ uk
|
#10
|
OK. I made a few changes to the source code:
1. Changed the .wav file paths to relative paths, e.g sounds/example.wav.
2. Corrected some typos in the 'sounds' dictionary (renamed from 'farts').
3. Removed status bar (not needed).
4. Added a Homer Simpson icon to the push button.
5. Implemented auto-rotation.
6. Set application name to 'Simpson Sounds'. Volume can now be changed using the hardware volume controls.
I have attached the modified source code and icon.
I have worked on an easy simpson sound app
Some bugs but this is my first pyqt
Hope you like it
btw I need some help with the sound so it work with hardware buttons. Now I onlye write set volume 0.3 in pyqt :/ You cant change the volume ;(