I want to make a program where I take each line of QPlainTextEdit and send it to a WebView which will load those urls. I don’t need to check the URL’s because the system makes it like that
http://someurl.com/ + each line of the QPlainTextEdit
I have few ideas which I don’t know how to use:
- Use a foreach loop which will make its self wait 5 seconds to loop again
- Make a QTimer to wait like 5 seconds and tick with an integer and when the integer hits the number of lines it will stop
And all of that will be done on every 4 hours by waiting with another timer.
First of all you need the contents of the
QPlainTextEdit. Get them and split them using the new line separator to get a list ofQStringseach representing a line.The easiest way to process the lines is to use a
QTimerand store somewhere the current index in the list.Now the slot is called whenever the timer is triggered. It just gets the current line and you do it whatever you want.
Similarly do the same with the 4h timer.