0

I`m trying to move my button upward using Thread.sleep() method in a loop. But elements just jumps to the end position after finishing the loop.

QPushButton upperBill = Globals.ui.firstUpperBillPushButton;

for(int i = 270; i >= -430; i -= 100)
    {
        upperBill.move(90, i);
        try {
            Thread.sleep(1000);
        }catch (InterruptedException e){
            e.printStackTrace();
        }
    }

What issue may cause the problem? What am I doing wrong?

B.Pukhalskyi
  • 51
  • 11
  • use QPropertyAnimation – eyllanesc Feb 23 '19 at 19:56
  • @eyllanesc Thank you for your answer. I`d like to find some book or tutorial in step by step learning qtjambi/qt to find the required information faster. Do you know some? I was looking for 2 days to find the solution for multithreading handling, until I heard about QTimer class :D – B.Pukhalskyi Feb 24 '19 at 15:33

0 Answers0