<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _setColumnCountForContents(self):
 """ Sets the column count given the current axes and selected RTI. Returns the newly set column count. """

        numRtiDims = self.rti.nDims if self.rti and self.rti.isSliceable else 0

        colCount = self.COL_FIRST_COMBO + max(numRtiDims, len(self.axisNames))
        self.tree.model().setColumnCount(colCount)
        return colCount