Re: [PyQt] Mac OS X Problem: PyQT applications not focusing on launch

2009-09-25 Thread Alexei Puzikov
hello = HelloWorld()
hello.show()
hello.raise_() # this will raise the window on Mac OS X
sys.exit(app.exec_())


Given it's a Mac-only problem, which wasn't reproducible with Qt, only
PyQt, for me it looks like a PyQt bug. But the fix is quite easy.

A.

On Fri, Sep 25, 2009 at 5:16 PM, Holger Rapp r...@mrt.uka.de wrote:
 Hi,

 Every pyqt example I start under Mac OS X (PyQt 4.5.4, Python 2.6 from
 Python.org, Mac OS X 10.5.8), no matter which (I tried the delivered
 examples
 in the source distribution and also the examples from the python book [1], I
 also tried the eric IDE and spyder) fail to receive the focus when launched.
 A click is needed to raise the application. Sometimes the newly opened
 window
 is hidden under others.

 I am aware that I have to use pythonw (instead of python) for GUI scripts,
 but
 this doesn't change anything. After googling I read that I just have to
 bundle
 my scripts in .app packages because the issues is all Apples fault. I feel
 this is
 unelegant and most importantly: all wxpython applications RECEIVE the focus
 when launched (no matter if with python or pythonw), therefore there IS a
 way
 to make scripts open up GUI applications with focus. I give code examples
 for
 pyqt (no focus) and WXPython (receives focus) below my message.

 Maybe someone with more insight can shed some light on this problem.

 [1] http://www.qtrac.eu/pyqtbook.tar.gz

 Greetings,
 Holger

 --- SNIP ---
 # encoding: utf-8
 # wxPython example. This receives focus on launch.
 # Launch with
 # $ python hello_world_wx.py
 # File: hello_world_wx.py

 import wx
 app = wx.PySimpleApp()
 frame = wx.Frame(None, wx.ID_ANY, Hello World)
 frame.Show(True)
 app.MainLoop()
 --- SNAP ---

 --- SNIP ---
 # encoding: utf-8
 # pyqt example. This DOES NOT receives focus on launch.
 # Launch with
 # $ python hello_world_qt.py
 # or
 # $ pythonw hello_world_qt.py
 # Doesn't make a difference on my computer.
 # File: hello_world_qt.py

 from PyQt4 import QtCore, QtGui
 import sys

 class HelloWorld(QtGui.QWidget):
def __init__(self, parent=None):
super(HelloWorld, self).__init__(parent)

self.setWindowTitle(Hello World)

 app = QtGui.QApplication(sys.argv)
 hello = HelloWorld()
 hello.show()
 sys.exit(app.exec_())
 --- SNAP ---


 ___
 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] building QfMacNavBar on windows

2009-09-08 Thread Alexei Puzikov
Anil,

I have a Python translation at
http://code.google.com/p/cutebookshelf/source/browse/trunk/navbar.py

Hope this helps

Alexei

On Tue, Sep 8, 2009 at 12:59 PM, Anil Kumarani...@gmail.com wrote:
 Hi,
 Anybody successfully built QfMacNavBar from http://code.google.com/p/pyqt4-
 extrawidgets/ on windows?
 I would like to use it on one of my project, could not compile it.

 --
 --

 Regards,

 Anil K Thankappan

 ___
 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] Collapse/expand frame

2009-08-19 Thread Alexei Puzikov
I've done some testing. The majour problem here seems to be
QVBoxLayout is sending resizeEvent (or doing something else
that sends such event) to all the children widgets that has their own Layouts.

And this causes flickering.

Anybody can figure out why?

A.

On Fri, Aug 14, 2009 at 11:50 PM, Hans-Peter Jansenh...@urpla.net wrote:
 Am Freitag, 14. August 2009 schrieb Alexei Puzikov:
  Actually, you do, as soon as you'll pass over some amount of controls.
 
  I have the editor here that reimplements the screenshot (it's Maya,
  btw) and in worst situations contains approx. 4500 controls. And I'm
  still unable to remove
  flickering on switch - basically, the layout refresh.
 
  If anybody can prototype something that works with big amount of
  controls - his help would be enormous. Really.
 
  Hmm, Alexei, please don't feel offended, but presenting 4500 controls
  to user basically sounds like a pathologic situation, where _concepts_
  lost control ;-)...

 Well, it's probably Friday evening fluctuated my math a little bit -
 so, in worst case,
 it's 1500 controls. Which is actually pretty easy to achieve: 2
 spacers, label, editor and slider
 for each parameter.

 Ahh, okay, we're talking about 500 composite widgets then - which is where
 things start to get imaginable ;-)

  How is a user supposed to master that? Something similar to
  car navigation for the screen? (Take the second branch right, move
  mouse 200mm north, you reached your target, it's on the left side..)

 Well, that's what makes my job interesting :) Yes, it's a tough UI
 stuff. Filtering, proper
 grouping, good usable search, tagging, good documentation and most of
 all - good default values :)

  Even, if that widget, or control, if you like, is implemented in C++,
  as long as it is resizing itself, flickering cannot be suppressed,
  since it forces Qt to redraw the whole frame. I would start looking,
  how to get the whole thing into managable pieces. Next you may try to
  use a home grown layout manager, that is optimized for these cases
  (e.g. moves screen areas, but that's going to be tough, don't it?)

 I'm not sure. What actually bugs me is that layout engine is
 repainting the widgets
 that's haven't changed their geometry. Given how many layouts I have,
 this flickers

 You think this might be overwritten?...

 What I had in mind was a layout manager, that's being aware of the
 situation: repaint only small screen areas (the widget, that is resizing
 itself), and copying the unchanged screen areas around, its doable but
 that's going to be a tough job, I assume.

 Pete

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


Re: [PyQt] Collapse/expand frame

2009-08-14 Thread Alexei Puzikov
 Actually, you do, as soon as you'll pass over some amount of controls.

 I have the editor here that reimplements the screenshot (it's Maya, btw)
 and in worst situations contains approx. 4500 controls. And I'm still
 unable to remove
 flickering on switch - basically, the layout refresh.

 If anybody can prototype something that works with big amount of controls
 - his help would be enormous. Really.

 Hmm, Alexei, please don't feel offended, but presenting 4500 controls to
 user basically sounds like a pathologic situation, where _concepts_ lost
 control ;-)...

Well, it's probably Friday evening fluctuated my math a little bit -
so, in worst case,
it's 1500 controls. Which is actually pretty easy to achieve: 2
spacers, label, editor and slider
for each parameter.

 How is a user supposed to master that? Something similar to
 car navigation for the screen? (Take the second branch right, move mouse
 200mm north, you reached your target, it's on the left side..)

Well, that's what makes my job interesting :) Yes, it's a tough UI
stuff. Filtering, proper
grouping, good usable search, tagging, good documentation and most of
all - good default values :)

 Even, if that widget, or control, if you like, is implemented in C++, as
 long as it is resizing itself, flickering cannot be suppressed, since it
 forces Qt to redraw the whole frame. I would start looking, how to get the
 whole thing into managable pieces. Next you may try to use a home grown
 layout manager, that is optimized for these cases (e.g. moves screen areas,
 but that's going to be tough, don't it?)

I'm not sure. What actually bugs me is that layout engine is
repainting the widgets
that's haven't changed their geometry. Given how many layouts I have,
this flickers

You think this might be overwritten?...

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


Re: [PyQt] Collapse/expand frame

2009-08-13 Thread Alexei Puzikov
Well - have you tried to do that with 1500 controls?

A.

On Fri, Aug 14, 2009 at 9:24 AM, Håvard Gulldahlhav...@lurtgjort.no wrote:
 On Thu, Aug 13, 2009 at 7:51 PM, Scott Ballardsc...@scottballard.net wrote:
 I'm really looking for a frame that has the collapse/expand ability built
 into it. See the image in the link. You can see the Texture Map submenu
  collapsed/expanded. Any thoughts?

 www.scottballard.net/collapsibleFrame.jpg


 I've done something similar, sans the arrow. I have a checkable
 QGroupBox, whose sole child is a QFrame with no borders. All the
 widgets I put into the QFrame. Then I connect the toggled(bool) signal
 of the group box to the frame's setShown(bool) slot. That way, the
 QFrame is hidden when the QGroupBox is un-checked. And you can do it
 all from the Qt Designer: less hand-written code, yay!

 Originally I meant to figure out how to customize the QGroupBox so
 that it has an arrow (like in the example you're referencing) and not
 a cross, but it's not high on the list. The check box works fine, IMO.

 Cheers,

 Håvard


 Many thanks!
 -Scott


 Hans-Peter Jansen wrote:

 Am Mittwoch, 12. August 2009 schrieb Scott Ballard:


 Does anyone know of a way to collapse/expand a frame or a group box that
 contains widgets in it? I don't see anything in the docs or Google about
 it, but it would seem like something common.


 Try .hide()/.show() resp. .setVisible(bool)

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

 __ Information from ESET NOD32 Antivirus, version of virus
 signature database 4330 (20090812) __

 The message was checked by ESET NOD32 Antivirus.

 http://www.eset.com







 __ Information from ESET NOD32 Antivirus, version of virus signature
 database 4332 (20090813) __

 The message was checked by ESET NOD32 Antivirus.

 http://www.eset.com


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




 --
 Håvard Gulldahl hav...@gulldahl.no
 Telefon: 9971 0615
 http://lurtgjort.no/

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


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


Re: [PyQt] Collapse/expand frame

2009-08-13 Thread Alexei Puzikov
 I'm really looking for a frame that has the collapse/expand ability
 built into it. See the image in the link. You can see the Texture Map
 submenu  collapsed/expanded. Any thoughts?

 www.scottballard.net/collapsibleFrame.jpg

 I see - why don't you BYO. This kind of widget is uncommon, and thus the
 reason not being available already.

 But it's pretty easy to combine basic widgets to a composite one. And due to
 Qts powerful layout machinery, you mostly don't need to care about the
 implicit widget resize.

Actually, you do, as soon as you'll pass over some amount of controls.

I have the editor here that reimplements the screenshot (it's Maya, btw) and
in worst situations contains approx. 4500 controls. And I'm still
unable to remove
flickering on switch - basically, the layout refresh.

If anybody can prototype something that works with big amount of controls - his
help would be enormous. Really.

A.

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


[PyQt] Soft-hyphen (SHY) support in QtWebkit embedded into PyQt app

2009-07-11 Thread Alexei Puzikov
Hello,

I'm loading http://www.cs.tut.fi/~jkorpela/shytest.html into the
QWebView, and it does break up the words correctly, but
doesn't show the actual hyphens at the right margin of the text.

It's even worse for Russian language texts - it actually break the
words that's in the middle of paragraph, not at the hyphenation
border.
And again - no hyphens visible.

The tests are OK in standalone Safari, Konqueror and FF3. Reproducible
with PyQt under Qt 4.4 and Qt 4.5.

Anybody can advise?

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


Re: [PyQt] PyQt application appears always in the background

2009-06-11 Thread Alexei Puzikov
This seems to be something with PyQt, because C++ Qt applications
don't have this problem.

What helps with the situation is:

window.show()
window.raise_()

Cheers,

Alexei

On Thu, Jun 11, 2009 at 6:26 PM, Michael
Heldmichael.h...@bc.biol.ethz.ch wrote:
 hi,

 my PyQt application appears always in the background (the last window in
 the stack of all Mac applications) which is annoying since I want so see
 my app on top of all other windows.
 is there any PyQt or system option?

 I am running PyQt4.5 + Python2.6 on MacOS 10.5.

 thanks a lot!
 michael

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


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


Re: [PyQt] node graph widgets?

2009-05-07 Thread Alexei Puzikov
Nothing standard, however it's actually pretty easy to implement
either with GraphicsScene or OpenGL surface.

Latter is exactly what I've did.

Alexei

 Does anyone know if Qt (PyQt) offer any widgets for creating a node graph
 with connections between the nodes? A quick Google search didn't turn up
 much.

 Thanks,
 -Scott
 ___
 PyQt mailing list    p...@riverbankcomputing.com
 http://www.riverbankcomputing.com/mailman/listinfo/pyqt


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


[PyQt] Transparent QTreeWidget over the QtOpenGL.QGLWidget

2008-12-04 Thread Alexei Puzikov
Hello,

The question seems to be simple, but I've spent some time
experimenting and reading docs already without good results.

So.

I have QGLWidget in my window and QTreeWidget is parented to it. Now
what I want is for QTreeWidget background to become transparent
so that I'll be able to see my GL stuff and tree items painted over
it. What I'm getting instead is either standard background or just
black color.

Any ideas?

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


[PyQt] QWidget event == no more GC for QWidget?

2008-07-21 Thread Alexei Puzikov
Hello,

Quick question: if I uncomment the moveEvent in the code below, the
destructor isn't called anymore.
I suspect I'm doing something wrong or missing something - anybody can
clear the things up?

I'm on Python 2.5.1 (r251:54863, Jun 25 2008, 10:21:16)
[GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)] on linux2

 QtCore.PYQT_VERSION_STR
'4.3.3'

Thanks

Alexei

#

import sys
from PyQt4 import QtCore, QtGui

class Window(QtGui.QWidget):
   def __init__(self, selectedShader = None):
   QtGui.QWidget.__init__(self, None)
   #self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
   
self.resize(QtCore.QSize(QtCore.QRect(0,0,400,300).size()).expandedTo(self.minimumSizeHint()))

   def __del__(self):
   print Window destructor called

   #def moveEvent(self, event):
   #print move

app = QtGui.QApplication(sys.argv)
window = Window()
window.show()
app.exec_()
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt