mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 05:20:06 +00:00 
			
		
		
		
	Placefile view enhancements
- Size enabled/threshold columns for a checkbox - Combine URL/description columns - Tooltips - Alternating row colors
This commit is contained in:
		
							parent
							
								
									18c05b3a63
								
							
						
					
					
						commit
						3ff34caa02
					
				
					 5 changed files with 117 additions and 58 deletions
				
			
		|  | @ -58,19 +58,21 @@ PlacefileSettingsWidget::PlacefileSettingsWidget(QWidget* parent) : | |||
|    ui->setupUi(this); | ||||
| 
 | ||||
|    ui->placefileView->setModel(p->placefileProxyModel_); | ||||
|    ui->placefileView->header()->setSortIndicator( | ||||
|       static_cast<int>(model::PlacefileModel::Column::Url), Qt::AscendingOrder); | ||||
| 
 | ||||
|    ui->placefileView->resizeColumnToContents( | ||||
|       static_cast<int>(model::PlacefileModel::Column::Enabled)); | ||||
|    ui->placefileView->resizeColumnToContents( | ||||
|       static_cast<int>(model::PlacefileModel::Column::Thresholds)); | ||||
|    ui->placefileView->resizeColumnToContents( | ||||
|       static_cast<int>(model::PlacefileModel::Column::Url)); | ||||
|    auto placefileViewHeader = ui->placefileView->header(); | ||||
| 
 | ||||
|    ui->placefileView->setItemDelegateForColumn( | ||||
|       static_cast<int>(model::PlacefileModel::Column::Url), | ||||
|       p->leftElidedItemDelegate_); | ||||
|    placefileViewHeader->setMinimumSectionSize(10); | ||||
|    placefileViewHeader->setSortIndicator( | ||||
|       static_cast<int>(model::PlacefileModel::Column::Placefile), | ||||
|       Qt::AscendingOrder); | ||||
| 
 | ||||
|    // Enabled and Thresholds columns have a fixed size (checkbox)
 | ||||
|    placefileViewHeader->setSectionResizeMode( | ||||
|       static_cast<int>(model::PlacefileModel::Column::Enabled), | ||||
|       QHeaderView::ResizeMode::ResizeToContents); | ||||
|    placefileViewHeader->setSectionResizeMode( | ||||
|       static_cast<int>(model::PlacefileModel::Column::Thresholds), | ||||
|       QHeaderView::ResizeMode::ResizeToContents); | ||||
| 
 | ||||
|    p->ConnectSignals(); | ||||
| } | ||||
|  |  | |||
|  | @ -16,6 +16,9 @@ | |||
|   <layout class="QVBoxLayout" name="verticalLayout"> | ||||
|    <item> | ||||
|     <widget class="QTreeView" name="placefileView"> | ||||
|      <property name="alternatingRowColors"> | ||||
|       <bool>true</bool> | ||||
|      </property> | ||||
|      <property name="indentation"> | ||||
|       <number>0</number> | ||||
|      </property> | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat