[PyQt] [SOLVED]Re: pylupdate4 issue
On 26/02/2012 06:54 م, Detlev Offenbach wrote: Am Sonntag, 26. Februar 2012, 15:56:54 schrieb Vincent Vande Vyvre: Le 26/02/12 15:16, ad...@mbnoimi.net a écrit : On 19/02/2012 09:55 م, Vincent Vande Vyvre wrote: Le 19/02/12 19:55, ad...@mbnoimi.net a écrit : On 19/02/2012 08:22 م, ad...@mbnoimi.net wrote: Hi all, I tried to create *.ts file for my project by using pylupdate4 so I tried the following commad but it didn't work! pylupdate4 *.py -ts %CD%\ui\l10n\ar.ts pylupdate4 error: Cannot open file '*.py': No error Could you please guide me to the correct path? PS I successfully created *.ts file for single *.py file. I forgot to mention that I want to create single *.ts file for many *.py files You must provide a .pro file to pyludate4 exemple of .pro file SOURCES= main.py\ ui_mainWindow.py\ otherFile.py\ etc TRANSLATIONS= appName_ar.ts CODECFORTR = UTF-8 CODECFORSRC = UTF-8 I don't want to use .pro because I've many files in many subdirecories which is very exhausting to write manually. Any ideas guys? -- Best Regards Muhammad Bashir Al-Noimi My Blog: http://mbnoimi.net So, You can easily write a python script which will create the .pro file for you. No? You could copy the relevant code from the eric4/eric5 sources (module ProjectLanguagesBrowser). Thanks... it works. -- Best Regards Muhammad Bashir Al-Noimi My Blog: http://mbnoimi.net ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] pylupdate4 issue
On 19/02/2012 09:55 م, Vincent Vande Vyvre wrote: Le 19/02/12 19:55, ad...@mbnoimi.net a écrit : On 19/02/2012 08:22 م, ad...@mbnoimi.net wrote: Hi all, I tried to create *.ts file for my project by using pylupdate4 so I tried the following commad but it didn't work! pylupdate4 *.py -ts %CD%\ui\l10n\ar.ts pylupdate4 error: Cannot open file '*.py': No error Could you please guide me to the correct path? PS I successfully created *.ts file for single *.py file. I forgot to mention that I want to create single *.ts file for many *.py files You must provide a .pro file to pyludate4 exemple of .pro file SOURCES = main.py\ ui_mainWindow.py\ otherFile.py\ etc TRANSLATIONS = appName_ar.ts CODECFORTR = UTF-8 CODECFORSRC = UTF-8 I don't want to use .pro because I've many files in many subdirecories which is very exhausting to write manually. Any ideas guys? -- Best Regards Muhammad Bashir Al-Noimi My Blog: http://mbnoimi.net ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] pylupdate4 issue
On 19/02/2012 09:55 م, Vincent Vande Vyvre wrote: Le 19/02/12 19:55, ad...@mbnoimi.net a écrit : On 19/02/2012 08:22 م, ad...@mbnoimi.net wrote: Hi all, I tried to create *.ts file for my project by using pylupdate4 so I tried the following commad but it didn't work! pylupdate4 *.py -ts %CD%\ui\l10n\ar.ts pylupdate4 error: Cannot open file '*.py': No error Could you please guide me to the correct path? PS I successfully created *.ts file for single *.py file. I forgot to mention that I want to create single *.ts file for many *.py files You must provide a .pro file to pyludate4 exemple of .pro file SOURCES = main.py\ ui_mainWindow.py\ otherFile.py\ etc TRANSLATIONS = appName_ar.ts CODECFORTR = UTF-8 CODECFORSRC = UTF-8 I don't want to use .pro because I've many files in many subdirecories which is very exhausting to write manually. -- Best Regards Muhammad Bashir Al-Noimi My Blog: http://mbnoimi.net ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[PyQt] pylupdate4 issue
Hi all, I tried to create *.ts file for my project by using pylupdate4 so I tried the following commad but it didn't work! pylupdate4 *.py -ts %CD%\ui\l10n\ar.ts pylupdate4 error: Cannot open file '*.py': No error Could you please guide me to the correct path? PS I successfully created *.ts file for single *.py file. -- Best Regards Muhammad Bashir Al-Noimi My Blog: http://mbnoimi.net ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] pylupdate4 issue
On 19/02/2012 08:22 م, ad...@mbnoimi.net wrote: Hi all, I tried to create *.ts file for my project by using pylupdate4 so I tried the following commad but it didn't work! pylupdate4 *.py -ts %CD%\ui\l10n\ar.ts pylupdate4 error: Cannot open file '*.py': No error Could you please guide me to the correct path? PS I successfully created *.ts file for single *.py file. I forgot to mention that I want to create single *.ts file for many *.py files -- Best Regards Muhammad Bashir Al-Noimi My Blog: http://mbnoimi.net ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] Instant translation on PyQt 4.8.6
On 31/12/2011 04:42 م, Phil Thompson wrote: On Sat, 31 Dec 2011 14:57:29 +0200, ad...@mbnoimi.net wrote: On 29/12/2011 12:12 م, Phil Thompson wrote: Then that implies that there is a second problem. Attached is the pyuic4 output from your .ui file. You need to provide a short complete test that demonstrates any outstanding problem. Phil In the attachment you can find short complete demo. If I click on the "Chane Language" button then all the English text changes to Arabic and the "TextLabel" text moves to the right. What else is supposed to happen? Phil Oh I'm very sorry... the demo works well which means the bug has been resolved in the new version. I think there is another problem in my application. I'll try to investigate more to see what if it's a bug or something wrong in my code. Sorry guys for disturbing :-[ -- Best Regards Muhammad Bashir Al-Noimi My Blog: http://mbnoimi.net ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] Instant translation on PyQt 4.8.6
On 21/12/2011 07:12 م, Phil Thompson wrote: On Wed, 21 Dec 2011 19:03:56 +0200, ad...@mbnoimi.net wrote: On 10/12/2011 03:15 م, Phil Thompson wrote: On Sat, 10 Dec 2011 12:55:09 +0200, ad...@mbnoimi.net [1] wrote: On 10/12/2011 12:47 م, Phil Thompson wrote: I think there might be a pyuic4 regression related to retranslation. What version were you using that seemed to work? Can you send me a .ui file that seems to have the problem? By the way, I didn't face this problem with C++/Qt for same Qt version Thanks - will be fixed in tonight's snapshot. Did you fixed it? if yes is there any binary distro (I still unable to build snapshot on Windows :-( )? I said I'd fixed it. There will be a new binary release later this week. Phil This issue still exist in current version (PyQt-Py2.7-x86-gpl-4.9-1) -- Best Regards Muhammad Bashir Al-Noimi My Blog: http://mbnoimi.net ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] Instant translation on PyQt 4.8.6
On 10/12/2011 03:15 م, Phil Thompson wrote: On Sat, 10 Dec 2011 12:55:09 +0200, ad...@mbnoimi.net wrote: On 10/12/2011 12:47 م, Phil Thompson wrote: I think there might be a pyuic4 regression related to retranslation. What version were you using that seemed to work? Can you send me a .ui file that seems to have the problem? By the way, I didn't face this problem with C++/Qt for same Qt version Thanks - will be fixed in tonight's snapshot. Did you fixed it? if yes is there any binary distro (I still unable to build snapshot on Windows :-( )? -- Best Regards Muhammad Bashir Al-Noimi My Blog: http://mbnoimi.net ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] Instant translation on PyQt 4.8.6
On 21/12/2011 07:12 م, Phil Thompson wrote: On Wed, 21 Dec 2011 19:03:56 +0200, ad...@mbnoimi.net wrote: On 10/12/2011 03:15 م, Phil Thompson wrote: On Sat, 10 Dec 2011 12:55:09 +0200, ad...@mbnoimi.net [1] wrote: On 10/12/2011 12:47 م, Phil Thompson wrote: I think there might be a pyuic4 regression related to retranslation. What version were you using that seemed to work? Can you send me a .ui file that seems to have the problem? By the way, I didn't face this problem with C++/Qt for same Qt version Thanks - will be fixed in tonight's snapshot. Did you fixed it? if yes is there any binary distro (I still unable to build snapshot on Windows :-( )? I said I'd fixed it. There will be a new binary release later this week. Phil Oh thanks a lot. Sorry for disturbing but I asked you an\bout the new release because current release has 2 bugs: Instant Translation CornerWidget in QMenuBar -- Best Regards Muhammad Bashir Al-Noimi My Blog: http://mbnoimi.net ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[PyQt] Instant translation on PyQt 4.8.6
Hi guys, I was using the following function for re-translate my application at runtime but after compiling my application with new PyQt version it became need to be restarted... do you know what's wrong? PS Layout changing works perfectly. def languageChange(self): translator = QTranslator(self) currentLangFile = QString(":/l10n/%1.qm").arg(self.getLang()) if not translator.load(currentLangFile): print QString("Couldn't load language file") widget = QWidget(self) if self.lang == 'ar': print 'isAr' qApp.setLayoutDirection(Qt.RightToLeft) QLocale.setDefault(QLocale(QLocale.Arabic, QLocale.SyrianArabRepublic)) for widget in qApp.allWidgets(): widget.setLayoutDirection(Qt.RightToLeft) else: print 'isEn' qApp.setLayoutDirection(Qt.LeftToRight) for widget in qApp.allWidgets(): widget.setLayoutDirection(Qt.LeftToRight) qApp.installTranslator(translator) self.retranslateUi(self) -- Best Regards Muhammad Bashir Al-Noimi My Blog: http://mbnoimi.net ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] Instant translation on PyQt 4.8.6
On 10/12/2011 12:47 م, Phil Thompson wrote: I think there might be a pyuic4 regression related to retranslation. What version were you using that seemed to work? Can you send me a .ui file that seems to have the problem? By the way, I didn't face this problem with C++/Qt for same Qt version -- Best Regards Muhammad Bashir Al-Noimi My Blog: http://mbnoimi.net ?xml version=1.0 encoding=UTF-8? ui version=4.0 classLoginDialog/class widget class=QDialog name=LoginDialog property name=windowModality enumQt::WindowModal/enum /property property name=geometry rect x0/x y0/y width337/width height308/height /rect /property property name=sizePolicy sizepolicy hsizetype=Fixed vsizetype=Fixed horstretch0/horstretch verstretch0/verstretch /sizepolicy /property property name=minimumSize size width200/width height0/height /size /property property name=maximumSize size width449/width height16777215/height /size /property property name=windowTitle stringLogin/string /property property name=windowIcon iconset normaloff/ /iconset /property layout class=QVBoxLayout name=verticalLayout_2 property name=spacing number1/number /property property name=margin number1/number /property item widget class=QStackedWidget name=stackedWidget property name=currentIndex number0/number /property widget class=QWidget name=page layout class=QVBoxLayout name=verticalLayout property name=spacing number1/number /property property name=margin number1/number /property item widget class=QLabel name=label_login property name=pixmap pixmap resource=../Common/common.qrc:/ui/images/login.png/pixmap /property property name=scaledContents booltrue/bool /property /widget /item item layout class=QGridLayout property name=margin number5/number /property property name=spacing number6/number /property item row=0 column=1 widget class=QLineEdit name=uiUserName/ /item item row=1 column=0 widget class=QLabel name=label_4 property name=sizePolicy sizepolicy hsizetype=Preferred vsizetype=Fixed horstretch0/horstretch verstretch0/verstretch /sizepolicy /property property name=text stringamp;Password:/string /property property name=alignment setQt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter/set /property property name=buddy cstringuiPassword/cstring /property /widget /item item row=1 column=1 widget class=QLineEdit name=uiPassword property name=echoMode enumQLineEdit::Password/enum /property /widget /item item row=0 column=0 widget class=QLabel name=label_3 property name=sizePolicy sizepolicy hsizetype=Preferred vsizetype=Fixed horstretch0/horstretch verstretch0/verstretch /sizepolicy /property property name=text stringamp;Username:/string /property property name=alignment setQt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter/set /property property name=buddy cstringuiUserName/cstring /property /widget /item /layout /item item layout class=QHBoxLayout name=horizontalLayout_4 property name=sizeConstraint enumQLayout::SetDefaultConstraint/enum /property item widget class=QToolButton name=toolButton_arabic property name=sizePolicy sizepolicy hsizetype=Minimum vsizetype=Minimum horstretch0/horstretch verstretch0/verstretch /sizepolicy /property property name=text stringamp;ط¹ظâ¬Ø¸â¬Ø·Â±Ø·Â¨Ø¸â¬Ø¸â¬Ø¸Ù¹/string /property property name=icon iconset resource=../Common/common.qrc normaloff:/ui/images/flagsyria.png/normaloff:/ui/images/flagsyria.png/iconset /property property name=iconSize size width56/width height56/height /size /property property name=checkable booltrue/bool /property property name=autoExclusive booltrue/bool /property property name=toolButtonStyle enumQt::ToolButtonIconOnly/enum /property /widget
Re: [PyQt] setCornerWidget for QMenuBar build Snapshots
On 10/12/2011 02:03 م, Phil Thompson wrote: Probably still something hanging around from your previous installation. I have retested this specific case in the last day or two without problems. I don't think this related to previous installation because I installed fresh Windows installation (thank to VirtualBox :-D ). -- Best Regards Muhammad Bashir Al-Noimi My Blog: http://mbnoimi.net ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] setCornerWidget for QMenuBar build Snapshots
On 10/12/2011 03:17 م, Phil Thompson wrote: Maybe not, but it's still related to your installation. There was one message that implied that the version of the Python header files did not match the version of the Python interpreter. I downloaded today's latest snapshot but I got same problem! Python 2.7.2 sip-4.13.1-snapshot-7ab562ae0e39 PyQt-win-gpl-snapshot-4.9-aea28dc027e5 Do you know what if PyQt folks want to create a new release fixing setCornerWidget issue? Or I've to build the snapshot by myself. -- Best Regards Muhammad Bashir Al-Noimi My Blog: http://mbnoimi.net ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] setCornerWidget for QMenuBar build Snapshots
On 06/12/2011 09:32 م, Phil Thompson wrote: Snapshots are only provided as source packages I tried to build the snapshots as following but I failed... could you please help me in building process? Build steps: Downloaded sip-4.13.1-snapshot-82af71f0adcb Configured SIP then built it Downloaded PyQt-win-gpl-snapshot-4.9-aea28dc027e5 Configured PyQt Downloaded NSIS Run nsi Here's builing logs: --- SIP --- Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Users\mbnoimi\Desktop\sip-4.13.1-snapshot-82af71f0adcbpath PATH=C:\Python27\Lib\site-packages\PyQt4;C:\Python27\Lib\site-packages\;C:\QtSDK \mingw\bin;C:\Python27\Scripts;C:\Python27;C:\Program Files\NVIDIA Corporation\P hysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\S ystem32\WindowsPowerShell\v1.0\;C:\Program Files\doxygen\bin;C:\Program Files\Wi nMerge;C:\Program Files\Bazaar;C:\Program Files\Microsoft SQL Server\100\Tools\B inn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\ C:\Users\mbnoimi\Desktop\sip-4.13.1-snapshot-82af71f0adcbpython configure.py This is SIP 4.13.1-snapshot-82af71f0adcb for Python 2.7.2 on win32. The SIP code generator will be installed in C:\Python27. The sip module will be installed in C:\Python27\Lib\site-packages. The sip.h header file will be installed in C:\Python27\include. The default directory to install .sip files in is C:\Python27\sip. The platform/compiler configuration is win32-msvc2008. Creating siplib\sip.h... Creating siplib\siplib.c... Creating siplib\siplib.sbf... Creating sipconfig.py... Creating top level Makefile... Creating sip code generator Makefile... Creating sip module Makefile... C:\Users\mbnoimi\Desktop\sip-4.13.1-snapshot-82af71f0adcbpython configure.py -- platform win32-g++ This is SIP 4.13.1-snapshot-82af71f0adcb for Python 2.7.2 on win32. The SIP code generator will be installed in C:\Python27. The sip module will be installed in C:\Python27\Lib\site-packages. The sip.h header file will be installed in C:\Python27\include. The default directory to install .sip files in is C:\Python27\sip. The platform/compiler configuration is win32-g++. Creating siplib\sip.h... Creating siplib\siplib.c... Creating siplib\siplib.sbf... Creating sipconfig.py... Creating top level Makefile... Creating sip code generator Makefile... Creating sip module Makefile... C:\Users\mbnoimi\Desktop\sip-4.13.1-snapshot-82af71f0adcbminggw32-make 'minggw32-make' is not recognized as an internal or external command, operable program or batch file. C:\Users\mbnoimi\Desktop\sip-4.13.1-snapshot-82af71f0adcbmingw32-make mingw32-make[1]: Entering directory `C:/Users/mbnoimi/Desktop/sip-4.13.1-snapsho t-82af71f0adcb/sipgen' makefile:29: warning: overriding commands for target `.c.o' makefile:26: warning: ignoring old commands for target `.c.o' gcc -c -O2 -w -DNDEBUG -DUNICODE -DQT_LARGEFILE_SUPPORT -I. -o main.o main.c gcc -c -O2 -w -DNDEBUG -DUNICODE -DQT_LARGEFILE_SUPPORT -I. -o transform.o trans form.c gcc -c -O2 -w -DNDEBUG -DUNICODE -DQT_LARGEFILE_SUPPORT -I. -o gencode.o gencode .c gcc -c -O2 -w -DNDEBUG -DUNICODE -DQT_LARGEFILE_SUPPORT -I. -o extracts.o extrac ts.c gcc -c -O2 -w -DNDEBUG -DUNICODE -DQT_LARGEFILE_SUPPORT -I. -o export.o export.c gcc -c -O2 -w -DNDEBUG -DUNICODE -DQT_LARGEFILE_SUPPORT -I. -o heap.o heap.c gcc -c -O2 -w -DNDEBUG -DUNICODE -DQT_LARGEFILE_SUPPORT -I. -o parser.o parser.c gcc -c -O2 -w -DNDEBUG -DUNICODE -DQT_LARGEFILE_SUPPORT -I. -o lexer.o lexer.c g++ -mthreads -Wl,-enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runt ime-pseudo-reloc -Wl,-subsystem,console -Wl,-s -o sip.exe main.o transform.o gen code.o extracts.o export.o heap.o parser.o lexer.o mingw32-make[1]: Leaving directory `C:/Users/mbnoimi/Desktop/sip-4.13.1-snapshot -82af71f0adcb/sipgen' mingw32-make[1]: Entering directory `C:/Users/mbnoimi/Desktop/sip-4.13.1-snapsho t-82af71f0adcb/siplib' makefile:29: warning: overriding commands for target `.c.o' makefile:26: warning: ignoring old commands for target `.c.o' gcc -c -O2 -w -DNDEBUG -DUNICODE -DQT_LARGEFILE_SUPPORT -I. -IC:\Python27\includ e -o siplib.o siplib.c gcc -c -O2 -w -DNDEBUG -DUNICODE -DQT_LARGEFILE_SUPPORT -I. -IC:\Python27\includ e -o apiversions.o apiversions.c gcc -c -O2 -w -DNDEBUG -DUNICODE -DQT_LARGEFILE_SUPPORT -I. -IC:\Python27\includ e -o descriptors.o descriptors.c gcc -c -O2 -w -DNDEBUG -DUNICODE -DQT_LARGEFILE_SUPPORT -I. -IC:\Python27\includ e -o qtlib.o qtlib.c gcc -c -O2 -w -DNDEBUG -DUNICODE -DQT_LARGEFILE_SUPPORT -I. -IC:\Python27\includ e -o threads.o threads.c gcc -c -O2 -w -DNDEBUG -DUNICODE -DQT_LARGEFILE_SUPPORT -I. -IC:\Python27\includ e -o objmap.o objmap.c gcc -c -O2 -w -DNDEBUG -DUNICODE -DQT_LARGEFILE_SUPPORT -I. -IC:\Python27\includ e -o voidptr.o voidptr.c g++ -c -O2 -w -DNDEBUG -DUNICODE -DQT_LARGEFILE_SUPPORT -I. -IC:\Python27\includ e -o bool.o bool.cpp g++
[PyQt] setCornerWidget for QMenuBar
Hi PyQt Gurus, I tried to use setCornerWidget in QMenuBar but I got a compiler error as mentioned below: Does QMenuBar supports Corner Widget? ---log--- AttributeError "QMenuBar" object no attribute "setCornerWidget" - -- Best Regards Muhammad Bashir Al-Noimi My Blog: http://mbnoimi.net ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] setCornerWidget for QMenuBar
On 06/12/2011 07:54 م, Phil Thompson wrote: It's fixed in the current snapshot. Thx Phil Do I need to build the snapshot or it's available as Windows binary somewhere? -- Best Regards Muhammad Bashir Al-Noimi My Blog: http://mbnoimi.net ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[PyQt] No module named
Hi All, I've created a project by Eric its structure as following: http://i.stack.imgur.com/fgpFa.jpg I can run it successfully in the IDE by specifying (http://i.stack.imgur.com/vskbO.jpg): - "c:\trunk" as working directory - "MyProject\main.py" as main script but it I can't run it by command line because I get: ImportError: No module named package1.Settings PS I added "c:\trunk\Project" to system path (see run.bat please): set PATH=%PATH%;%CD% python MyProject\main.py pause here is the running log: C:\trunkset PATH=C:\Python26\Lib\site-packages\PyQt4\bin;C:\Python26\Scripts;C:\Python26;C:\Program Files\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Bazaar;C:\ProgramFiles\doxygen\bin;C:\Program Files\WinMerge;C:\trunk C:\trunkpython MyProject\main.py Traceback (most recent call last): File "MyProject\main.py", line 17, in module from MyProject.package1.Settings import Settings File "C:\trunk\MyProject\main.py", line 17, in module from MyProject.package1.Settings import Settings ImportError: No module named package1.Settings -- Best Regards Muhammad Bashir Al-Noimi My Blog: http://mbnoimi.net ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] [Eric] No module named
Hi All, I've created a project by Eric its structure as following: http://i.stack.imgur.com/fgpFa.jpg I can run it successfully in the IDE by specifying (http://i.stack.imgur.com/vskbO.jpg): - "c:\trunk" as working directory - "MyProject\main.py" as main script but it I can't run it by command line because I get: ImportError: No module named package1.Settings PS I added "c:\trunk\Project" to system path (see run.bat please): set PATH=%PATH%;%CD% python MyProject\main.py pause here is the running log: C:\trunkset PATH=C:\Python26\Lib\site-packages\PyQt4\bin;C:\Python26\Scripts;C:\Python26;C:\Program Files\NVIDIA Corporation\PhysX\Common;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Bazaar;C:\ProgramFiles\doxygen\bin;C:\Program Files\WinMerge;C:\trunk C:\trunkpython MyProject\main.py Traceback (most recent call last): File "MyProject\main.py", line 17, in module from MyProject.package1.Settings import Settings File "C:\trunk\MyProject\main.py", line 17, in module from MyProject.package1.Settings import Settings ImportError: No module named package1.Settings -- Best Regards Muhammad Bashir Al-Noimi My Blog: http://mbnoimi.net ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[PyQt] Loading default language
Hi All, I tried to use multi-language for my application but after loading any language the default language (English) didn't appear!? Do I need to create en.qm/ts just like any other language or I can load the default language by some command? here is a snippet of my code: def getLang(self): if self.lang == 3: return QString("en") elif self.lang == 31: return QString("ar") elif self.lang == 32: return QString("tr") else: return QString("en") def languageChange(self): translator = QTranslator(self) currentLang = QString(":/l10n/%1.qm").arg(self.getLang()) if not translator.load(currentLang): print QString("Couldn't load language file") widget = QWidget(self) if self.lang == 31: qApp.setLayoutDirection(Qt.RightToLeft) QLocale.setDefault(QLocale(QLocale.Arabic, QLocale.SyrianArabRepublic)) for widget in QApplication.allWidgets(): widget.setLayoutDirection(Qt.RightToLeft) else: qApp.setLayoutDirection(Qt.LeftToRight) for widget in qApp.allWidgets(): widget.setLayoutDirection(Qt.LeftToRight) qApp.installTranslator(translator) self.retranslateUi(self) def on_toolButton_english_clicked(self): self.lang = 3 self.languageChange() self.toolButton_english.setChecked(1) def on_toolButton_arabic_clicked(self): self.lang = 31 self.languageChange() self.toolButton_arabic.setChecked(1) def on_toolButton_turkish_clicked(self): self.lang = 32 self.languageChange() self.toolButton_turkish.setChecked(1) -- Best Regards Muhammad Bashir Al-Noimi My Blog: http://mbnoimi.net ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[PyQt] PlastiqueStyle issue
Hi, Where can I find QPlastiqueStyle class? I tried to use from PyQt4.QtGui import QPlastiqueStyle and app.setStyle("Plastique") sty = QPlastiqueStyle() app.setPalette(sty.standardPalette()) but I got import error. what's wrong? -- Best Regards, Muhmmad Bashir Al-Noimi Desktop/Embedded developer TAIBA SOFT co. http://taiba-soft.com Aleppo - Syria ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] PlastiqueStyle issue
On 18/09/2011 04:27 , Vincent Vande Vyvre wrote: Le 18/09/11 15:19, ad...@mbnoimi.net a crit: Hi, No specific import is required for style app = QtGui.QApplication(sys.argv) app.setStyle(QtGui.QStyleFactory.create("plastique")) Actually I want to use default palette of Platique style for that I've to create a new object from QPlastiqueStyle then call setPallete function as I mentioned below sty = QPlastiqueStyle() app.setPalette(sty.standardPalette()) -- Best Regards Muhammad Bashir Al-Noimi My Blog: http://mbnoimi.net ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] PlastiqueStyle issue
On 18/09/2011 05:18 م, Tayfun Kayhan wrote: It seems there is no QPlastiqueStyle class in PyQt Class Ref, whereas there exists one in Qt Class Ref : http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/classes.html http://doc.trolltech.com/4.7/qplastiquestyle.html I noticed that too, for that I posted my question. -- Best Regards Muhammad Bashir Al-Noimi My Blog: http://mbnoimi.net ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[PyQt] Delaying splash screen
Hi guys, I wrote a tiny class for delaying splash screen in C++ but when I tired to re-write it in python it didn't work! I got "AttributeError TeSplashScreen object has no attribut QFrate" although TeSplashScreen inherited from QFrame Could you please help me, I'm still a newbie in PyQt and Python. tesplashscreen.py from PyQt4.QtCore import * from PyQt4.QtGui import * import sys class TeSplashScreen(QFrame): """ Splash doc """ app = QApplication(sys.argv) sPixmap = QPixmap(10, 10) sMessage = QString() messages = ["nothing"] sAlignment = 0 sColor = QColor() def __init__(self, pixmap): self.sPixmap = pixmap self.QFrame(self, Qt.FramelessWindowHint|Qt.WindowStaysOnTopHint) self.setAttribute(Qt.WA_TranslucentBackground) self.setFixedSize(sPixmap.size()) def clearMessage(self): sMessage.clear() repaint() def showMessage(self, theMessage, theAlignment, theColor): self.sMessage = theMessage self.sAlignment = theAlignment self.sColor = theColor repaint() def paintEvent(self, pe): aTextRect(rect()) aTextRect.setRect(aTextRect.x()+5, aTextRect.y()+5, aTextRect.width()-10, aTextRect.height()-10) aPainter = QPainter(self) aPainter.drawPixmap(rect(), self.sPixmap) aPainter.setPen(self.sColor) aPainter.drawText(aTextRect, self.sAlignment, self.sMessage) def showSplash(self, delay, messages, alignment, color): delay = 0 self.messages = messages alignment = 0 color = QColor(color) class SleeperThread(QThread): msecs = 0 QThread.msleep(msecs) aSplashScreen = TeSplashScreen(self.sPixmap) aSplashScreen.show for i in range(len(messages)): aSplashScreen.showMessage(messages[i], alignment, color) SleeperThread.msleep(delay) #def showSplash(delay, messages, alignment, color): #delay = 0 #messages = QStringList() #alignment = 0 #color = QColor() #class SleeperThread(QThread): #msecs = 0 #QThread.msleep(msecs) #aSplashScreen = TeSplashScreen(sPixmap) #aSplashScreen.show() #for i in range(messages.count()): #aSplashScreen.showMessage(messages[i], alignment, color) #SleeperThread.msleep(delay) tesplashscreen.h #ifndef TSPLASHSCREEN_H #define TSPLASHSCREEN_H #include QFrame #include QPainter #include QThread class TeSplashScreen : public QFrame { public: TeSplashScreen(const QPixmap pixmap); void showMessage(const QString theMessage, int theAlignment = Qt::AlignLeft, const QColor theColor = Qt::black); void showSplash(int delay, QStringList messages, int alignment = Qt::AlignLeft, const QColor color = Qt::black); void showSplash(QListint delaies, int defaultDelay, QStringList messages, int alignment = Qt::AlignLeft, const QColor color = Qt::black); private: virtual void paintEvent(QPaintEvent* pe); void clearMessage(); QPixmap sPixmap; QString sMessage; int sAlignment; QColor sColor; }; #endif // TSPLASHSCREEN_H tesplashscreen.cpp #include "tesplashscreen.h" TeSplashScreen::TeSplashScreen(const QPixmap thePixmap) : QFrame(0, Qt::FramelessWindowHint|Qt::WindowStaysOnTopHint) , sPixmap(thePixmap) { setAttribute(Qt::WA_TranslucentBackground); setFixedSize(sPixmap.size()); }; void TeSplashScreen::clearMessage() { sMessage.clear(); repaint(); } void TeSplashScreen::showMessage(const QString theMessage, int theAlignment, const QColor theColor) { sMessage = theMessage; sAlignment = theAlignment; sColor = theColor; repaint(); } void TeSplashScreen::paintEvent(QPaintEvent* pe) { QRect aTextRect(rect()); aTextRect.setRect(aTextRect.x()+5, aTextRect.y()+5, aTextRect.width()-10, aTextRect.height()-10); QPainter aPainter(this); aPainter.drawPixmap(rect(), sPixmap); aPainter.setPen(sColor); aPainter.drawText(aTextRect, sAlignment, sMessage); } void TeSplashScreen::showSplash(int delay, QStringList messages, int alignment, const QColor color) { class SleeperThread : public QThread { public: static void msleep(unsigned long msecs) {QThread::msleep(msecs);} }; TeSplashScreen* aSplashScreen = new TeSplashScreen(sPixmap); aSplashScreen-show(); for(int i=0; imessages.count();++i) { aSplashScreen-showMessage(messages[i], alignment, color); SleeperThread::msleep(delay); } delete aSplashScreen; } void TeSplashScreen::showSplash(QListint delaies, int defaultDelay, QStringList messages, int alignment, const QColor color) { class SleeperThread : public QThread { public: static void msleep(unsigned
[PyQt] Professional IDE
Hi guys, I know this is traditional question but I really didn't find any alternatives to Qt Creator or eclipse for PyQt do you know any IDE works fine just like eclipse or Qt Creator? PS I tried to use eric but I found its auto completion so bad specially for newbie like me. -- Best Regards Muhammad Bashir Al-Noimi My Blog: http://mbnoimi.net ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] Delaying splash screen
On 07/09/2011 03:57 , Nick Gaens wrote: Can you please specify what linethis AttributeError is pointing at? self.QFrame(self, Qt.FramelessWindowHint|Qt.WindowStaysOnTopHint) -- Best Regards Muhammad Bashir Al-Noimi My Blog: http://mbnoimi.net ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] Professional IDE
On 07/09/2011 03:18 م, 机械唯物主义 : linjunhalida wrote: I use emacs... you can try wing ide: http://wingware.com/ Actually I found eclipse better than wing but both of them don't have PyQt integration just like eric. The only missing thing in eric is good auto completion just like wing or eclipse. PS Project management auto completion are perfect in eclipse. -- Best Regards Muhammad Bashir Al-Noimi My Blog: http://mbnoimi.net ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] Professional IDE
On 07/09/2011 04:53 , Mailing List SVR wrote: Il 07/09/2011 15:20, ad...@mbnoimi.net ha scritto: On 07/09/2011 03:18 , : linjunhalida wrote: I use emacs... you can try wing ide: http://wingware.com/ Actually I found eclipse better than wing but both of them don't have PyQt integration just like eric. The only missing thing in eric is good auto completion just like wing or eclipse. you can use pydev to make eclipse a python IDE too: http://pydev.org/ Nicola Sue, I meant pydev when I mentioned eclipse. -- Best Regards Muhammad Bashir Al-Noimi My Blog: http://mbnoimi.net ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt