#pyqt | Logs for 2018-11-24
Back
[00:34:06] -!- Afrix has quit [Quit: Leaving]
[05:06:41] -!- anqxyr has joined #pyqt
[05:14:36] -!- anqxyr has quit [Ping timeout: 252 seconds]
[06:18:09] -!- mgainut has joined #pyqt
[06:18:39] <mgainut> Good afternoon!
[06:19:15] <mgainut> can someone help me with troubleshooting my qApp? I cannot figure out what is wrong with my code :(
[06:23:48] -!- kallesbar has joined #pyqt
[06:25:16] <mgainut> When I am opening a custom Qdialog window QSpacerItem dissapears until I close the custom QDialog Window..
[06:25:39] <mgainut> QSpacerItem dissapears on a mainwindow
[07:10:23] -!- mintograde has joined #pyqt
[09:23:41] <altendky> mgainut: you need to share your code :]
[09:26:08] <mgainut> :) thank you very much altendky, well I found workaround but I think you might recommend a better solution.
[09:26:17] <mgainut> https://gist.github.com
[09:27:33] <mgainut> I added self.addSpacer() and self.removeSpacer() lines in 147 and 152 lines accordingly
[09:28:56] <mgainut> additionally, in order to recreate my issue please select 3 survey then 2DB -> BBB and after that you will see that spacers on the mainwindow will dissapear
[09:44:32] <altendky> mgainut: side notes, don't import * (I'll cut you some slack on pyqt, sort of, but not others). Use super() to call parent methods such as __init__. Don't use class attributes like that in MyWin, they are just globals. use instance attributes assigned to self. Do save things like the layout in the dialog as instance attributes. On your original question, I'll try running it when I get to my laptop.
[09:47:11] -!- OrDaned has joined #pyqt
[09:57:37] <altendky> mgainut: alrighty, i just saw it. that is interesting
[09:59:31] <altendky> mgainut: also, classes are UpperCamelCase
[10:01:09] <altendky> mgainut: no need to dialWin.show() before you dialWin.exec_(). also, the _ is optional in py3, was required only in py2 since exec was reserved.
[10:05:08] <altendky> mgainut: i haven't figured anything out yet, but it's unrelated to your dialog at least. QDialog has the same effect
[10:05:16] -!- OrDaned has quit [Quit: OrDaned]
[10:05:55] <altendky> mgainut: wait, you have self.removeSpacer() as the first line in nextButton...
[10:14:34] <altendky> mgainut: yeah, you were just explicitly removing the space, then showing the dialog, then adding the spacer back. i took a quick guess where you actually needed to remove and readd the spacer. though, you may be able to just leave the spacer and insert into the proper position instead. https://gist.github.com
[10:27:40] <mgainut> Thank you very much altendky, I need to think a little bit and re-factor something as you recommended.
[10:27:43] <mgainut> ;)
[10:45:48] <mgainut> @altendky, could you please recommend article/book regarding the best practices which you follow in your programs (except python Zen)?
[10:47:03] <altendky> mgainut: #python honestly. watch discussions and learn where there are varying opinions and where there's a consensus. someone there may be able to recommend a python book. for pyqt there just doesn't seem to be a modern one. there's something people liked for pyqt4 though, i forget, sorry
[10:47:31] <mgainut> no problem
[11:50:20] -!- snowcatman has quit [Ping timeout: 244 seconds]
[13:38:48] -!- TunaLobster has joined #pyqt
[15:28:14] -!- TunaLobster has quit [Quit: So long and thanks for all the fish]
[15:30:50] -!- renn0xtk9 has joined #pyqt
[15:31:10] <renn0xtk9> I am usign pyqt5 with python 3 to make an app
[15:31:44] <renn0xtk9> When I set the text of QCheckbox and then retrieve it , i get an additional '&' somewhere inside (begining or second letter)
[15:31:58] <renn0xtk9> ve
[15:32:15] <renn0xtk9> I suspect some issue with encoding but don't know exactly how to solve
[15:32:53] <renn0xtk9> I retrieve like this checked_tag_list.append(widget.text())
[15:41:31] <altendky> renn0xtk9: consider something like &File. The & can be used in some situations to indicate a shortcut like alt+F in the case of file. But can you share code and output showing the issue?
[16:48:01] -!- renn0xtk9 has quit [Quit: Konversation terminated!]
[17:09:28] -!- mgainut has quit [Remote host closed the connection]
[17:59:03] -!- y0u has joined #pyqt
[19:26:02] -!- kdas_ has joined #pyqt
[19:26:20] -!- kushal has quit [Remote host closed the connection]
[20:47:44] -!- kallesbar has quit [Ping timeout: 272 seconds]
[22:48:25] kdas_ is now known as kushal