mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 00:40:06 +00:00 
			
		
		
		
	Radar site filtering, banded rows
This commit is contained in:
		
							parent
							
								
									2acd8be063
								
							
						
					
					
						commit
						43bf29d35f
					
				
					 2 changed files with 57 additions and 12 deletions
				
			
		|  | @ -19,32 +19,40 @@ static const auto        logger_    = scwx::util::Logger::Create(logPrefix_); | |||
| class RadarSiteDialogImpl | ||||
| { | ||||
| public: | ||||
|    explicit RadarSiteDialogImpl() : | ||||
|        radarSiteModel_ {nullptr}, proxyModel_ {nullptr} | ||||
|    explicit RadarSiteDialogImpl(RadarSiteDialog* self) : | ||||
|        self_ {self}, | ||||
|        radarSiteModel_ {new model::RadarSiteModel(self_)}, | ||||
|        proxyModel_ {new QSortFilterProxyModel(self_)} | ||||
|    { | ||||
|       proxyModel_->setSourceModel(radarSiteModel_); | ||||
|       proxyModel_->setFilterCaseSensitivity(Qt::CaseInsensitive); | ||||
|       proxyModel_->setFilterKeyColumn(-1); | ||||
|    } | ||||
|    ~RadarSiteDialogImpl() = default; | ||||
| 
 | ||||
|    RadarSiteDialog*       self_; | ||||
|    model::RadarSiteModel* radarSiteModel_; | ||||
|    QSortFilterProxyModel* proxyModel_; | ||||
| }; | ||||
| 
 | ||||
| RadarSiteDialog::RadarSiteDialog(QWidget* parent) : | ||||
|     QDialog(parent), | ||||
|     p(std::make_unique<RadarSiteDialogImpl>()), | ||||
|     p(std::make_unique<RadarSiteDialogImpl>(this)), | ||||
|     ui(new Ui::RadarSiteDialog) | ||||
| { | ||||
|    ui->setupUi(this); | ||||
| 
 | ||||
|    p->radarSiteModel_ = new model::RadarSiteModel(this); | ||||
|    p->proxyModel_     = new QSortFilterProxyModel(this); | ||||
|    p->proxyModel_->setSourceModel(p->radarSiteModel_); | ||||
|    // Radar Site View
 | ||||
|    ui->radarSiteView->setModel(p->proxyModel_); | ||||
| 
 | ||||
|    for (int column = 0; column < p->radarSiteModel_->columnCount(); column++) | ||||
|    { | ||||
|       ui->radarSiteView->resizeColumnToContents(column); | ||||
|    } | ||||
| 
 | ||||
|    connect(ui->radarSiteFilter, | ||||
|            &QLineEdit::textChanged, | ||||
|            p->proxyModel_, | ||||
|            &QSortFilterProxyModel::setFilterWildcard); | ||||
| } | ||||
| 
 | ||||
| RadarSiteDialog::~RadarSiteDialog() | ||||
|  |  | |||
|  | @ -16,6 +16,9 @@ | |||
|   <layout class="QVBoxLayout" name="verticalLayout"> | ||||
|    <item> | ||||
|     <widget class="QTreeView" name="radarSiteView"> | ||||
|      <property name="alternatingRowColors"> | ||||
|       <bool>true</bool> | ||||
|      </property> | ||||
|      <property name="indentation"> | ||||
|       <number>0</number> | ||||
|      </property> | ||||
|  | @ -25,13 +28,47 @@ | |||
|     </widget> | ||||
|    </item> | ||||
|    <item> | ||||
|     <widget class="QDialogButtonBox" name="buttonBox"> | ||||
|      <property name="orientation"> | ||||
|       <enum>Qt::Horizontal</enum> | ||||
|     <widget class="QFrame" name="frame"> | ||||
|      <property name="frameShape"> | ||||
|       <enum>QFrame::StyledPanel</enum> | ||||
|      </property> | ||||
|      <property name="standardButtons"> | ||||
|       <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> | ||||
|      <property name="frameShadow"> | ||||
|       <enum>QFrame::Raised</enum> | ||||
|      </property> | ||||
|      <layout class="QHBoxLayout" name="horizontalLayout"> | ||||
|       <property name="leftMargin"> | ||||
|        <number>0</number> | ||||
|       </property> | ||||
|       <property name="topMargin"> | ||||
|        <number>0</number> | ||||
|       </property> | ||||
|       <property name="rightMargin"> | ||||
|        <number>0</number> | ||||
|       </property> | ||||
|       <property name="bottomMargin"> | ||||
|        <number>0</number> | ||||
|       </property> | ||||
|       <item> | ||||
|        <widget class="QLineEdit" name="radarSiteFilter"> | ||||
|         <property name="placeholderText"> | ||||
|          <string>Filter</string> | ||||
|         </property> | ||||
|         <property name="clearButtonEnabled"> | ||||
|          <bool>true</bool> | ||||
|         </property> | ||||
|        </widget> | ||||
|       </item> | ||||
|       <item> | ||||
|        <widget class="QDialogButtonBox" name="buttonBox"> | ||||
|         <property name="orientation"> | ||||
|          <enum>Qt::Horizontal</enum> | ||||
|         </property> | ||||
|         <property name="standardButtons"> | ||||
|          <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> | ||||
|         </property> | ||||
|        </widget> | ||||
|       </item> | ||||
|      </layout> | ||||
|     </widget> | ||||
|    </item> | ||||
|   </layout> | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat