<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _lastColumn(self, block):
 """Returns the last non-whitespace column in the given line. If there are only whitespaces in the line, the return value is -1. """

        text = block.text()
        index = len(block.text()) - 1
        while index >= 0 and \
              (text[index].isspace() or \
               self._qpart.isComment(block.blockNumber(), index)):
            index -= 1

        return index