[PyQt] Delaying splash screen

2011-09-07 Thread admin

  
  
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

2011-09-07 Thread admin

  
  
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

2011-09-07 Thread Nick Gaens
Can you please specify *what line* this AttributeError is pointing at?

On Wed, Sep 7, 2011 at 14:04, ad...@mbnoimi.net wrote:

  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 sysclass 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, 

Re: [PyQt] Delaying splash screen

2011-09-07 Thread admin

  
  
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

2011-09-07 Thread admin

  
  
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

2011-09-07 Thread Raoul Snyman
On Wed, 07 Sep 2011 16:20:11 +0300, ad...@mbnoimi.net wrote:
 The only missing thing in eric is good auto completion just like wing or
 eclipse.

If you have the API files loaded, and you select the document and API
files option, Eric's autocompletion is decent enough for general PyQt4
development. It would be nice if it could index the files in your project
too, but I can handle it as it is.

-- 
Raoul Snyman, B.Tech IT (Software Engineering)
Saturn Laboratories
m: 082 550 3754
e: raoul.sny...@saturnlaboratories.co.za
w: www.saturnlaboratories.co.za
b: blog.saturnlaboratories.co.za
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Professional IDE

2011-09-07 Thread Mailing List SVR

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



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


___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] Professional IDE

2011-09-07 Thread admin

  
  
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

Re: [PyQt] Professional IDE

2011-09-07 Thread Detlev Offenbach
Am Mittwoch, 7. September 2011, 15:25:36 schrieb Raoul Snyman:
 On Wed, 07 Sep 2011 16:20:11 +0300, ad...@mbnoimi.net wrote:
  The only missing thing in eric is good auto completion just like wing or
  eclipse.
 
 If you have the API files loaded, and you select the document and API
 files option, Eric's autocompletion is decent enough for general PyQt4
 development. It would be nice if it could index the files in your project
 too, but I can handle it as it is.

eric already does this since long ago. Just install the eric assistant plug-
in via the respective dialogs and make it the autocompletion and calltips 
provider (via the config dialog).

Regards,
Detlev
-- 
Detlev Offenbach
det...@die-offenbachs.de
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Professional IDE

2011-09-07 Thread Timothy W. Grove
I'm using a combination of Eclipse + PyDev and I like it a lot. Here is 
a critique of it from another forum which convinced me to give it a try:


   I searched around the web quite a bit and found Eclipse+PyDev to
   be the most recommended IDE overall. I downloaded just the basic
   52MB Eclipse (eclipse-platform-3.7RC4-win32.zip, no installation
   needed) since it's smaller and I read online that it runs faster.
   Then I added PyDev to it.

   It detected my existing installations (For the sake of NLTK and
   other libraries, I had bit the bullet and installed Python 2.7 in
   parallel with 3.2) and looked capable of handling IronPython as well.

   So far, I'm very impressed with its features for debugging, code
   completion, code checking, and speeding up repetitive tasks. It also
   keeps track of multiple Python engines and grammars (one of each
   per project). It can do path configuration so one project can
   apparently be listed as a resource for another project for easy
   importing, but I wasn't able to get this set up properly (yet). And
   I don't see a way to have this update my Windows environment
   variable (PythonPath), so I still have to tweak that sometimes when
   running stuff from the Windows command line.

   It doesn't seem to allow launching/debugging of Python files that
   are not part of a project in Eclipse, probably because the
   interpreter and path would be undefined. It can edit these files,
   however (with syntax highlighting but not code completion, I think). 

I also liked an IDE called Spyder2 
(http://code.google.com/p/spyderlib/; 
http://packages.python.org/spyder/) which integrates very well with 
PyQt4 (it's a requirement), but I had to look for another when I moved 
to Python 3.


Best regards,
Tim Grove

On 07/09/2011 13:11, ad...@mbnoimi.net wrote:


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
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] Professional IDE

2011-09-07 Thread Knacktus

Am 07.09.2011 15:20, schrieb ad...@mbnoimi.net:

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.


They both have PyQt integration. See e.g.

http://wingware.com/doc/howtos/pyqt




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


___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[PyQt] Error in PyQt 4.8.5 Build on OS X 10.7.1

2011-09-07 Thread EDoxtator
Hi All

I’m encountering a build issue for PyQt 4.8.5  (Qt 4.74) on OS X 10.7.1 that’s 
got me a bit jiggered.  I’m a newbie to the list, and I hope you’ll forgive me 
for jumping right in...

If I do the following:

1. Run configure.py

python configure.py -q /Users/edoxtator/QtSDK/Simulator/qt/gcc/bin/qmake -d 
/Library/Frameworks/Python.framework/Versions/Current/lib/python2.7/site-packages
 -g --use-arch x86_64


I get the following:
Checking to see if the QtGui module should be built...
Checking to see if the QtHelp module should be built...
Checking to see if the QtMultimedia module should be built...
Checking to see if the QtNetwork module should be built...
Checking to see if the QtDeclarative module should be built...
Checking to see if the QtOpenGL module should be built...
Checking to see if the QtScript module should be built...
Checking to see if the QtScriptTools module should be built...
Checking to see if the QtSql module should be built...
Checking to see if the QtSvg module should be built...
Checking to see if the QtTest module should be built...
Checking to see if the QtWebKit module should be built...
Checking to see if the QtXml module should be built...
Checking to see if the QtXmlPatterns module should be built...
Checking to see if the phonon module should be built...
Checking to see if the QtAssistant module should be built...
QtDesigner module disabled with static Qt libraries.
Qt v4.7.4 free edition is being used.
Qt is built as a framework.
SIP 4.12.4 is being used.
The Qt header files are in /Users/edoxtator/QtSDK/Simulator/Qt/gcc/include.
The static Qt libraries are in /Users/edoxtator/QtSDK/Simulator/Qt/gcc/lib.
The Qt binaries are in /Users/edoxtator/QtSDK/Simulator/Qt/gcc/bin.
The Qt mkspecs directory is in /Users/edoxtator/QtSDK/Simulator/Qt/gcc/.
These PyQt modules will be built: QtCore, QtGui, QtMultimedia, QtNetwork,
QtDeclarative, QtOpenGL, QtScript, QtScriptTools, QtSql, QtSvg, QtTest,
QtWebKit, QtXml, QtXmlPatterns, phonon.
The PyQt Python package will be installed in
/Library/Frameworks/Python.framework/Versions/Current/lib/python2.7/site-packages.
PyQt is being built with generated docstrings.
PyQt is being built with 'protected' redefined as 'public'.
The Designer plugin will be installed in
/Users/edoxtator/QtSDK/Simulator/Qt/gcc/plugins/designer.
The PyQt .sip files will be installed in
/Library/Frameworks/Python.framework/Versions/2.7/share/sip/PyQt4.
pyuic4, pyrcc4 and pylupdate4 will be installed in
/Library/Frameworks/Python.framework/Versions/2.7/bin.
Generating the C++ source for the QtCore module...
Creating the Makefile for the QtCore module...
Generating the C++ source for the QtDeclarative module...
Creating the Makefile for the QtDeclarative module...
Generating the C++ source for the QtGui module...
Creating the Makefile for the QtGui module...
Generating the C++ source for the QtMultimedia module...
Creating the Makefile for the QtMultimedia module...
Generating the C++ source for the QtNetwork module...
Creating the Makefile for the QtNetwork module...
Determining the OpenGL data types...
Generating the C++ source for the QtOpenGL module...
Creating the Makefile for the QtOpenGL module...
Generating the C++ source for the QtScript module...
Creating the Makefile for the QtScript module...
Generating the C++ source for the QtScriptTools module...
Creating the Makefile for the QtScriptTools module...
Generating the C++ source for the QtSql module...
Creating the Makefile for the QtSql module...
Generating the C++ source for the QtSvg module...
Creating the Makefile for the QtSvg module...
Generating the C++ source for the QtTest module...
Creating the Makefile for the QtTest module...
Generating the C++ source for the QtWebKit module...
Creating the Makefile for the QtWebKit module...
Generating the C++ source for the QtXml module...
Creating the Makefile for the QtXml module...
Generating the C++ source for the QtXmlPatterns module...
Creating the Makefile for the QtXmlPatterns module...
Generating the C++ source for the phonon module...
Creating the Makefile for the phonon module...
Generating the C++ source for the Qt module...
Creating the Makefile for the Qt module...
Generating the C++ source for the _qt module...
Creating the Makefile for the _qt module...
Creating QScintilla API file...
Creating top level Makefile...
Creating QPy support library for QtDeclarative Makefile...
Creating QPy support library for QtCore Makefile...
Creating QPy support library for QtGui Makefile...
Creating QPy support library for QtOpenGL Makefile...
Creating QPy support libraries Makefile...
Creating pyuic4 wrapper...
Creating pyuic4 Makefile...
Creating pylupdate4 Makefile...
Creating pyrcc4 Makefile...
Creating pyqtconfig.py...

Which seems to be OK.  I guess.

2. Next, I run:

make

Which gives me
lots of build statements, until...

g++ -c -pipe -fPIC -O2 -Wall -W -DNDEBUG -DSIP_PROTECTED_IS_PUBLIC 
-Dprotected=public -DQT_NO_DEBUG -DQT_PHONON_LIB 

Re: [PyQt] Delaying splash screen

2011-09-07 Thread Hans-Peter Jansen
On Wednesday 07 September 2011, 14:04:02 ad...@mbnoimi.net wrote:
 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 *

Hmm, that * imports are easily avoided.

 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):

You need to call the base class c'tor here, e.g.:

  super(QFrame, self).__init__()

Most of your code below has issues with missing self. references, which 
will result in access to undefined variables and instances, that are 
prematurely garbarge collected.


 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()
  ^

and so on...

Pete
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Professional IDE

2011-09-07 Thread Muhammad Bashir Al-Noimi

  
  
On 07/09/2011 10:07 م, Knacktus wrote:
  Am
07.09.2011 15:20, schrieb ad...@mbnoimi.net:

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.
  


They both have PyQt integration. See e.g.


http://wingware.com/doc/howtos/pyqt
  


  See what wing says:

  
Wing IDE doesn't currently include a GUI builder for PyQt but
  it can be used
  with an external GUI builder. Wing will automatically reload
  files that are
  written by the GUI builder, making for a fairly seamless
  integration.
  
  it hasn't eric's PyQt integration at all.


  
  -
  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

2011-09-07 Thread Muhammad Bashir Al-Noimi

  
  
On 07/09/2011 11:27 م, Hans-Peter
  Jansen wrote: 

  On Wednesday 07 September 2011, 14:04:02 ad...@mbnoimi.net wrote:

  
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 *

  
  Hmm, that * imports are easily avoided.

Thanks a lot Pete, You mean I don't need to use both import lines?


  

  
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):

  
  You need to call the base class c'tor here, e.g.:

	  super(QFrame, self).__init__()

Most of your code below has issues with missing self. references, which 
will result in access to undefined variables and instances, that are 
prematurely garbarge collected.

I did as you mentioned exactly.
I got new issue because I don't know how can I use QStringList
class, I read in some article that it's unavailable in PyQt so I
tried to use python lists instead but I got an exception at for loop

TypeError object of type int has no len()
here's the modified class:
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):
super(QFrame,  self).__init__()
self.sPixmap =  pixmap
self.setWindowFlags(Qt.FramelessWindowHint|Qt.WindowStaysOnTopHint)
self.setAttribute(Qt.WA_TranslucentBackground)
self.setFixedSize(self.sPixmap.size())
   
def clearMessage(self):
self.sMessage.clear()
self.repaint()
   
def showMessage(self,  theMessage, theAlignment, theColor):
self.sMessage  = theMessage
self.sAlignment = theAlignment
self.sColor  = theColor
self.repaint()
   
def paintEvent(self, pe):
aTextRect = QRect(self.rect())
aTextRect.setRect(aTextRect.x()+5, aTextRect.y()+5, aTextRect.width()-10, aTextRect.height()-10)
aPainter = QPainter(self)
aPainter.drawPixmap(self.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)



-
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

2011-09-07 Thread Juan Pablo Romero Méndez
I've been using PyCharm for about a year now. It's the best python IDE IMHO.

Plus, during september they are selling it at 50% discount.

Regards,

  Juan Pablo

2011/9/7  ad...@mbnoimi.net:
 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 list    PyQt@riverbankcomputing.com
 http://www.riverbankcomputing.com/mailman/listinfo/pyqt

___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Professional IDE

2011-09-07 Thread Knacktus

Am 07.09.2011 23:06, schrieb Muhammad Bashir Al-Noimi:

On 07/09/2011 10:07 م, Knacktus wrote:


Am 07.09.2011 15:20, schrieb ad...@mbnoimi.net:

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.


They both have PyQt integration. See e.g.

http://wingware.com/doc/howtos/pyqt



See what wing says:


Wing IDE doesn't currently include a GUI builder for PyQt but it can
be used with an external GUI builder. Wing will automatically reload
files that are written by the GUI builder, making for a fairly
seamless integration.


it hasn't eric's PyQt integration at all.


What does eric do to integrate more with PyQt?
(I tested eric 2 years ago. So I might not be up to date of what you 
mean with PyQt integration. Does is provide it's own GUI builder?)








-
Best Regards
Muhammad Bashir Al-Noimi
My Blog: http://mbnoimi.net



___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt