Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- The class used:
- private class ProcessFile(filename : String) extends Runnable {
- The function to do the work in a separate thread:
- private def importQuotes() {
- val quotesFile = QFileDialog.getOpenFileName(this, "Citaten bestand", QDir.currentPath())
- if (quotesFile != "") {
- val processFile = new ProcessFile(quotesFile)
- val runner = new QThread(processFile)
- importButton.setEnabled(false)
- runner.finished.connect(this, "enableImport()")
- runner.start
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment