#pyqt | Logs for 2018-09-12
Back
[00:35:30] -!- _AleX_ has quit [Ping timeout: 252 seconds]
[00:56:55] -!- kallesbar has joined #pyqt
[02:50:36] -!- Flaghacker has joined #pyqt
[02:51:14] -!- Belxjander has quit [Quit: AmigaOSv4.1.6+//PowerPC native]
[02:55:30] -!- anqxyr has joined #pyqt
[02:56:09] -!- Belxjander has joined #pyqt
[03:02:30] <Flaghacker> Finally found why exceptions aren't printed to the console sometimes: http://pyqt.sourceforge.net Why did they think that was a good idea? They should print the stacktrace and then exit the application, not just exit!
[03:45:28] <The-Compiler> Flaghacker: that's what it does - are you using something like PyCharm?
[03:45:57] <Flaghacker> The-Compiler, Ah yes I am.
[03:46:03] <Flaghacker> Is that a problem?
[03:47:57] <The-Compiler> Flaghacker: it's probably a PyCharm bug, I've heard about it before
[03:48:06] <The-Compiler> works fine when you run it in a proper terminal for example
[03:48:35] <The-Compiler> the problem is that it needs to call abort() from C++ (it can't just exit properly from inside C++), and that seems to make PyCharm lose its output
[03:49:32] <Flaghacker> Huh that is really strange, I'd think that PyCharm just launches a terminal in the background and pipes the output trough.
[03:50:54] <Flaghacker> It works fine if I call sys.__excepthook__ and qFatal in a custom excepthook, so I hope I'm not leeking too much memory with that.
[05:53:47] -!- anqxyr has quit [Ping timeout: 240 seconds]
[06:26:37] -!- mintograde has joined #pyqt
[06:41:03] <altendky> Flaghacker: I put exceptions in a dialog anyways
[06:46:26] <altendky> Flaghacker: I also log stdeer/stdout to a file which can be particularly valuable when deploying such as with PyInstaller on Windows. Easy to get exceptions there with no console enabled and no way to see them.
[07:11:01] -!- mintograde has quit [Ping timeout: 246 seconds]
[07:26:09] -!- nitro25 has joined #pyqt
[08:00:18] <Flaghacker> altendky, I have most exceptions in a dialog, but sometimes the top level GUI code just crashes for a dumb reason that I'll immediatly encounter in an IDE anyways.
[08:00:26] -!- BPL has joined #pyqt
[08:00:33] <Flaghacker> altendky, I should look into a real logging solution though
[08:01:09] <altendky> Flaghacker: what i referred to isn't 'real logging' it's just 'make sure you have a place to see stuff on silly systems like windows'
[08:01:45] <Flaghacker> altendky, What's with the windows thing? GUI apps never have a console, right?
[08:02:06] <altendky> Flaghacker: yeah
[08:02:37] <altendky> Flaghacker: also, i mean that (almost) all of my code is covered by sys.excepthook which shows a dialog. once it gets installed (asap) i get a dialog for all uncaught exceptions.
[08:05:37] <Flaghacker> altendky, Then I don't understand what you mean about having no console on windows :/
[08:07:15] <altendky> Flaghacker: two separate things, even if one caused the other somewhat. on windows it's easy to get into a scenario where you can't see normal error outputs. i use sys.excepthook to launch my dialog so i don't have to 'have a dialog for most exceptions' but miss some new ones
[08:16:21] <altendky> Flaghacker: it's definitely bulky code to get everything i wanted out of the dialog but here's the interface https://github.com and installation of it https://github.com https://github.com
[08:20:17] <Flaghacker> I'll take a look, thanks!
[08:20:50] <Flaghacker> There's a lot of stuff going on :)
[08:22:42] -!- frispete_ has joined #pyqt
[08:22:56] <altendky> https://usercontent.irccloud-cdn.com
[08:23:04] <altendky> https://usercontent.irccloud-cdn.com
[08:26:32] -!- frispete has quit [Ping timeout: 272 seconds]
[08:40:13] <Flaghacker> For some reason when a QTableWidget, a QSplitter and a QLineEdit are combined the stylesheet of the QSplitter causes the palette of the QLineEdit not to work. Here's a minimal reproduction: https://paste.pound-python.org
[08:40:28] <Flaghacker> How is that possible?
[08:41:03] <Flaghacker> Whether it happens also depends on the order of creation and setting of the stylesheet and palette.
[08:42:36] <altendky> Flaghacker: first thought is that stylesheets cascade iirc and having anything set overrides other stuff.
[08:42:42] <altendky> though depending on order seems weird
[08:43:25] <Flaghacker> Well it should only influence the QSplitter::handle since it filter on that, right?
[08:43:36] <altendky> Flaghacker: in that example you only add the table to the splitter?
[08:43:59] <Flaghacker> Yeah minimal example, in reality I do of course actually use the splitter.
[08:44:00] <altendky> Flaghacker: it only specifies that, but i think it affects more.
[08:44:12] <altendky> Flaghacker: so we can't actually see the line edit?
[08:44:32] <Flaghacker> The line edit is in a cell of the table: table.setCellWidget(0, 0, lineEdit)
[08:44:35] <altendky> ah, sorry
[08:46:01] <Flaghacker> Looks like the table isn't actually neccesary, that was probably just some ordering stuff. This also works: https://paste.pound-python.org
[08:47:05] <Flaghacker> The problem is that whenever you look up how to change the color of something everyone says "use this stylesheet", so they're hard to avoid.
[08:48:16] <altendky> Flaghacker: right. you've got the basic features of the widgets on one end, total custom styles on the other end, and stylesheets in the middle that are a mess to work with it seems
[08:48:39] <altendky> Flaghacker: the order dependence is what has me confused
[08:49:02] <altendky> especially with palette first being what works
[08:50:10] <Flaghacker> altendky, Yeah it's crazy stuff. I asked in #qt if it's possible to debug things like this, ie. where does the background color *actually* come from here but no luck.
[08:52:07] <altendky> https://bugreports.qt.io
[08:53:12] <altendky> maybe related
[08:54:23] <Flaghacker> Hmm thing is it does always work when setting the background color of the line edit by a (second) stylesheet, no matter the order even.
[09:02:35] -!- Siecje has joined #pyqt
[09:16:43] -!- xp_prg has joined #pyqt
[09:25:44] -!- JT-Shop has quit [Remote host closed the connection]
[09:41:55] -!- anqxyr has joined #pyqt
[10:00:14] <altendky> Siecje: this build _might_ actually finish... (3.5 was broken yesterday) https://ci.appveyor.com
[10:01:05] <Siecje> Okay I'll let you know if I get a chance to test it.
[10:01:18] <Siecje> Super exciting though
[10:02:17] <altendky> it's amazing how we care about such little things as not having to build source code ourselves. *sigh*
[10:04:22] <Siecje> Well it takes time, you have to setup the environment and then do it all again when there is a new version.
[10:04:52] <altendky> Siecje: yeah, i agree. that was a failed attempt at a jab at phil for not providing these things himself.
[10:05:08] <altendky> (or opening up more so we could provide a patch ourselves)
[10:05:32] <altendky> but... setup.py and an sdist on pypi is coming. so we can be excited about that
[10:07:05] <Siecje> Yeah
[10:21:34] <xp_prg> I am bored out of my gored
[10:24:56] -!- jef has quit [Remote host closed the connection]
[10:25:17] <Siecje> I'm trying to figure out how to use PyInstaller on multiple files to create multiple executables but in the same directory https://github.com
[10:29:36] -!- BPL has quit [Read error: Connection reset by peer]
[10:31:57] <altendky> Siecje: is collect even documented?
[10:32:52] <Siecje> I can't find it.
[10:33:28] <altendky> Siecje: so basically we just randomly copy stuff and guess at what the parameters are suppose to do. yay
[10:33:47] <Siecje> I can see in this spec file that there is only one COLLECT. By the description file A depends on file B. Maybe I could do the same. How do you specify a file as a dependency of another file.
[10:33:47] <Siecje> https://github.com
[10:35:39] <altendky> Siecje: no clue
[10:36:49] <Siecje> Well it is not so bad, I can copy the .exe files into the same directory.
[10:38:47] <altendky> humm https://github.com
[10:39:31] <altendky> `Possible keywork arguments: name` but kws.get('strip', False)
[10:39:46] <altendky> not to mention `Target.__init__(self)` :[
[10:41:03] <altendky> Siecje: so, just list out all the stuff from each collect call in a single collect call?
[10:42:41] <Siecje> how?
[10:43:19] <Siecje> I tried https://dpaste.de
[10:43:54] <altendky> Siecje: https://gist.github.com is what i had in mind
[10:44:10] <altendky> Siecje: they are all just args... no need to sum them
[10:44:29] <altendky> Siecje: https://github.com just let it handle each in turn
[10:44:58] <altendky> they are either TOCs or Targets apparently
[10:45:33] <Siecje> Okay thanks I'll try it.
[10:49:39] <Siecje> altendky: That worked!
[10:49:55] <altendky> Siecje: :] and :| for the docs
[10:50:34] <altendky> i mean it's kinda 'obvious' but when the only documentation is random references to `COLLECT(...)` (literally with ...)
[10:53:16] <Siecje> Yeah
[10:57:43] -!- Flaghacker has quit [Quit: Leaving]
[10:59:37] -!- sssstavr has joined #pyqt
[11:04:43] <altendky> Siecje: do you know about pyinstaller 3.7 support? i looked the other day and it seems to claim support in git but not be released
[11:04:53] <altendky> well, the issue for 3.7 was closed iirc
[11:05:09] <Siecje> I think it was released yesterday.
[11:05:13] <Siecje> I'm using 3.7
[11:07:59] <altendky> Siecje: so it was https://pypi.org
[11:08:48] <altendky> Siecje: and twisted trunk runs on 3.7 on windows (even passes tests, still one to 'fix' on linux/osx though it sounds like it'll just be deprecated) so i _might_ be able to go to 3.7 now
[11:08:55] <altendky> (with an unreleased twisted :|)
[11:09:16] <Siecje> Have you heard anything on deferred being split out?
[11:09:25] <altendky> but with 10k+ tests, i'm not all that scared
[11:09:49] <altendky> Siecje: i didn't know anything about that. just iocpreactor so that twisted itself would be pure python with an optional binary dependency
[11:10:06] <altendky> Siecje: but, that was 'soon' a year ago. i gave up on that and have a PR for building umpteen wheels instead
[11:10:12] <Siecje> https://github.com
[11:10:42] <Siecje> We use a deferred from I don't even know where.
[11:11:16] <altendky> Siecje: ha, but last commit was in 2013...
[11:11:47] <Siecje> altendky: I just linked that for Glyph saying it was going to be split out.
[11:11:56] -!- jef has joined #pyqt
[11:11:57] <altendky> Siecje: right
[12:23:11] <Siecje> altendky: Do you have any Python 3.7 32-bit builds?
[12:24:41] <Siecje> Nevermind I'll just intall 64bit
[12:25:13] <altendky> Siecje: nope, AppVeyor doesn't have that qt. Might be able too work around it but I'm not sure. Or someday figure out a sensible way to have my own qt installs there. Not sure caches are big enough but maybe
[12:25:44] <Siecje> I think 32-bit is going to go away soon.
[12:26:43] <Siecje> Just dropped Python2 and then Windows XP. 32-bit is next
[12:43:08] <Siecje> altendky: Hmm, I can't get it to work. https://dpaste.de
[12:43:51] <Siecje> I created a venv with python -m venv venv and then installed PyQt5 and the wheel I downloaded from the build.
[12:44:18] <altendky> Siecje: show `python -c "import PyQt5.QtCore; print(PyQt5.QtCore)"
[12:44:20] <altendky> Siecje: show `python -c "import PyQt5.QtCore; print(PyQt5.QtCore)"`
[12:44:57] <Siecje> <module 'PyQt5.QtCore' from 'C:\\Users\\Cody\\Downloads\\venv\\lib\\site-packages\\PyQt5\\QtCore.pyd'>
[12:45:13] <altendky> Siecje: oh, qmlscene isn't using the proper python?
[12:45:28] <Siecje> Probably
[12:45:29] <altendky> have to make a wrapper like i did for designer (pyqt5designer)
[12:45:55] <altendky> Siecje: though what i did (not sure if this is proper to make an embedded python use an env) was to set the PYTHONPATH to sys.path
[12:46:33] <Siecje> How do I do that?
[12:47:43] <altendky> Siecje: so (using the python in your env) `python -c "import os; print(os.pathsep.join(sys.path))"
[12:48:08] <altendky> Siecje: then you can copy/paste that and assign it to PYTHONPATH (however that is properly done in windows. set PYTHONPATH=...? but powershell is different)
[12:48:14] <altendky> then run qmlscene
[12:48:24] <altendky> i'll start duplicating the designer entry point
[12:49:07] <altendky> and then also qmltestrunner
[12:49:25] <Siecje> Different error https://dpaste.de
[12:49:55] <Siecje> Shouldn't it be ':' between the paths or is that only for Linux?
[12:50:01] <altendky> Siecje: that's linux
[12:50:12] <Siecje> Should I pip install sip?
[12:50:15] <altendky> Siecje: hence os.pathsep :]
[12:50:24] <altendky> Siecje: probably not
[12:50:26] <altendky> maybe?
[12:51:00] <Siecje> Do you know what PyCapsule_Import is?
[12:51:45] <altendky> Siecje: so with qmlscene you like to set QML2_IMPORT_PATH? i can include that in the pyqt5qmlscene entry point like i did for designer
[12:52:02] <Siecje> After I install sip https://dpaste.de
[12:52:21] <Siecje> altendky: I wouldn't set it.
[12:52:54] <Siecje> I forget exactly what we do with it, but we set to a couple things.
[12:53:07] <altendky> Siecje: i mean with pyqt5designer you can `-p here/there` instead of having to edit the PYQTDESIGNERPATH env var
[12:53:37] <altendky> Siecje: and each -p just tacks on another entry but leaves the original as well (well, at least that's the intent)
[12:54:12] <altendky> i'll skip it for now
[12:54:41] <Siecje> We set it to a plugin directory which has a bunch of plugins that look like Charts plugin in the example.
[12:55:20] <Siecje> This is how we run the tests QML2_IMPORT_PATH="plugin:components" qmltestrunner
[12:55:29] <Siecje> To run an example QML2_IMPORT_PATH=plugin qmlscene Main.qml
[12:55:52] <Siecje> and components are regular QML files.
[12:56:29] <altendky> Siecje: ok, so `pyqt5qmltestrunner -p plugin -p components` would be nice
[12:56:44] <altendky> (would still work with setting the env var manually)
[12:57:00] <Siecje> yeah
[13:00:25] <altendky> Siecje: i'll move 3.7-64 to the beginning of the build? that's what you are trying?
[13:03:13] <altendky> Siecje: ok, so PYTHONPATH and QML2_IMPORT_PATH are hopefully covered.
[13:03:38] <altendky> Siecje: you installed sip and that got it further... which doesn't seem great. and it's presently not finding QtQuick?
[13:04:39] <altendky> err, but unable to find QQmlEngine first
[13:04:59] <altendky> err, type for that
[13:05:34] <altendky> Siecje: but i think this is where i fall apart because these are qml issues, right? maybe i need to review the build and make sure it includes QtQuick? hmm
[13:06:15] <altendky> adding --enable=QtQuick
[13:06:54] <altendky> though i'm really unclear what i should be building in vs. it getting from the regular pyqt5 install (if it should get anything from there...)
[13:12:37] <altendky> Siecje: https://ci.appveyor.com almost ready, i'll try it myself
[13:24:22] <altendky> Siecje: https://gist.github.com still no QtQuick module, nor Charts even with the env var seemingly set
[13:25:21] <altendky> oops, i needed to `-p .` not `-p Charts`
[13:27:17] <Siecje> the is not installed is because of QML2_IMPORT_PATH
[13:28:14] <Siecje> did you edit the qmldir file? If you don't want to do that you can copy the plugin into the directory with qmldir
[13:33:21] -!- xp_prg has quit [Ping timeout: 252 seconds]
[13:33:33] <altendky> Siecje: with `-p .` i get `file:///C:/Users/sda/desktop/pyqt5/examples/quick/tutorials/extending/chapter6-plugins/app.qml:42 module "Charts" plugin "pyqt5qmlplugin" not found`
[13:33:48] <altendky> Siecje: so the pyqt5qmlplugin file isn't located properly?
[13:33:49] <Siecje> copy the plugin into the Charts directory
[13:33:55] <altendky> :[
[13:34:02] <altendky> Siecje: or add it to the QML2_IMPORT_PATH?
[13:34:10] <Siecje> nope
[13:34:13] -!- swalladge has quit [Read error: Connection reset by peer]
[13:34:35] <altendky> Siecje: there's got to be a better way than editing code or copying the file for every project?
[13:34:55] -!- swalladge has joined #pyqt
[13:35:15] <Siecje> must be
[13:35:23] <Siecje> altendky: If you copy it does it work?
[13:35:45] <Siecje> We symlink it. *shrug*
[13:39:48] <Siecje> Maybe QT_PLUGIN_PATH but PyQt5 might set that to the plugin directory it has.
[13:40:02] <altendky> Siecje: :] was just trying that
[13:42:29] <Siecje> altendky: Did it work if you copied the .dll into the Charts directory?
[13:42:39] <altendky> Siecje: fine... :[ i'll try
[13:42:59] <Siecje> My problem wasn't that it couldn't find the plugin.
[13:43:16] <altendky> Siecje: oh, did you get it to work?
[13:43:28] <Siecje> I have not tried with the new wrapper.
[13:43:39] <altendky> Siecje: got to the QtQuick is not installed again
[13:44:16] <Siecje> The plugin was broken at one point, it may be broke again.
[13:44:26] <Siecje> I'll try the new wrapper later.
[13:44:38] <altendky> oh, and the pycapsule thingy
[13:45:17] <altendky> installed sip (which i don't feel good about) and got unable to find type for
[13:45:17] <altendky> QQmlEngine (and qtquick not installed
[13:45:50] <altendky> Siecje: i'm using the sip snapshot (i forget why) and pqyt 5.11.2 release
[13:46:10] <altendky> Siecje: i did do some sort of mods to the designer .pro or such files iirc
[13:51:29] <Siecje> So the wrapper didn't help.. hmm.
[13:51:43] <altendky> Siecje: well, it fixed the things it was supposed to
[13:52:04] <altendky> Siecje: -p . is much nicer than "what was that var again and how do i properly set it in this particular shell?
[13:55:57] <altendky> https://github.com
[14:00:14] <altendky> Siecje: https://github.com `Due to a limitation in QML it is not possible for multiple QML modules to use the same C++ plugin. In C++ this is not a problem as there is a one-to-one relationship between a module and the plugin. However, when using Python, pyqt5qmlplugin is used by every module. There are two
[14:00:14] <altendky> solutions to this`
[14:00:19] <altendky> so symlink or copy :[
[14:00:33] <altendky> so... the wrapper needs to start copying that file everywhere
[14:00:39] <altendky> that sounds horrible
[14:01:21] <altendky> but documented
[14:14:46] <altendky> i suppose for each directory in QML2_IMPORT_PATH i search each subdirectory for a qmldir file and check that file for pyqt5qmlplugin and if it's there i copy the dll to that directory. there would be a copy cli flag that'd default to on but could be turned off. or maybe the other way
[14:19:55] <Siecje> If you had multiple venvs you would have to delete and then copy.
[14:20:15] <altendky> Siecje: well, overwrite
[14:20:17] <altendky> sure
[14:20:46] <altendky> Siecje: that's why i figure defaulting to copying would be more likely to be useful
[14:21:13] <Siecje> And use symlinks?
[14:21:33] <altendky> Siecje: windows? i mean yeah, they exist, but i think you need elevated privileges or something stupid
[14:23:28] <Siecje> true
[14:23:51] <altendky> Siecje: that could be an optional flag later
[14:46:14] <Siecje> Can you include the chapter6 files in your repo and then for CI test that the plugin works?
[14:46:46] <altendky> Siecje: i download the source to build so...
[14:47:31] <Siecje> I'm thinking it is a pyqt5 bug. I've never used it on Windows.
[14:48:22] <altendky> Siecje: the designer plugin is obviously a tools thing and not a 'normal' distribution thing. what about the qml plugin?
[14:48:46] <altendky> Siecje: the test runner sounds like a tool. is qmlscene a tool to? something you wouldn't use when deploying?
[14:48:49] <Siecje> I don't know. Not everyone uses it.
[14:50:21] <Siecje> Maybe it has not been updated since sip was moved into PyQt5?
[14:50:36] <altendky> Siecje: yeah, i don't like this installing sip thing...
[14:50:43] <altendky> seems wrong at this point
[14:51:43] <altendky> Siecje: https://github.com
[14:53:01] <altendky> Siecje: designer plugin doesn't do that sip stuff
[14:53:47] <Siecje> Well the QML plugin doesn't get much use. It has been broken before. https://www.riverbankcomputing.com I forget what LD_LIBRARY_PATH is for.
[14:54:25] <altendky> Siecje: linux. setting the path searched for libraries (.so i guess)
[14:54:50] <Siecje> https://www.riverbankcomputing.com
[15:01:36] -!- kallesbar has quit [Ping timeout: 244 seconds]
[15:15:50] -!- delipickle has joined #pyqt
[15:36:03] <Siecje> BTW qmltestrunner and qmlscene both work the same way in that you need to have a qmldir with the plugin in that location.
[16:00:47] -!- nitro25 has quit [Remote host closed the connection]
[16:44:19] -!- delipickle has quit [Quit: Leaving]
[16:47:39] -!- mintograde has joined #pyqt
[16:52:54] -!- nsizemor has quit [Quit: nsizemor]
[17:06:41] -!- anqxyr has quit [Read error: Connection reset by peer]
[17:31:46] -!- Siecje has parted #pyqt
[19:59:42] -!- BPL has joined #pyqt
[21:32:31] -!- mintograde has quit [Ping timeout: 272 seconds]
[22:34:47] -!- BPL has quit [Ping timeout: 240 seconds]
[22:42:47] -!- BPL has joined #pyqt
[23:10:28] -!- BPL has quit [Quit: Leaving]