|
ORE Studio 0.0.4
|
Base class for entity list MDI windows providing stale indicator support. More...
#include <EntityListMdiWindow.hpp>


Public Slots | |
| void | markAsStale () |
| Mark the list as stale (data changed on server). | |
| void | clearStaleIndicator () |
| Clear the stale indicator. | |
| void | reload () |
| Reload data from the server. | |
Public Member Functions | |
| EntityListMdiWindow (QWidget *parent=nullptr) | |
| QSize | sizeHint () const override |
Protected Member Functions | |
| virtual void | doReload ()=0 |
| Subclass implementation of the reload operation. | |
| virtual void | saveSettings () |
| Save window settings (column visibility, window size, etc.). | |
| void | closeEvent (QCloseEvent *event) override |
| void | initializeTableSettings (QTableView *tableView, QAbstractItemModel *sourceModel, std::string_view settingsGroup, const QVector< int > &defaultHiddenColumns={}, const QSize &defaultSize={900, 400}, int settingsVersion=1, QSplitter *splitter=nullptr) |
| Configure table header, column visibility, and settings persistence. | |
| void | initializeStaleIndicator (QAction *refreshAction, const QString &iconPath) |
| Initialize the stale indicator support. | |
| QProgressBar * | loadingBar () |
| Return the shared loading progress bar. | |
| void | beginLoading () |
| Show the loading bar and disable the reload action. | |
| void | endLoading () |
| Hide the loading bar and re-enable the reload action. | |
| void | connectModel (AbstractClientModel *model) |
| Wire endLoading() to the model's standard lifecycle signals. | |
| virtual QString | normalRefreshTooltip () const |
| Get the normal (non-stale) tooltip text for the refresh action. | |
| virtual QString | staleRefreshTooltip () const |
| Get the stale tooltip text for the refresh action. | |
Protected Attributes | |
| QSize | savedWindowSize_ |
| Saved window size from QSettings. | |
Base class for entity list MDI windows providing stale indicator support.
This class provides common functionality for entity list windows including:
Subclasses must:
Example usage in subclass:
|
slot |
Mark the list as stale (data changed on server).
Starts a pulse animation on the refresh action to indicate that server-side data has changed and the list should be reloaded.
|
slot |
Clear the stale indicator.
Stops the pulse animation and restores the normal refresh icon. Call this at the start of reload() implementations.
|
slot |
Reload data from the server.
Clears the stale indicator, shows the loading bar, disables the reload action, then delegates to doReload(). Subclasses must not override this.
|
protectedpure virtual |
Subclass implementation of the reload operation.
Called by reload() after the loading state has been set up. Do NOT call clearStaleIndicator() or beginLoading() here — the base class handles both before invoking doReload().
Implemented in BadgeDefinitionMdiWindow, BadgeSeverityMdiWindow, and CodeDomainMdiWindow.
|
protectedvirtual |
Save window settings (column visibility, window size, etc.).
When initializeTableSettings() has been called, this saves header state and window size automatically. Otherwise it is a no-op. Called automatically on close via closeEvent().
|
protected |
Configure table header, column visibility, and settings persistence.
Call once in setupTable() after creating tableView and model. Sets ResizeToContents on all columns, wires up column visibility context menu, restores saved header state and window size.
| tableView | The QTableView to manage |
| sourceModel | The source model (for column count/headers) |
| settingsGroup | QSettings group name (e.g. "CountryListWindow") |
| defaultHiddenColumns | Columns hidden by default when no saved state |
| defaultSize | Default window size when no saved size |
| settingsVersion | Bump when column layout changes to discard old state |
|
protected |
Initialize the stale indicator support.
Call this after creating the refresh action in setupToolbar().
| refreshAction | The refresh/reload action to animate |
| iconPath | Path to the refresh icon SVG resource |
|
protected |
Return the shared loading progress bar.
Subclasses insert this widget into their layout in setupUi(), placing it between the toolbar and the table view: layout->addWidget(toolbar_); layout->addWidget(loadingBar()); // <– add this line layout->addWidget(tableView_);
|
protected |
Show the loading bar and disable the reload action.
Call at the start of reload(), after clearStaleIndicator().
|
protected |
Hide the loading bar and re-enable the reload action.
Call from onDataLoaded() and onLoadError().
|
protected |
Wire endLoading() to the model's standard lifecycle signals.
Connects AbstractClientModel::dataLoaded and AbstractClientModel::loadError to endLoading() so that subclasses do not need to call endLoading() manually in every handler.
|
protectedvirtual |
Get the normal (non-stale) tooltip text for the refresh action.
Override this to customize the tooltip text.
Reimplemented in AccountMdiWindow, AppMdiWindow, AppVersionMdiWindow, BadgeDefinitionMdiWindow, BadgeSeverityMdiWindow, BondInstrumentMdiWindow, BookMdiWindow, BookStatusMdiWindow, BusinessCentreMdiWindow, BusinessDayConventionTypeMdiWindow, BusinessUnitMdiWindow, BusinessUnitTypeMdiWindow, CatalogMdiWindow, ChangeReasonCategoryMdiWindow, ChangeReasonMdiWindow, CodeDomainMdiWindow, CommodityInstrumentMdiWindow, CompositeInstrumentMdiWindow, ConcurrencyPolicyMdiWindow, ContactTypeMdiWindow, CounterpartyMdiWindow, CountryMdiWindow, CreditInstrumentMdiWindow, CurrencyMarketTierMdiWindow, CurrencyMdiWindow, DatasetBundleMdiWindow, DayCountFractionTypeMdiWindow, EquityInstrumentMdiWindow, FloatingIndexTypeMdiWindow, FxInstrumentMdiWindow, InstrumentMdiWindow, JobDefinitionMdiWindow, LegTypeMdiWindow, MonetaryNatureMdiWindow, OrgExplorerMdiWindow, OriginDimensionMdiWindow, PartyIdSchemeMdiWindow, PartyMdiWindow, PartyStatusMdiWindow, PartyTypeMdiWindow, PaymentFrequencyTypeMdiWindow, PortfolioExplorerMdiWindow, PortfolioMdiWindow, PurposeTypeMdiWindow, QueueMonitorMdiWindow, ReportDefinitionMdiWindow, ReportInstanceMdiWindow, ReportTypeMdiWindow, RoleMdiWindow, RoundingTypeMdiWindow, ScriptedInstrumentMdiWindow, SystemSettingMdiWindow, TenantMdiWindow, TenantTypeMdiWindow, and TradeMdiWindow.
|
protectedvirtual |
Get the stale tooltip text for the refresh action.
Override this to customize the tooltip text.
|
protected |
Saved window size from QSettings.
Set by initializeTableSettings() when restoring a previously saved window size. Used by sizeHint() to return the saved size instead of the default.