#pyqt | Logs for 2019-04-01
Back
[00:09:08] * hazzy-m uploaded an image: image.png (28KB) < https://matrix.org >
[01:12:39] -!- Dave_Elec has joined #pyqt
[01:47:08] -!- Dave_Elec has quit [Ping timeout: 245 seconds]
[01:48:48] -!- Dave_Elec has joined #pyqt
[03:53:59] -!- frispete has quit [Remote host closed the connection]
[04:14:23] -!- Dave_Elec has quit [Ping timeout: 268 seconds]
[04:29:07] -!- mintograde has joined #pyqt
[05:26:59] -!- BPL has joined #pyqt
[05:59:11] -!- cottoneyejim has joined #pyqt
[06:28:58] -!- frispete has joined #pyqt
[09:08:18] -!- kallesbar_ has joined #pyqt
[09:11:06] -!- kallesbar has quit [Ping timeout: 255 seconds]
[09:58:58] -!- Siecje has joined #pyqt
[10:45:22] <altendky> i'm searching but does anyone recall offhand the incantation to get the proper theme when running in a virtualenv? or was there more to it...
[10:52:17] -!- kallesbar_ has quit [Quit: Konversation terminated!]
[11:04:03] -!- AbleBacon has joined #pyqt
[11:04:40] <BPL> incantation to get the proper theme...? what do you mean? :O
[11:14:56] * Avaris confused as well
[11:15:19] <altendky> apologies... trying to get a screenshot. somehow that's taking me 10 minutes. *boggle*
[11:16:23] <altendky> top is in designer, bottom is in my application. mostly just notice the button style. the rest of the difference is expected mostly https://usercontent.irccloud-cdn.com
[11:17:56] <Avaris> try preview in designer
[11:18:29] <BPL> nice dialog but... what's the question, you're having issues changing the theme style of your app?
[11:18:59] <altendky> Avaris: preview is on top without picking a specific theme https://usercontent.irccloud-cdn.com
[11:19:14] <altendky> err, style, not theme
[11:19:35] <altendky> BPL: i would have expected my application to use the same style
[11:20:02] <altendky> i thought this had come up with other people a few times and there was an env var to set before importing any pyqt stuff or somesuch
[11:20:23] <Avaris> print(qapp.style().objectName())
[11:20:57] <BPL> aha, I understand, let me check, i recall in some of my apps had dealt with this styles/theme stuff, so you could change that in realtime... also, what Avaris said, that would give you the "default" app's style
[11:21:49] <BPL> what does `QStyleFactory.keys()` say?
[11:22:36] <BPL> here on a 3.6.x (x86) on win7 I've got => ['windowsvista', 'Windows', 'Fusion']
[11:23:20] <altendky> app.style().objectName() fusion
[11:23:20] <altendky> QtWidgets.QStyleFactory.keys() ['Windows', 'Fusion']
[11:24:05] <Avaris> hmm, why don't you have vista?
[11:24:10] <BPL> mmmm, maybe some plugin not loaded...
[11:24:15] <BPL> hold on, there was this env var...
[11:24:18] <altendky> this is in a venv in linux with PyQt5==5.11.3 atm
[11:25:10] <BPL> QT_QPA_PLATFORM_PLUGIN_PATH ?
[11:25:30] <BPL> maybe setting that could help? dunno... just guessing here :/
[11:26:49] <Avaris> and what styles do you have in designer?
[11:27:10] <BPL> or if not using that env var... you could try QCoreApplication.addLibraryPath("path_where_your_plugins_live")
[11:27:45] <altendky> Avaris: it offers to preview breeze, oxygen, qtcurve, windows, fusion. note that the designer install is unrelated to the venv.
[11:28:05] <Avaris> yeah, you're probably viewing in a different style
[11:28:09] <BPL> I think the missing styles could be living in some plugins, so it's probably is a matter of your virtualenv not being able to load them properly
[11:28:27] <BPL> try what suggested and see if that makes a difference
[11:28:44] <Avaris> see if "preview in fusion" from designer matches
[11:28:59] <altendky> BPL: `os.environ['QT_QPA_PLATFORM_PLUGIN_PATH'] = '/home/altendky/st.ben/venv/lib/python3.7/site-packages/PyQt5/Qt/plugins'` afaik before an qt, only after import os, resulted in the same print output as before
[11:30:15] <altendky> Avaris: oxygen is the closest but buttons and text entry are still taller in designer
[11:30:52] <Avaris> well, since they are unrelated. there could be subtle design changes between versions
[11:31:08] <altendky> true
[11:32:27] <BPL> mmm, so just to me to understand, in both designer and your virtualenv you're using the same plugins? ie: /home/altendky/st.ben/venv/lib/python3.7/site-packages/PyQt5/Qt/plugins , is this correct?
[11:32:53] <altendky> breeze is what kde is set to and the buttons look to match what designer is showing
[11:33:04] <altendky> BPL: no, designer is totally separate
[11:33:29] <BPL> altendky: so maybe the issue could be that designer is using some plugins that are not loaded in your virtualenv, correct?
[11:33:30] <altendky> the complaint as i recall from others was 'my app looks proper using system pyqt but when i install in a virtualenv it is wrong'
[11:33:40] <altendky> BPL: quite so
[11:33:54] <Avaris> system pyqt as in `apt-get install ...`?
[11:34:05] <BPL> why don't you try to specify the folder of designer's plugins to see if that makes any difference?
[11:34:10] <altendky> Avaris: that's what i recall other's talking about, yes
[11:34:25] <altendky> BPL: where the issue is on the virtualenv side since designer looks proper
[11:34:25] <BPL> ie: QCoreApplication.addLibraryPath
[11:34:27] <Avaris> well, wheels might be missing some styles
[11:35:42] <BPL> the styles I've displayed before were coming from `PyQt5==5.12`, just for the record
[11:36:25] <altendky> not that vista would be an improvement :] but upgrading now to confirm consistency
[11:37:35] <Avaris> jeez, what happened to stackoverflow :O
[11:37:41] <BPL> lol :D
[11:37:44] <BPL> 90sh \o/
[11:38:02] <altendky> no apparent change to the debug prints with 5.12.1
[11:38:05] <BPL> Avaris: what happened is SO have tons of spare time to code useless features, that's what happened
[11:38:20] <altendky> shows my system theme selection tool including the buttons that match designer https://usercontent.irccloud-cdn.com
[11:39:21] <BPL> "The QStyle class is an abstract base class that encapsulates the look and feel of a GUI. QStyleFactory creates a QStyle object using the create() function and a key identifying the style. The styles are either built-in or dynamically loaded from a style plugin (see QStylePlugin)."
[11:39:52] <altendky> i was grepping the venv install trying to find stuff and didn't really
[11:40:07] <Avaris> you might need to build pyqt from source + qt
[11:41:21] <BPL> but but... why not trying to use the same plugins than designer before going that hard&expensive route of compiling the whole thing?
[11:41:22] <altendky> Avaris: do you know where the files even are? or what they are called? i'm doing a locate with grep to see if i can find anything useful anywhere
[11:41:25] -!- cottoneyejim has quit [Ping timeout: 246 seconds]
[11:41:39] <Avaris> plugins?
[11:41:59] <BPL> yeah, styles are loaded dynamically from plugins, read above
[11:42:01] <Avaris> windows and fusion are built-in i think. rest are plugins
[11:42:43] <altendky> yeah, i'm not building my own pyqt to deal with this. perhaps these aren't even from qt and are provided only by kde
[11:43:02] <Avaris> mine are in .../site-packages/PyQt5/Qt/plugins/styles
[11:43:41] <altendky> i don't even get that directory :]
[11:43:44] <altendky> Avaris: this is on your mac?
[11:43:46] <BPL> in win, ls d:\virtual_envs\py364_32\Lib\site-packages\PyQt5\Qt\plugins\styles => qwindowsvistastyle.dll
[11:44:05] <Avaris> that was on windows but let me check mac
[11:45:11] <Avaris> mac has libqmacstyle.dylib
[11:45:47] <altendky> /usr/lib/x86_64-linux-gnu/qt5/plugins/styles/breeze.so etc
[11:46:08] <BPL> yeah, makes sense, that's why designer is loading them fine
[11:46:25] <altendky> hmm, not from https://packages.debian.org though
[11:46:25] <BPL> did you already try my suggestion of trying to use those? maybe you've got lucky if not getting any crash :/
[11:46:59] <BPL> this guys has the same issue than altendky's https://www.reddit.com , also in ubuntu
[11:47:13] <altendky> anyways, for curiosity i'll copy and see. there's not 'real' linux deployment so...
[11:47:28] <BPL> y, cool
[11:49:04] <altendky> that listed them in the debug prints, showed differently, then i clicked something and of course: `FATAL: Cannot mix incompatible Qt library (version 0x50701) with this library (version 0x50c02)`
[11:49:07] <BPL> in here if i don't load `qwindowsvistastyle.dll` I'll just get the builtin ones ['Windows', 'Fusion'] , so makes total sense to me
[11:49:11] <BPL> yeah :(
[11:49:25] <BPL> that's why i said before maybe you've got "lucky" , mmm
[11:51:54] <BPL> maybe not comipling the whole pyqt5 stuff, that'd be overkilling, but... maybe just compiling those extra plugins? (which is a pain in the butt)... what I don't understand is, why aren't those plugins being shipped on the ubuntu wheel? :O
[11:53:12] <altendky> so it's only really a linux issue i guess?
[11:53:28] <altendky> though i'm not yet clear exactly where breeze and oxygen come from
[11:53:38] <altendky> qt vs. kde vs. ?
[11:54:00] <Avaris> that might be qt's doing. iirc, in qt5 they changed styles. back in (py)qt4 you used to get all styles. mac style on windows etc.
[11:54:33] <BPL> mmmm, hold on... i recall i'd had a similar issue that this one few months ago, let me grep the channel logs, maybe that can help
[11:55:56] <altendky> https://packages.debian.org
[11:56:20] <altendky> so yeah, the pyqt wheels "shouldn't" include random kde stuff. though it might be nice someday
[11:56:49] <altendky> but i guess mostly for me knowing it's a linux-only issue (mostly) is probably sufficient
[11:57:49] <BPL> Mar 27 01:24:21 <BPL> Avaris: altendky: In fact, i think i've discovered the real issue here, look, in pyqt4 there are these available styles [PyQt4.QtCore.QString(u'Windows'), PyQt4.QtCore.QString(u'WindowsXP'), PyQt4.QtCore.QString(u'WindowsVista'), PyQt4.QtCore.QString(u'Motif'), PyQt4.QtCore.QString(u'CDE'), PyQt4.QtCore.QString(u'Plastique'), PyQt4.QtCore.QString(u'Cleanlooks')] , while if using pyqt5 you just got ['windowsvista',
[11:57:49] <BPL> 'Windows', 'Fusion'] ,
[11:58:38] <BPL> nah, the issue I had months ago is different, pretty much they got rid of some "ancient" good styles in pyqt5 with respect to pyqt4, not relevant here
[11:59:05] -!- mandeep has quit [Remote host closed the connection]
[11:59:18] <altendky> Thanks for checking
[11:59:34] <altendky> I can imagine that maintaining styles could be painful
[11:59:41] <BPL> my advice? Just use your custom style and you'll be fine... so you don't to rely on plugins :/
[11:59:47] <BPL> that's what i do actually
[12:00:01] <BPL> here's an interesting link that may help you if you eventually decide to do so
[12:00:08] <BPL> http://www.ericspevacek.com
[12:00:31] <BPL> really nice helper that helps you to hot-reloading styles in your apps without even restarting them, really nice
[12:01:17] <BPL> anyway, dunno... seems tricky that issue.. can't give proper advice about it... but compiling plugins or pyqt5 fromm scratch is a pain and i personally wouldn't go that route (my 2 cents)
[12:01:21] <altendky> BPL: how does using a custom style help my app look native?
[12:02:31] <altendky> But yes, you both walked me through this and I'll satisfied now that I don't need to resolve it. If I change my mind some day I know to go look at building wheels for the kde provided styles
[12:02:33] <BPL> altendky: not native but at least you'd have full control of your style :/ ... but i understand you want your users to look native without any fanciness, right?
[12:02:42] <altendky> Yup
[12:02:46] <BPL> fair enough
[12:02:53] <altendky> I want to not spend time on fanciness
[12:03:01] <BPL> yeah, i understand and makes sense
[12:03:30] <Avaris> livereload? doesn't it update dynamically when you change stylesheet?
[12:04:11] <BPL> Avaris: yeah, also.. or nodemon... any hot-reloader will do, just posted that helper cos that was the one i used few months ago when playing with styles :)
[12:04:34] <BPL> Avaris: but definitely being able to hot-reload styles is a win (IMHO)
[12:04:51] <Avaris> also, if you're doing app-wide styles, you might do app.setStyleSheet instead of individually setting widget styles
[12:05:03] <BPL> y
[12:05:59] <altendky> s/y/why/ or s/y/yes/
[12:06:00] <Avaris> oh this for changing styles outside of you app.
[12:06:26] <Avaris> i.e. you open app and go change css through some editor or such
[12:06:52] <Avaris> meh, add a menu to "reload theme" in app
[12:06:52] <BPL> there are lots of free styles out there on github btw... one style i used to like quite a lot was the orange one http://www.yasinuludag.com , reminded me to blender somehow :)
[12:06:56] <altendky> qtimer checking once a second to reload? :]
[12:07:16] <Avaris> altendky: no, uses filesystemwatcher
[12:07:30] <altendky> fancy
[12:07:43] <BPL> reload theme button? meh... no, thanks... you definitely want to edit your style from your favourite text editor :/
[12:08:04] <Avaris> BPL: sure, edit and press reload
[12:08:10] <BPL> exactly
[12:08:33] -!- cottoneyejim has joined #pyqt
[12:09:47] <BPL> much faster iteration time to try/mess around with things... but I don't think altendky will walk that path, makes sense he just wants a native style that just works for users... these type of features are for people who don't know how to waste their times... ie: SO coders that add 90sh styles lol xDDD . Anyway, coding back guys... if you find a proper solution just let us know, as i'm also interested
[12:10:34] <altendky> build a wheel from the kde source for https://packages.debian.org
[12:11:02] <Avaris> https://github.com
[12:11:32] <BPL> nice
[12:12:14] <BPL> "BreezeStyleSheets is a fork of QDarkStyleSheet." => https://github.com
[12:12:40] <BPL> which is pypi installable btw
[12:15:46] -!- cottoneyejim has quit [Ping timeout: 250 seconds]
[12:36:52] -!- n1` has joined #pyqt
[12:39:15] -!- mandeep has joined #pyqt
[12:42:56] -!- cottoneyejim has joined #pyqt
[13:01:09] -!- n1` has quit [Read error: Connection reset by peer]
[13:38:32] -!- mandeep has quit [Ping timeout: 250 seconds]
[14:08:43] -!- rubenwardy has quit [Remote host closed the connection]
[14:09:59] -!- rubenwardy has joined #pyqt
[14:27:05] -!- mandeep has joined #pyqt
[15:06:49] -!- AbleBacon has quit [Read error: Connection reset by peer]
[15:07:13] -!- AbleBacon has joined #pyqt
[15:51:13] -!- mandeep has quit [Ping timeout: 268 seconds]
[16:49:19] -!- Dave_Elec has joined #pyqt
[17:00:46] -!- Siecje has parted #pyqt
[17:24:26] -!- mandeep has joined #pyqt
[18:04:04] -!- BPL has quit [Quit: Leaving]
[18:19:33] -!- AbleBacon has quit [Quit: Leaving]
[18:41:18] -!- cottoneyejim has quit [Ping timeout: 245 seconds]
[19:55:27] -!- mandeep has quit [Ping timeout: 245 seconds]
[20:12:58] -!- mandeep has joined #pyqt
[20:30:28] -!- Dave_Elec has quit [Ping timeout: 245 seconds]
[20:42:58] -!- mandeep has quit [Ping timeout: 245 seconds]
[23:35:24] -!- mandeep has joined #pyqt