* Get data for header section. * @param section column or row * @param orientation horizontal or vertical * @param role item data role * @return header data for role */
| 152 | * @return header data for role |
| 153 | */ |
| 154 | QVariant CommandsTableModel::headerData( |
| 155 | int section, Qt::Orientation orientation, int role) const |
| 156 | { |
| 157 | if (role == Qt::ToolTipRole && orientation == Qt::Horizontal && |
| 158 | section == CI_Command) |
| 159 | return CommandFormatReplacer::getToolTip(); |
| 160 | if (role != Qt::DisplayRole) |
| 161 | return QVariant(); |
| 162 | if (orientation == Qt::Horizontal) { |
| 163 | switch (section) { |
| 164 | case CI_Confirm: |
| 165 | return tr("Confirm"); |
| 166 | case CI_Output: |
| 167 | return tr("Output"); |
| 168 | case CI_Name: |
| 169 | return tr("Name"); |
| 170 | case CI_Command: |
| 171 | return tr("Command"); |
| 172 | default: |
| 173 | return section + 1; |
| 174 | } |
| 175 | } |
| 176 | return section + 1; |
| 177 | } |
| 178 | |
| 179 | /** |
| 180 | * Get number of rows. |
nothing calls this directly
no test coverage detected