Re: [PyQt] Embedding a font into a resource file

2010-10-04 Thread pard
Thanks

On 4 October 2010 16:05, Hans-Peter Jansen  wrote:

> On Monday 04 October 2010, 15:49:07 pard wrote:
> > Hi
> >
> > Is it possible to embed a font into a resource file and set the
> > application font from the compiled resource file?
>
> You can add __any__ data to the resource file, but you should keep in mind,
> that this data is always loaded into memory on startup.
>
> Regarding an application font, you need to register it in the QFontDatabase
> and set it with QApplication.setFont() as the default font on startup.
>
> Hth,
> Pete
>
> ___
> 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] Embedding a font into a resource file

2010-10-04 Thread pard
Hi

Is it possible to embed a font into a resource file and set the application
font from the compiled resource file?

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

Re: [PyQt] pyuic4 vs uic.loadUI

2010-09-29 Thread pard
Hi All

Thanks for the replies, it's food for thought. I will be packaging my code
with py2exe. If there's a snag in packaging them correctly then perhaps it's
best for me to compile the ui. Unless of course someone has an idea as to
what could be Sebastian's problem. Loading the ui file does seem a whole lot
easier however, and having worked with wxpython and xrc, it wasn't much of a
paradigm shift for me I suppose. But hey, we live, we learn. And again,
thank you for the replies, if others still have more, please keep them
coming. They are helpful.

Pard

On 28 September 2010 22:10, Sebastian Elsner wrote:

>  Hmm interesting topic, I recently had to switch back from ui files to py
> files because I couldnt get py2exe to package the ui files correctly (Any
> help appreciated though)
> Secondly using ui files I loose the comfort of auto-completion with pydev
> and Eclipse, because pydev wouldnt know how to deal with the ui xml data. If
> there is anybody out there having advice on that, I'd gladly take it :)
>
>
> Am 28.09.2010 21:46, schrieb fpp:
>
>  On Tue, Sep 28, 2010 at 6:19 PM, pard  wrote:
>>
>>> Hi
>>> I have found that some people use pyuic4 to compile their ui files and
>>> some
>>> load them dynamically using loadUI.
>>> Does anyone have the pro's and con's of each of these methods? What is
>>> the
>>> recommended PyQT way of doing this?
>>>
>> Thanks for starting the discussion, I've often wondered myself. I have
>> no opinion one way or another, but since most seem to favour loadUI,
>> I'll play the devil's advocate for pyuic4 :-)
>>
>> I can think of several reasons to prefer compiled ui files :
>>
>> 1) if you're using eric4 as an IDE, it does everything for you, so why not
>> ?
>>
>> 2) on a reasonably recent PC, and for common UIs, the additional
>> launch time, CPU&  memory usage due to loadUI are probably not even
>> measurable, compared to the Python, Qt and PyQt startup load.
>> For extremely complex and widget-heavy UIs this might be less evident
>> : parsing XML is not the most efficient thing in the world after all.
>> And if we're running on mobile platforms with more limited
>> power/CPU/RAM and slow Flash I/O, like Nokia's Symbian or Maemo
>> smartphones, it could become quite perceptible.
>>
>> 3) during the early design phases, it's sometimes handy to be able to
>> manually modify a generated Python UI file, just to check out the
>> effect of some minor change, without having to do it in Designer
>> (especially if it involves sizers :-)
>>
>> 4) if for some reason you wish or need to distribute only binaries, as
>> sometimes happens, you can exclude the .ui source files and ship only
>> the UI .pyc/pyo files.
>> Dumb, yes, but not entirely impossible :-)
>> ___
>> 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 mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[PyQt] pyuic4 vs uic.loadUI

2010-09-28 Thread pard
Hi

I have found that some people use pyuic4 to compile their ui files and some
load them dynamically using loadUI.
Does anyone have the pro's and con's of each of these methods? What is the
recommended PyQT way of doing
this?

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

Re: [PyQt] Skinning the title bar and window border

2010-09-23 Thread pard
Thanks Devon

I will be looking at an example that Vincent Vande Vyvre suggested. Would
you mind if I contacted you for pointers if I get stuck, since you have some
experience in this?

Pard

On 22 September 2010 18:18, Devon Rueckner wrote:

>
> Hi -
>
> We had the same requirement.  Our solution was to use a frameless window
> (FramelessWindowHint) and implement our own chrome with event handling for
> title-bar moving, edge resizing, etc.
>
> Regards
> ~ Devon
>
>
> > -Original Message-
> > From: pyqt-boun...@riverbankcomputing.com [mailto:pyqt-
> > boun...@riverbankcomputing.com] On Behalf Of pard
> > Sent: Wednesday, September 22, 2010 6:48 AM
> > To: Hans-Peter Jansen
> > Cc: pyqt@riverbankcomputing.com
> > Subject: Re: [PyQt] Skinning the title bar and window border
> >
> > Hi Pete
> >
> > I understand why it is not popular. However, this is a requirement for
> > work purposes.
> > I had created a working program using wxpython for the gui, but the
> > client required a specific colour scheme, fonts, etc. I found that
> > wxpython was very restrictive when it comes to theming.
> >
> > PyQt uses stylesheets which make it much simpler to theme an
> > application. The only outstanding requirement is that the frame must be
> > the same theme as the application.
> > Marketing is quite adamant about this.
> >
> > I also understand that it would be better to start with the basics,
> > however, the deadline is also tight. If there are any resources which
> > would give pointers as to how to reconstruct the work of window
> > managers for my app it would be much appreciated.
> >
> > Pard
> >
> >
> > On 22 September 2010 12:32, Hans-Peter Jansen  wrote:
> >
> >
> >   On Wednesday 22 September 2010, 11:36:41 pard wrote:
> >   > Hi David
> >   >
> >   > Thanks for your response. Do you have any resources that would
> > show how
> >   > to do this? Tutorials, examples, etc.
> >   > I do need to change the style of the window frame.
> >
> >
> >   Doing that is not so popular, as it usually confuses your users
> > more than it
> >   is buying you. There's a reason, why all graphical operating
> > systems
> >   (including Windows, although their application developers usually
> > doesn't
> >   care a whit) try to provide an consistent user interface.
> >
> >
> >   > I am new to pyqt.
> >
> >
> >   Hmm, do you enter cars, when they move at 100 mph? If yes, how?
> >
> >   Seriously, start with the basics. If you master them, nothing
> > will stop you
> >   to reconstruct the work of window managers for you own
> > application.
> >
> >   Cheers,
> >   Pete
> >
> >   ___
> >   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] Skinning the title bar and window border

2010-09-23 Thread pard
Thanks for the reply Vincent. I will look at the example you mentioned.

On 22 September 2010 14:53, Vincent Vande Vyvre  wrote:

>  Le 22/09/10 13:31, Hans-Peter Jansen a écrit :
>
> [Sorry for mangling the receiver list - I prefer to keep this discussion on
> this list]
>
> On Wednesday 22 September 2010, 12:47:54 pard wrote:
>
>
>  Hi Pete
>
> I understand why it is not popular. However, this is a requirement for
> work purposes.
> I had created a working program using wxpython for the gui, but the
> client required a
> specific colour scheme, fonts, etc. I found that wxpython was very
> restrictive when it
> comes to theming.
>
>
>  Well, due to the multi layered nature of wxpython, it is very restrictive,
> when it comes to lower level tasks in general..
>
>
>
>  PyQt uses stylesheets which make it much simpler to theme an application.
> The only
> outstanding requirement is that the frame must be the same theme as the
> application.
> Marketing is quite adamant about this.
>
>
>  Yes, I know, usability is for wimps, real man conquer any dorky user
> interface derailments. [no _personal_ pun intended]
>
>
>
>  I also understand that it would be better to start with the basics,
> however, the deadline
> is also tight. If there are any resources which would give pointers as to
> how to
> reconstruct the work of window managers for my app it would be much
> appreciated.
>
>
>  I don't know of anything PyQt related. David?
>
> I would search for frameless Qt application sources. Thanks to PyQt's
> architecture (that makes almost everything of Qt accessible from Python),
> it's usually pretty simple to translate such code to Python.
>
> What's the aspirated target architecture?
>
> Pete
> ___
> PyQt mailing list
> p...@riverbankcomputing.comhttp://www.riverbankcomputing.com/mailman/listinfo/pyqt
>
>hi,
>
> In the examples provided with PyQt, try this script :
>
> /examples/widgets/windowflags.py
>
> --
> Vincent V.V.
> Oqapy <https://launchpad.net/oqapy>
>
> ___
> 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] Skinning the title bar and window border

2010-09-22 Thread pard
Hi Pete

I understand why it is not popular. However, this is a requirement for work
purposes.
I had created a working program using wxpython for the gui, but the client
required a
specific colour scheme, fonts, etc. I found that wxpython was very
restrictive when it
comes to theming.

PyQt uses stylesheets which make it much simpler to theme an application.
The only
outstanding requirement is that the frame must be the same theme as the
application.
Marketing is quite adamant about this.

I also understand that it would be better to start with the basics, however,
the deadline
is also tight. If there are any resources which would give pointers as to
how to
reconstruct the work of window managers for my app it would be much
appreciated.

Pard

On 22 September 2010 12:32, Hans-Peter Jansen  wrote:

> On Wednesday 22 September 2010, 11:36:41 pard wrote:
> > Hi David
> >
> > Thanks for your response. Do you have any resources that would show how
> > to do this? Tutorials, examples, etc.
> > I do need to change the style of the window frame.
>
> Doing that is not so popular, as it usually confuses your users more than
> it
> is buying you. There's a reason, why all graphical operating systems
> (including Windows, although their application developers usually doesn't
> care a whit) try to provide an consistent user interface.
>
> > I am new to pyqt.
>
> Hmm, do you enter cars, when they move at 100 mph? If yes, how?
>
> Seriously, start with the basics. If you master them, nothing will stop you
> to reconstruct the work of window managers for you own application.
>
> Cheers,
> Pete
> ___
> 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] Skinning the title bar and window border

2010-09-22 Thread pard
Hi David

Thanks for your response. Do you have any resources that would show how to
do this? Tutorials, examples, etc.
I do need to change the style of the window frame. I am new to pyqt.

Regards
Pard

On 21 September 2010 00:06, David Boddie  wrote:

> On Mon, 20 Sep 2010 14:42:55 +0200, pard wrote:
>
> > Is it possible to skin the title bar and window border in pyqt? I
> actually
> > just require a colour change, e.g. make the title bar, window border
> black,
> > have white text and change the colours of the close, minimize and
> maximize
> > buttons.
>
> This is not possible to do using PyQt on most platforms. This is a window
> manager or window system feature. If you really want to restyle the window,
> you might be able to make the window frameless
>
>  window.setWindowFlags(Qt.FramelessWindowHint)
>
> and draw your own window decorations. Of course, you will need to handle
> the buttons yourself. In situations like these, it's actually easier to
> give the window a specialized style than it is to make it look almost
> native, with just a few customizations.
>
> David
> ___
> 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] Skinning the title bar and window border

2010-09-20 Thread pard
Hi

Is it possible to skin the title bar and window border in pyqt? I actually
just require a colour change, e.g. make the title bar, window border black,
have white text and change the colours of the close, minimize and maximize
buttons.

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