[PyQt] "Lower bound is not a time version" Error by sip

Phil Thompson phil at riverbankcomputing.com
Sat Oct 17 10:56:10 BST 2015


On 17 Oct 2015, at 10:51 a.m., hadi M <hm.qtprogrammer at gmail.com> wrote:
> 
> Hello to PyQt People
> 
> am having a problem with pyqt/sip
>  I trying to wrap simple sip class tutorial
> 
> Header file is :
> 
> // Define the interface to the hello library.
>  
> #include <qlabel.h>
> #include <qwidget.h>
> #include <qstring.h>
>  
> class Hello : public QLabel {
>     // This is needed by the Qt Meta-Object Compiler.
>     Q_OBJECT
>  
> public:
>     Hello(QWidget *parent = 0);
>  
> private:
>     // Prevent instances from being copied.
>     Hello(const Hello &);
>     Hello &operator=(const Hello &);
> };
>  
> #if !defined(Q_OS_WIN)
> void setDefault(const QString &def);
> #endif
>  
> And .sip files is :
>  
> // Define the SIP wrapper to the hello library.
>  
> %Module hello
>  
> %Import QtGui/QtGuimod.sip
>  
> %If (Qt_4_2_0 -)
>  
> class Hello : public QLabel {
>  
> %TypeHeaderCode
> #include <hello.h>
> %End
>  
> public:
>     Hello(QWidget *parent /TransferThis/ = 0);
>  
> private:
>     Hello(const Hello &);
> };
>  
> %If (!WS_WIN)
> void setDefault(const QString &def);
> %End
>  
> %End
>  
> When I use this command “sip –c . hello.sip to generate cpp wrapper it gives me this error
> “Lower bound is not a time version”
> I use pyqt5 and paython 3.5 with qt5.4.1
>  
> I don’t know how fix it?

PyQt5 doesn't know anything about Qt4 so remove the %If (Qt_4_2_0 -) and the corresponding %End.

Phil



More information about the PyQt mailing list