-1
I’m having a little trouble creating a Progress bar, it’s actually about interacting with her because creating in yourself is actually easy:
self.progressbar = QProgressBar()
self.progressBar.setRange(0, 10000)
self.progressBar.setValue(0)
With this it already appears. My difficulty is the following:
I have a variable that is the maximum amount of files I want to copy, I believe that would be the maximum value of mine progressbar
. The initial value would be zero. Now, how would you make this iteration to fill the progressbar
, showing the percentage?
I would like to know who is the great genius who likes to give a negative signal without saying what is wrong so that we can improve. Where is the moderator that at this time does not help?
– Cleber Nandi
If you have
N
files in total and already copiedn
, your percentage will be(n/N)*100
.– Woss
@Andersoncarloswoss or just set the maximum range value and in setValue apply which is the current index :)
– Guilherme Nascimento
@Guilhermenascimento So he would show equal percentage?
– Woss
@Andersoncarloswoss the bar yes, if there is text no. In the case of "text/label" I agree with you, it will have to be in the "rule of three"
– Guilherme Nascimento
Dear Cleber, the downvote is not mine, but when you receive one it is no use to think it is personal, I will say what your question probably has problem: You did not present the code that copies, so it is difficult to orient. So whoever voted negative was a way of calling attention by saying that the question this vague, I took a risk in answering, but often this causes more work for those who answer than they should, I’m not saying that is your case, but in most cases yes.
– Guilherme Nascimento
Thank you Guilherme Nascimento. That’s what I mean. For many like me who is new here, we need help instead of just negatively or criticize. With this I am improving my posts.
– Cleber Nandi