RE: [PyKDE] QTable, selections and moving column headers
On 20-Nov-02 greg landrum wrote: > On Tue, 2002-11-19 at 19:57, Jim Bublitz wrote: > Yeah, that's a better solution. The filling code I provided is > just what came out of pyuic. I wanted a quick and simple demo. I figured something like that, but you never know. Besides, I had an answer for that (if not your other questions) :) > Selection: > Even with setSelectionMode(QTable.Single) called, left clicking > on the column/row headers results in the entire column/row being > highlighted. Similarly, clicking to set a cell, then > shift-clicking elsewhere results in the highlighted region > expanding. I have to admit that I am just assuming that > highlighted = selected. Highlighted and selected are slightly different - I think I have this right: Highlighted is a visual property you can see on the screen, selected means the cell(s) have the property of being selected, as in having a flag set or being in a list of selected items. For a single cell, being selected means being highlighted, but I don't believe that for multiple cells, being highlighted means all being selected. Anyway, in your program or the tablestatistics.py program in examples3/, I can highlight groups of cells regardless of setSelectionMode. You'd have to read back cell, row, or column properties to see if they're selected. I also tried setDragEnabled but couldn't drag anything - the table was editable too, and reading back all of the properties gave the correct values. I think the highlighting behavior is normal (?) for QTable, although I haven't tried it with C++. Looking at my code, I wanted to be able to highlight a single row (currently selected row - whatever row the cursor was in) and nothing else, and I ended up subclassing and overloading QTableItem.paint() to do it. IIRC, it's been this way over several PyQt versions, and I suspect it's Qt behavior. On the column/row moving I don't have an answer. > Column/Row Moving: > Left clicking on a column/row header and then dragging results in > the selection being expanded as the mouse cursor drags to new > columns/rows (again, I'm defining "selection" to be > "highlighted region"). No dragging occurs. >> The only other thing I can think of at the moment is to make >> sure the QTable gets focus (look at focusPolicy, setFocus in the >> Qt docs). > I think that focus is being obtained (because I can move the > selection around, drag stuff out, etc. Just to be sure, I tried > adding a call to setFocusPolicy(QWidget.StrongFocus), but that > didn't change any of the behavior described above. That seems right - I got the same thing. Not very helpful - sorry. You might try Qt support and see if they have better answers (maybe try a C++ version also if you can). Jim ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.gmd.de/mailman/listinfo/pykde
RE: [PyKDE] Kudos and Questions from a New Convert
On 20-Nov-02 John Bell wrote: I can't answer all of your questions, as I'm not much of a RAD or GUI-designer user myself. I haven't checked KDevelop's support for Python lately, but there wasn't much last time I looked. I don't have the link handy for the most recent 'eric' screenshots, but it's an integrated editor/debugger/class browser and more and should be released in the near future (there's an existing version that's pretty nice, but the new version will blow you away). It's part of the PyQt distribution at the moment and Python/PyQt based. google on Detlev Offenbach and eric. > (3) I don't want to start a war here, but is PyKDE as > mature/complete as PyQt? How do they compare > generally? I maintain PyKDE and don't offend easily, so make any nasty comments you like :) PyKDE covers (what I think are) all of the major KDE libs - the extra widgets of course, but also things like KHTML, KParts, etc. The code is stable and actively maintained (some may question that, but I swear it is). It's biggest drawback is that it isn't sufficiently tested IMHO, but there are very few bug reports and patches/workarounds are usually quick (workarounds anyway). PyQt and PyKDE use exactly the same technology to do bindings (Phil Thompson's sip) and there isn't a lot of difference in how the bindings are generated. I've used PyKDE on a couple large (unfinished) projects, and can't recall anything that didn't work as advertised. Memory consumption is high - PyQt alone is probably best for lightweight stuff. Both projects maintain backward compatibility - you can still use PyQt as far back as Qt1.42, and I'm still using KDE2.1.1 on some machines, 3.0.3 on others - all the same set of files, but you compile for specific versions. Both are also usable back to Python 1.5.2. You probably don't want to run ancient versions of any of those, but I like the fact that we won't obsolete your code every few months, and Phil's design makes it easy to maintain multiple versions in a single package. sip, by it's nature, can't retain backward compatibility as easily, but all that means is you have to recompile occasionally if you need to stay current - your Python code/Qt/KDE versions won't break. The next PyKDE release will follow KDE3.1 by a few weeks (if they don't release too soon). The current version is up to KDE3.0.4 (3.0.5 will also be out shortly). I'm in the process of re-doing the entire PyKDE code generation process. It's going very nicely if a little slower than I'd like. If it works well enough, there may also be a tool to let you create your own Python bindings pretty quickly and easily. There's very little that can be covered in Python for PyKDE that isn't. The biggest deficiency I see is that while you can import KParts, you can't create them easily in Python. There are ways around that, but they're further down the list than some other stuff I'm working on for PyKDE. > (5) On another topic, can I display a large image > (larger than the screen or widget size) in a widget > with scroll bars, or am I constrained to resizing the > image to fit or losing content due to clipping? I haven't done it, but don't know why you couldn't. > (6) Regarding the online book on PyQt development, is > it available in an easily dowloadable form somewhere? > I'd like to print it out and read it at leisure rather > than staring at the screen all day! Boudewijn will be along shortly :) You can buy a copy from the publisher - don't know about the d/l and print. > Thanks in advance for your indulgence! Once I'm > through reading the remaining 3000 or so pages my > questions should get a bit more specific and up to > date. Be sure to get the Qt and KDE class reference docs - our docs only cover the differences/exceptions, not the details. The Qt/KDE docs are C++ oriented, but shouldn't be hard to follow. Also, if you compile PyQt or PyKDE, be sure to use the -c command line switch to build.py (assuming you have something more than 128MB of RAM) - cuts the compile time by about 80%. I'm hoping to do a lot of improvements in release turnaround time, docs, and testing over the next few months. We'll see how far I get before the weather turns nice again :) Welcome Jim ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.gmd.de/mailman/listinfo/pykde
RE: [PyKDE] QTable, selections and moving column headers
On Tue, 2002-11-19 at 19:57, Jim Bublitz wrote: > > On 19-Nov-02 greg Landrum wrote: > > > [PyQt-3.3.2, qt-3.0.5, RH8.0, Python-2.2.1] > > > The attached file constructs a simple widget using a QTable. > > It also attempts to: > > 1) limit selection to a single cell > > 2) allow moving of columns and rows > > as near as I can tell, neither 1) nor 2) work. > > > Is this a known Qt problem (I couldn't find any reports of it) or > > a PyQt thing? > > setSelectionMode works, and you appear to it coded correctly. > I've never used setRow/ColumnMovingEnabled. Usually I load the > column and row labels into Python lists, set the number of rows and > columns once from the list lengths, and then set all of the labels > in a loop. I can't see why the extra calls would make a difference > though. Yeah, that's a better solution. The filling code I provided is just what came out of pyuic. I wanted a quick and simple demo. > > What kind of symptoms are you getting (eg nothing works at all, get > full row selected instead of single cell, rows drag but don't drop, > etc)? Oooo, I did forget to mention the specific problems, didn't I. Crap, sorry about that. Selection: Even with setSelectionMode(QTable.Single) called, left clicking on the column/row headers results in the entire column/row being highlighted. Similarly, clicking to set a cell, then shift-clicking elsewhere results in the highlighted region expanding. I have to admit that I am just assuming that highlighted = selected. Column/Row Moving: Left clicking on a column/row header and then dragging results in the selection being expanded as the mouse cursor drags to new columns/rows (again, I'm defining "selection" to be "highlighted region"). No dragging occurs. > The only other thing I can think of at the moment is to make > sure the QTable gets focus (look at focusPolicy, setFocus in the > Qt docs). > I think that focus is being obtained (because I can move the selection around, drag stuff out, etc. Just to be sure, I tried adding a call to setFocusPolicy(QWidget.StrongFocus), but that didn't change any of the behavior described above. Thanks, -greg ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.gmd.de/mailman/listinfo/pykde
[PyKDE] Kudos and Questions from a New Convert
I'm just in the exciting phase of making the switch from wxPython to PyQt/PyKDE. Coming from a Linux background I have long disregarded the Qt/KDE side of the GUI world due to the old problems re Qt licensing. I recently discovered that this was no longer an issue and further that Qt had DATA AWARE WIDGETS!!! What a boon! Am I right in guessing that this was introduced in the free version in Qt 3.x? I've got to say that I really like Qt-Designer, the signal()/slots() mechanism and the fact that I can generate PyQt/PyKDE code from the .ui files. Having built a large suite of software for dealing with the DBAPI<->Business Object<->Widget association problem for wxPython, and being on the verge of a major project to expand and refactor it, this was quite a discovery. I'm now almost certainly going to walk away from my old code in favour of the very neat Qt solution. This feature seems to be little known and IMHO should be sold for all it's worth on the Python mailing lists. Now, onto the questions! I'm still trying to consume and digest all the info on the Qt/KDE API's, Qt-Designer and Kdevelop, PyQt and PyKDE ... There's a heck of a lot there and I'm only part way through, so I hope I'll be indulged if I ask a few broad sweep questions. My concern is to choose the correct RAD development platform. As I see it the choices are Qt-Designer with PyQt, Kdevelop with PyKDE, possible a combination of the two or BlackAdder. My Questions are: (1) Is there any other PyQt/PyKDE RAD Technology out there that I haven't discovered? (2) I haven't really gotten into the Kdevelop side yet. Am I right in assuming that it's quite normal to mix Kdevelop and Qt-Designer content (and thus presumably PyQt and PyKDE content) in the same application? I came to this assumption whilst fiddling around with Kdevelop. I ask only because the KDE API seems to have some nice widgets and features not available in Qt. (3) I don't want to start a war here, but is PyKDE as mature/complete as PyQt? How do they compare generally? (4) I'm concerned with whether I should look seriously at BlackAdder. I realise that it's inexpensive, but I want to choose a development base fairly quickly. My main concerns in looking at the BlackAdder web page are that it requires a step back in base technologies: Python 2.0, Qt 2.x etc. I guess that I'm most concerned with the step back in Qt. Presumably this means losing the overall database handling framework available in Qt 3.x for something that may be less clean, as well as loss of the other extended functionality that seems to previously have only been available in commercial editions of Qt, and presumably some general loss of functionality widget-wise. Also I'm guessing that I can say goodbye to the possibility of using PyKDE extensions. My other general concern is that ODBC is a pretty slow data access technology. Is anybody able to comment on these concerns? Do I have a lot to gain from BlackAdder that isn't available by just using Qt-Designer and processing the .ui files? (5) On another topic, can I display a large image (larger than the screen or widget size) in a widget with scroll bars, or am I constrained to resizing the image to fit or losing content due to clipping? (6) Regarding the online book on PyQt development, is it available in an easily dowloadable form somewhere? I'd like to print it out and read it at leisure rather than staring at the screen all day! Thanks in advance for your indulgence! Once I'm through reading the remaining 3000 or so pages my questions should get a bit more specific and up to date. John __ Do you Yahoo!? Yahoo! Web Hosting - Let the expert host your site http://webhosting.yahoo.com ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.gmd.de/mailman/listinfo/pykde
RE: [PyKDE] QTable, selections and moving column headers
On 19-Nov-02 greg Landrum wrote: > [PyQt-3.3.2, qt-3.0.5, RH8.0, Python-2.2.1] > The attached file constructs a simple widget using a QTable. > It also attempts to: > 1) limit selection to a single cell > 2) allow moving of columns and rows > as near as I can tell, neither 1) nor 2) work. > Is this a known Qt problem (I couldn't find any reports of it) or > a PyQt thing? setSelectionMode works, and you appear to it coded correctly. I've never used setRow/ColumnMovingEnabled. Usually I load the column and row labels into Python lists, set the number of rows and columns once from the list lengths, and then set all of the labels in a loop. I can't see why the extra calls would make a difference though. What kind of symptoms are you getting (eg nothing works at all, get full row selected instead of single cell, rows drag but don't drop, etc)? The only other thing I can think of at the moment is to make sure the QTable gets focus (look at focusPolicy, setFocus in the Qt docs). Jim ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.gmd.de/mailman/listinfo/pykde
[PyKDE] QTable, selections and moving column headers
[PyQt-3.3.2, qt-3.0.5, RH8.0, Python-2.2.1] The attached file constructs a simple widget using a QTable. It also attempts to: 1) limit selection to a single cell 2) allow moving of columns and rows as near as I can tell, neither 1) nor 2) work. Is this a known Qt problem (I couldn't find any reports of it) or a PyQt thing? -greg form2.mod.py Description: Binary data
[PyKDE] Sip-3.4 Install Error
> python build.py -g /usr/bin/make -l qt make: Nothing to be done for `qttest.pro'. An internal error occured. Please report all the output from the program, including the following traceback, to [EMAIL PROTECTED] Traceback (most recent call last): File "build.py", line 893, in ? File "build.py", line 846, in main File "build.py", line 304, in mkTempBuildDir File "build.py", line 764, in buildMakefile File "build.py", line 217, in patchFile IOError: [Errno 2] No such file or directory: 'Makefile' 1. Why build.py are creating an empty qttest.pro ? []'s Cadu Moreira KaduSoft President --- [..] __ Do you Yahoo!? Yahoo! Web Hosting - Let the expert host your site http://webhosting.yahoo.com ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.gmd.de/mailman/listinfo/pykde
[PyKDE] Problem using PyQT and Outlook Object Model
Hello The following code in a PyQt program, called on a QToolbarBotton 'Clicked' signal causes the python interpreter to crash when the emsg.Display() line is reached. import win32com.client def onEmail(self): app = win32com.client.Dispatch("Outlook.Application") emsg = app.CreateItem(win32com.client.constants.olMailItem) emsg.Subject = "Hello" emsg.Display() # CRASH The same code works fine if called at startup before: app=QApplication(args) My system is: Win2000 SP2 Python 2.1.1c1 PyQt 2.1 (as supplied with BlackAdder 1.0 Beta3) Can anyone help ? ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.gmd.de/mailman/listinfo/pykde
[PyKDE] Sip Backward Compatibility
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, I had 30 C++ class wraped in python with sip 3.2 on Mandrake 8.2. They were working perfectly. I recently upgraded to Mandrake 9.0 and to sip 3.4. My PyQt applications work perfectly but I have a weird problem with the self wrapped classes. I don't have a libModuleNamec.so lib generated anymore, only a libModuleNamecmodule.so. I use automake and since I don't fully undersand the Makefile macros, I suspec that I may have made a mistake in my sip-generated Makefile.am . My entry point interface file look like this : %Module pyPeriph %Include typedefs.sip %Include defines.sip %Include EclDebugHandleWrapper.sip %Include CArgent.sip %Include CMoneySeq.sip %Include BinaryString.sip %Include CStringSeq.sip %Include CStringMap.sip [...] %Makefile Makefile.am .o INCLUDES = $$(all_includes) \ -I../../include \ -I../gc PYTHONINTERP = /usr/bin/python PYPERIPH_SRC = \ $S \ $m.py datadir = /usr/Project data_DATA = $m.py sip$mDecl$m.h: sip$mVersion.h sip$mVersion.h: touch sip$mVersion.h ; $mcmodule.cpp: sip$mDecl$m.h CLEANFILES = \ $m.pyc lib_LTLIBRARIES = lib$mcmodule.la lib$mcmodule_la_SOURCES = $$(PYPERIPH_SRC) lib$mcmodule_la_LIBADD = -L/usr/lib/python2.2/site-packages \ -lsip \ ../periph/libperiph.la \ ../impression/libimpression.la Sip command line invocation and wrapper compilation gives no warning. After installation, if I try to import the module from the directory where I installed them, I got the following error : cd /usr/Project python -c "import pyPeriph" Traceback (most recent call last): File "", line 1, in ? File "/usr/Laniel/pyPeriph.py", line 6, in ? import libpyPeriphc ImportError: No module named libpyPeriphc And its right, I dont see such a module, either in the installation directory nor in the directory where I compiled the wrapper. I read the Wilken Boie's documentation but the Makefile part of it does not enlight me on the possible cause of the problem. Anyone know where I could find more information on the Makefile generation ? Is is possible to use distutils to build the sip-generated wrappers ? Thanks for the time you give to my inquiry. - -- Yannick Gingras Network Programer ESC:wq -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE92nRrfgINRJc6tXsRAjeKAJ4rPs8EneDsQuV8ylh9ocYO8PsSaACgjEN4 m4sS+Gh/nxRY+WGaI8RubMk= =Ta5N -END PGP SIGNATURE- ___ PyKDE mailing list[EMAIL PROTECTED] http://mats.gmd.de/mailman/listinfo/pykde