5:13 PM
0
A: QLabel is not updated unless the mainWindow is unfocused

Dennis JensenThis works (pyqt5 / python 3.7) in Windows10 and gets rid of the inessentials not sure if there was any issues with yours as those disjointed programs are harder to trouble shoot but this is simpler and more straight forward. So give it a try on the Mac and see if it works and let us know. Note ...

 
Sorry, I don't mean to be rude, but IMHO this hardly "gets rid of the inessentials", and does not answer the question. What the OP posted is standard code, with the first being the pyuic output and the second the normal usage of that approach, as suggested by official documentation too. If you want to post simpler and shorter code that's fine, just ensure that it actually is simpler and shorter (your code can be written with half the lines, improving readability in the meantime); also, you should really avoid using capitalization for variables names, including instancies.
 
okay @musicamante first congratulations you succeeded. Still since you put the challenge out then will return and ask that you show me how you would rewrite the code I posted to make it simpler and I will count your lines of code to see if you can truly do it in half the lines and make as good or better than it already is -- note btw if you end up stuffing it all into one massive main function then you are not making it better but worse since that would lose the benefit of using python to begin with and you ought to just code it in straight non-object oriented C
Next as for inessentials -- yes it does one of the biggest inessentials that I see output by the Designer is the retranslateUi() function -- yes it has a purpose but unless you are planning on supporting different languages (which most folks do not) then it adds a level of unnecessary complexity to the program. Further the QRect function is inessential especially if you use pyqt's Layout system WHICH is a core element of pyqt which the Designer does not output in its code (at least not in any code that I have seen thus far and I have seen quite a bit of Designer garbage)
Also the setObjectName is an inessential since most folks do not need that unless they are going to implement that other inessential retranslateUi() function
As for capitalization -- that is simply a matter of preference and you criticize it without even understanding the reason for that preference -- it seems to me you are all about posting rudeness without adding substance -- I look forward to your half-the-number-of-lines of code of the program I put forth. In essence the ole phrase applies put-up or shut-up
Lastly my code (if you remove the 5 lines I added to make it easier to demonstrate) is only 38 lines -- the original program was 36 lines -- so your current claim is you can write this cleanly and simply with quality in 19 lines or less look forward to seeing that. Note I could write my entire program on 1 single line but that would be ridiculously difficult to read -- but then it was how coding used to be done and I have picked apart enough of those programs to know it is not the best style for coding anything.
 
First. Let's keep calm. I won't post code here, because it's not the place and won't answer the question. Then, the user is clearly a beginner (at least in PyQt), using one of the official guidelines to start to play around with it, which includes using the output of pyuic to keep GUI and logic separated. I can agree that lots of things pyuic outputs is usually unnecessary, but that's not the point: that's the code you get, and usually you're not expected to even look at it. And setting the objectName (again, another automatic output of pyuic) is used for other things besides translation.
As per capitalization, yes, it's a matter of preference, you could even use all caps names, or any method that suits your need. But, Python PEP8 itself suggests to use lowercase for both functions and variable names. Yes, it's a suggestion (almost a convention), no, you're not required to follow it. Like using "self". You are free to use "whatever" or "foobar" as first argument in instance methods, but SO is not a good place to do that, because conventional practice is always preferred. You're free to comment and answer any way you like, but then don't complain if someone makes you notice.
Finally, and I hope we'll close this unnecessary debate, there's really no need to act in this way. I opened my comment explicitly saying that I didn't mean to be rude, and I tried to explain everything being as kind as possible. Pointing somebody else's possible faults according to one's opinion is not rudeness. If you feel like that I've offended you in some way, I'm sorry, that's not my fault, because it's clear that I didn't. On the contrary, your reaction seems way more aggressive, and completely uncalled for.
 
Oh I am quite calm but let us remember you are the one that went there I just responded in kind ;) --- and of course you will not post any code because frankly I am 100% sure that you could not post anything of quality that would be as clean or as concise and done in 19 lines or less. Heck I am even doubting you could produce anything of quality that is more concise and clear than what I produced.
As for Designer it is a very bad tool period end of story as it breaks a fundamental aspect of pyqt when it produces code and that is just wrong. Now IF it is some kind of quasi-official guideline tool then it ought to be rescinded but I have not seen anything to that posted anywhere (but then I have not pursued it because I could tell it was a failed tool rather quickly). I say it should be rescinded because all it does it make things harder for newbies and fails to do what it seems to be intended to do all the way around.
As for that ObjectName being set -- I highly doubt a newbie is ever going to use that heck I am producing a rather complicated piece of code and I have absolutely no need for that -- granted I have used that method in the past under very special circumstances but most of the time that is hardly ever needed in most programs.
 
Ok, let's stop there, we're adding unnecessary noise to the site.
 
5:16 PM
Keep in mind you began and extend this little series
And I am sure you would like to see me stay quiet so that you could get in the last lame word
 
If I wanted I'd have reply directly in comments, but that's not the place, as SO guidelines also suggest.
So, let's be clear. I don't want to argue. You apparently do. If you want to have a civilized confrontation, I'm happy to do it. But you clearly seem quite offended (that's not my fault, but I'm sorry anyway) and are continuing to show defensive and aggressive behavior, and I really don't have time for that.
 
I do not want to argue -- but I will not stand by and be character assassinated by same lame duck you probably could not out program me on their best day
who* probably
 
You're free to see all the answer and comments I've given so far. But, since you're so convinced, I'm afraid they'll not be enough.
 
I have read all your so call answers and comments
 
By the way, since you really want it: bpaste.net/show/ixDz
 
5:27 PM
but I have yet to see a direct apology of your initial rudeness -- all I say was a back-handed lame statement that basically said you do not need to apologize for you initial post that had nothing but rudeness in it and no helpful additive content
 
I don't have to apology for pointing out my opinions. I didn't offended you, and, as I said, if you feel offended, I'm sorry, but that's not my problem.
 
knock it off folks
 
nice 29 lines of code not even close to your claim of 19 lines or less
 
hello... hello.. hello?
some of this has become heated
 
No I am not actually heated at all
 
5:30 PM
then let's all walk away?
 
further this is a conversation outside the normal flow ??
 
I am pretty sure these guys are colleagues
or long time rivals
some sort of
 
No problems here I am not the one who started this mess
no I have no clue who the other guy is
 
well, you should just then ignore them
 
then go spend your time on something worth your effort?
 
5:31 PM
but I can tell you have absolutely no respect for him at this point going forward
standing up to bullies is always worth my time and effort
 
that's what mods are for
if you think that's the case, we're review it
 
sorry you did nothing when he posted his rude non-content adding initial post
 
did you tell us he'd did such a thing?
 
Actually, I just commented an answer pointing out my considerations, as all you can see in the beginning. I don't think that's rudeness, but, again, I'm sorry.
 
you can if you like delete that entire posting series starting with his post
 
5:33 PM
Jon Clements has frozen this room.
 
okay...
let's put this very simple, and so I can my work/and a word in edge ways in here
(bloody keyboard)
you're having a disagreement and that's fine, as long as it's civil and constructive
as soon as we start getting flags, something's not quite right...
it looks to me like someone is trying to help someone and that someone else trying help... all's not going well
so I'm going to unfreeze and see what happens given enough time off... is that okay? I don't want accusations or stuff like that, I want you folks to work out if you can, help each other, and if you can't do that, part company, amicably?
So here we go...
 
Jon Clements has unfrozen this room.
 
Okay well it appears the solution was to delete the helpful post so the bully gets his wish and the users is short changed
So how does one go about flagging such posts in the future
I am guessing that this individual is going to continue to be rude
Since he was allowed to get away with it in this situation
 
@JonClements That's fine for me.
 
Oh I bet -- and it makes no difference if its fine with you or not
It has been done
 
5:42 PM
Can I post something very non-constructive?
 
@DennisJensen I don't know what to do with that, I never flagged your answer nor requested to delete it.
 
Hope you still will be helpful to this community
just ignore
 
Also Jon Clements -- I would like to make a formal complaint against Jon Clements unnecessary rudeness
Yes if I could put musicamante on ignore I would do that but I cannot see a way to do that on stackoverflow -- do you have an ignore feature and if so where
@Mr_Green I have encountered cyber-bullies in the past they do not stop me from trying to continue to help others but I will not stand by and have them try to bully me or anyone else for that matter
 
@Mysticial I'd be very curious what you had in mind there :p
 
@JonClements Chat bugs:
 
5:48 PM
@DennisJensen so, I've got you another mod here... if you still want to complain I'm biased or do anything except want to talk, they're here and present
 
@DennisJensen let's hope he doesn't bother you again. That is all I think we can do. Btw, it seems no one had bad intention it just their ideas didn't mix up
 
I personally think all parties are over reacting and nothing to do except just be civil to each other? Remember that people sometimes at points of stress or frustration or grief or whatever, just aren't the same as you'd be happy to consider a friend...
 
I have not changed my stances I believe and I am pretty dang sure do to the verbiage that the intent was to be bullish -- you do not start out with a disclaimer for rudeness in effort to mask your rudeness that is just saying -- shut up while I verbally abuse and then dont say anything afterwards
aka that is a standard tactic of most cyber-bullies
 
Can you point out to where Jon was rude to you or bullying you?
You can always post on meta.stackoverflow.com if you feel that users are bullying you.
 
@BhargavRao He's not referring to @JonClements, but to me and my first comment on his answer you can read at the beginning of this chat.
 
5:54 PM
11 mins ago, by Dennis Jensen
Also Jon Clements -- I would like to make a formal complaint against Jon Clements unnecessary rudeness
I was referring to that..
 
I am currently trying to find that post again as I closed that window
Sorry, I don't mean to be rude, but IMHO this hardly "gets rid of the inessentials", and does not answer the question. What the OP posted is standard code, with the first being the pyuic output and the second the normal usage of that approach, as suggested by official documentation too.
If you want to post simpler and shorter code that's fine, just ensure that it actually is simpler and shorter (your code can be written with half the lines, improving readability in the meantime); also, you should really avoid using capitalization for variables names, including instancies. – musicamante 2 hours ago
 
If anybody is interested, the original example code @DennisJensen posted is here: https://bpaste.net/show/Dcll
His answer has been deleted afterwards (I don't know why and by whom).
 
@DennisJensen That's cool. What's the issue with that?
 
If you want to post simpler and shorter code that is fine, just ensure that it is simpler and shorter (your code can be written in half the lines, improving readability in the meantime); <<< this is character assassination plan and simple as well as being a lie
 
That's ridiculous.
 
5:59 PM
For he could not back up his false exaggerated claim
is it?
 
Nobody is "assassinating" anybody. I'd suggest all parties drop it, and get on with their lives. The content has been deleted, many moderators have reviewed the contents of this chat room and the comments below your answer, and the moderation team sees nothing here that warrants follow-up.
 
so if someone says what you posted is garbage and they could obviously do better and yet that is all they do -- no here is where the problem is etc...
So basically you are saying that cyber-bullying on stackoverflow is fine as long as you post a disclaimer first?
And word it such that it seems plausibly deniable
 
@DennisJensen If you can't take this extremely slight level of criticism of your code, you're going to have nothing but trouble here. Nobody attacked you, nobody bullied you. I understand that you have taken offense, but the other party has apologized and moved on. Please do the same, nothing constructive is happening here.
4
 
I can take constructive criticism
but that was not what was supplied
constructive being the key word -- I could make false claims against others just as easily with the disclaimer of course but that adds nothing
if you feel it is bad code then outline what is bad about it and demonstrate of make suggestion on how to improve it otherwise keep your mouth-shut
anything else is putting out your useless opinion and its useless because its not backed up by any facts
 
Again, and for the final time, the moderator team sees nothing worth following up on here. If you want to pursue this, post on meta.stackoverflow.com and state your case, but I caution you that I doubt it will be well received.
 
6:06 PM
meagar has frozen this room.