swift
|
Network servers. More...
Public Member Functions | |
CServerView (QWidget *parent=nullptr) | |
Constructor. | |
![]() | |
virtual | ~CViewBase () |
Destructor. | |
ModelClass * | derivedModel () |
Model. | |
const ModelClass * | derivedModel () const |
Model. | |
const models::CColumns & | getColumns () const |
The columns. | |
int | updateContainer (const ContainerType &container, bool sort=true, bool resize=true) |
Update whole container. More... | |
swift::misc::CWorker * | updateContainerAsync (const ContainerType &container, bool sort=true, bool resize=true) |
Update whole container in background. | |
void | updateContainerMaybeAsync (const ContainerType &container, bool sort=true, bool resize=true) |
Based on size call sync / async update. | |
void | insert (const ObjectType &value, bool resize=true) |
Insert. | |
void | insert (const ContainerType &container, bool resize=true) |
Insert. | |
void | push_back (const ObjectType &value, bool resize=true) |
Push back. | |
void | push_back (const ContainerType &container, bool resize=true) |
Push back. | |
const ObjectType & | at (const QModelIndex &index) const |
Value object at. | |
const ContainerType & | container () const |
Access to container. | |
QList< int > | rowsOf (const ContainerType &container) const |
The rows of the given objects. | |
int | rowOf (const ObjectType &obj) const |
The row of the given object. More... | |
const ContainerType & | containerOrFilteredContainer (bool *filtered=nullptr) const |
Full container or cached filtered container as approproiate. More... | |
ObjectType | firstSelectedOrDefaultObject () const |
First selected, the only one, or default. | |
int | updateSelected (const swift::misc::CVariant &variant, const swift::misc::CPropertyIndex &index) |
Update selected objects. | |
int | updateSelected (const swift::misc::CPropertyIndexVariantMap &vm) |
Update selected objects. | |
ObjectType | selectedObject () const |
Selected object (or default) | |
int | removeIf (K0 k0, V0 v0, KeysValues... keysValues) |
Remove elements matching some particular key/value pair(s). More... | |
void | replaceOrAdd (K1 key1, V1 value1, const ObjectType &replacement) |
Replace elements matching the given element. If there is no match, push the new element on the end. More... | |
void | sort () |
Sort if columns or order changed. | |
void | resort () |
Resort ("forced sorting") | |
int | columnCount () const |
Column count. | |
QJsonObject | toJson (bool selectedOnly=false) const |
Convert to JSON. | |
QString | toJsonString (QJsonDocument::JsonFormat format=QJsonDocument::Indented, bool selectedOnly=false) const |
Convert to JSON string. | |
virtual void | setObjectName (const QString &name) |
Set own name and the model's name. | |
void | takeFilterOwnership (std::unique_ptr< models::IModelFilter< ContainerType >> &filter) |
Set filter and take ownership, any previously set filter will be destroyed. | |
bool | hasFilter () const |
Has filter set? | |
void | addContainerTypesAsDropTypes (bool objectType=true, bool containerType=true) |
Add the object and container type as accepted drop types CDropBase::addAcceptedMetaTypeId. | |
void | initAsOrderable () |
Init so items can be ordered, includes enabling drag and drop. | |
void | setDropActions (Qt::DropActions dropActions) |
Drop actions. | |
void | setTabWidgetViewText (QTabWidget *tw, int index) |
Set a tab widget text based on row count, filter etc. | |
void | setPercentageColumnWidths () |
Set the widths based on the column percentages. More... | |
virtual void | selectObjects (const ContainerType &selectedObjects) |
Select. More... | |
virtual ContainerType | selectedObjects () const |
Selected objects. More... | |
virtual ContainerType | unselectedObjects () const |
Unselected objects. More... | |
virtual int | removeSelectedRows () |
Remove selected rows. More... | |
virtual void | presizeOrFullResizeToContents () |
Depending on CViewBaseNonTemplate::ResizeSubsetThreshold presize or fully resize. More... | |
virtual void | clearHighlighting () |
Clear any highlighted objects. More... | |
virtual void | materializeFilter () |
Materialize filter. More... | |
virtual void | clear () |
Clear data. More... | |
virtual int | rowCount () const |
Elements in container. More... | |
virtual bool | isEmpty () const |
Empty? More... | |
virtual bool | isOrderable () const |
Is the corresponding model orderable, swift::misc::models::CListModelBaseNonTemplate::isOrderable. More... | |
virtual void | allowDragDrop (bool allowDrag, bool allowDrop, bool allowDropJsonFile=false) |
Allow to drag and/or drop value objects. More... | |
virtual bool | isDropAllowed () const |
Drop allowed? More... | |
virtual void | dropEvent (QDropEvent *event) |
virtual bool | acceptDrop (const QMimeData *mimeData) const |
Accept drop data? More... | |
virtual bool | setSorting (const swift::misc::CPropertyIndex &propertyIndex, Qt::SortOrder order=Qt::AscendingOrder) |
Sorting. More... | |
virtual void | sortByPropertyIndex (const swift::misc::CPropertyIndex &propertyIndex, Qt::SortOrder order=Qt::AscendingOrder) |
Sort by index. More... | |
virtual void | setNoSorting () |
Disable sorting. More... | |
virtual swift::misc::CPropertyIndex | getSortProperty () const |
Sorted by property. More... | |
virtual int | getSortColumn () const |
Get sort column property index. More... | |
virtual bool | hasValidSortColumn () const |
Has valid sort column? More... | |
virtual bool | endsWithEmptyColumn () const |
Using void column at the end? More... | |
virtual Qt::SortOrder | getSortOrder () const |
Get sort order. More... | |
![]() | |
virtual bool | setParentDockWidgetInfoArea (swift::gui::CDockWidgetInfoArea *parentDockableWidget) |
Corresponding dockable widget in info area. More... | |
ResizeMode | getResizeMode () const |
Resize mode. | |
void | setResizeMode (ResizeMode mode) |
Set resize mode. | |
void | setAutoResizeFrequency (int updateEveryNthTime) |
In. More... | |
bool | displayAutomatically () const |
Display automatically (when models are loaded) | |
void | setDisplayAutomatically (bool automatically) |
Display automatically (when models are loaded) | |
const QFont & | getHorizontalHeaderFont () const |
Header (horizontal) font. | |
int | getHorizontalHeaderFontHeight () const |
Horizontal font height. | |
bool | hasSelection () const |
Selection (selected rows) | |
QModelIndexList | selectedRows () const |
Selected rows if any. | |
virtual QModelIndexList | unselectedRows () const |
Unselected (not selected) rows if any. | |
int | selectRows (const QSet< int > &rows) |
Select given rows. | |
int | selectedRowCount () const |
Number of selected rows. | |
int | unselectedRowCount () const |
Unselected row count. | |
bool | hasSingleSelectedRow () const |
Single selected row. | |
bool | hasMultipleSelectedRows () const |
Multiple selected rows. | |
bool | allowsMultipleSelectedRows () const |
Allows to select multiple rows. | |
bool | isCurrentlyAllowingMultipleRowSelections () const |
Is the current selection mode allow multiple selection. | |
void | setFilterDialog (filters::CFilterDialog *filterDialog) |
Filter dialog. | |
QWidget * | getFilterWidget () const |
Filter widget if any. | |
void | setFilterWidget (filters::CFilterWidget *filterWidget) |
Set filter widget. | |
menus::IMenuDelegate * | setCustomMenu (menus::IMenuDelegate *menu, bool nestPreviousMenu=true) |
Set custom menu if applicable. | |
void | enableLoadIndicator (bool enable) |
Enable loading indicator. | |
bool | isShowingLoadIndicator () const |
Showing load indicator. | |
void | acceptClickSelection (bool accept) |
Accept click selection. | |
void | acceptDoubleClickSelection (bool accept) |
Accept double click selection. | |
void | acceptRowSelection (bool accept) |
Accept row selection. | |
void | menuRemoveItems (Menu menusToRemove) |
Remove given menu items. | |
void | menuAddItems (Menu menusToAdd) |
Add given menu items. | |
void | setMenu (Menu menuItems) |
Set menu items. | |
Menu | getMenu () const |
Menus. | |
virtual void | setSelectionModel (QItemSelectionModel *model) |
QWidget * | mainApplicationWindowWidget () const |
Main application window widget if any. | |
swift::misc::CStatusMessage | showFileLoadDialog (const QString &directory={}) |
Show file load dialog. | |
swift::misc::CStatusMessage | showFileSaveDialog (bool selectedOnly, const QString &directory={}) |
Show file save dialog. | |
void | setSaveFileName (const QString &saveName) |
Save file name (optional) | |
bool | allowCacheFileFormatJson () const |
Allow cache file JSON to be loaded. | |
void | setAllowCacheFileFormatJson (bool allow) |
Enable/disable cache file format to be loaded as JSON. | |
void | setForceColumnsToMaxSize (bool force) |
Force that columns are extended to full viewport width. Workaround as of https://stackoverflow.com/q/3433664/356726. More... | |
void | setHorizontalHeaderSectionResizeMode (QHeaderView::ResizeMode mode) |
Resize mode. | |
void | setSettingsDirectoryIndex (swift::misc::CDirectories::ColumnIndex directoryIndex) |
Index of the directory we "remember". | |
![]() | |
CDockWidgetInfoArea * | getDockWidgetInfoArea () const |
Corresponding dockable widget in info area. | |
bool | hasDockWidgetArea () const |
Has dock area? | |
CInfoArea * | getParentInfoArea () const |
The parent info area. | |
bool | isParentDockWidgetFloating () const |
Is the parent dockable widget floating? | |
bool | isVisibleWidget () const |
Visible widget. More... | |
CEnableForFramelessWindow * | mainApplicationWindow () const |
Main application window if any. | |
QWidget * | mainApplicationWindowWidget () const |
Main application window widget if any. | |
void | displayMyself () |
Display myself. | |
![]() | |
virtual | ~ISelectionModel () |
Destructor. | |
Additional Inherited Members | |
![]() | |
using | ModelClass = models::CServerListModel |
Model type. | |
using | ContainerType = typename T::ContainerType |
Model container type. | |
using | ObjectType = typename T::ObjectType |
Model container element type. | |
![]() | |
enum | ResizeMode { ResizingAuto , ResizingOnce , PresizeSubset , ResizingAlways , ResizingOff } |
Resize mode, when to resize rows / columns. More... | |
enum | RowsResizeMode { Interactive , Content } |
How rows are resized, makes sense when. More... | |
enum | MenuFlag { MenuNone = 0 , MenuClear = 1 << 0 , MenuRemoveSelectedRows = 1 << 1 , MenuRefresh = 1 << 2 , MenuBackend = 1 << 3 , MenuDisplayAutomatically = 1 << 4 , MenuDisplayAutomaticallyAndRefresh = MenuDisplayAutomatically | MenuRefresh , MenuFilter = 1 << 5 , MenuMaterializeFilter = 1 << 6 , MenuSave = 1 << 7 , MenuLoad = 1 << 8 , MenuToggleSelectionMode = 1 << 9 , MenuOrderable = 1 << 10 , MenuCopy = 1 << 11 , MenuPaste = 1 << 12 , MenuCut = 1 << 13 , MenuFont = 1 << 14 , MenuLoadAndSave = MenuLoad | MenuSave , MenuDefault = MenuToggleSelectionMode | MenuDisplayAutomaticallyAndRefresh | MenuFont | MenuClear , MenuDefaultNoClear = MenuToggleSelectionMode | MenuDisplayAutomaticallyAndRefresh | MenuFont , MenuDefaultDbViews = MenuToggleSelectionMode | MenuBackend | MenuFont , MenuHighlightStashed = 1 << 15 , MenuCanStashModels = 1 << 16 , MenuDisableModelsTemp = 1 << 17 , MenuStashing = MenuHighlightStashed | MenuCanStashModels } |
Menu flags. More... | |
![]() | |
virtual void | resizeToContents () |
Resize to contents, strategy depends on container size. | |
virtual void | fullResizeToContents () |
Full resizing to content, might be slow. More... | |
void | rowsResizeModeToInteractive () |
Init as interactive, as this allows manually resizing. | |
void | rowsResizeModeToContent () |
Resize mode to content. More... | |
void | rowsResizeModeBasedOnThreshold (int elements) |
Set content/interactive mode based on ResizeRowsToContentThreshold. | |
int | showLoadIndicator (int containerSizeDependent=-1, std::chrono::milliseconds timeout=std::chrono::milliseconds { 0 }, bool processEvents=true) |
Show loading indicator. More... | |
int | showLoadIndicatorWithTimeout (std::chrono::milliseconds timeout=std::chrono::milliseconds { 0 }, bool processEvents=true) |
Show loading indicator which can time out. | |
void | onModelChanged () |
Underlying model changed. | |
void | hideLoadIndicator (int loadingId=-1) |
Hide loading indicator. | |
void | hideLoadIndicatorForced () |
Parameterless version of hideLoadIndicator. | |
![]() | |
void | requestUpdate () |
Ask for new data from currently loaded data. | |
void | requestNewBackendData () |
Load data from backend (where it makes sense) | |
void | loadIndicatorVisibilityChanged (bool visible) |
Load indicator's visibility has been changed. | |
void | asyncUpdateFinished () |
Asynchronous update finished. | |
void | modelDataChanged (int count, bool withFilter) |
Model data changed. | |
void | modelDataChangedDigest (int count, bool withFilter) |
Model data changed,. | |
void | modelChanged () |
Model bas been changed (means data in view have been changed) | |
void | objectChanged (const swift::misc::CVariant &object, const swift::misc::CPropertyIndex &changedIndex) |
Single object was changed in model. | |
void | objectClicked (const swift::misc::CVariant &object) |
Object has been clicked. | |
void | objectDoubleClicked (const swift::misc::CVariant &object) |
Object has been double clicked. | |
void | objectSelected (const swift::misc::CVariant &object) |
Object has been selected. | |
void | objectsDeleted (const swift::misc::CVariant &objectContainer) |
Objects deleted from model. | |
void | jsonLoadCompleted (const swift::misc::CStatusMessage &msg) |
JSON data load from disk completed, the swift::misc::CStatusMessage represents the success. | |
![]() | |
static constexpr int | ASyncRowsCountThreshold = 50 |
When (row count) to use asynchronous updates. | |
static constexpr int | ResizeSubsetThreshold = 250 |
When to use pre-sizing with random elements. | |
static constexpr int | ResizeRowsToContentThreshold = 20 |
When to use rows resizing (which is slow) More... | |
![]() | |
CViewBase (QWidget *parent, ModelClass *model=nullptr) | |
Constructor. | |
void | setSortIndicator () |
Set the search indicator based on model. | |
void | standardInit (ModelClass *model=nullptr) |
Standard initialization. | |
virtual swift::misc::CStatusMessage | modifyLoadedJsonData (ContainerType &data) const |
Modify JSON data loaded in swift::gui::views::CViewBaseNonTemplate::loadJson. | |
virtual swift::misc::CStatusMessage | validateLoadedJsonData (const ContainerType &data) const |
Verify JSON data loaded in swift::gui::views::CViewBaseNonTemplate::loadJson. | |
virtual void | jsonLoadedAndModelUpdated (const ContainerType &data) |
In swift::gui::views::CViewBaseNonTemplate::loadJson the view has been updated because of loaded JSON data. More... | |
virtual void | customMenu (menus::CMenuActions &menuActions) |
Method creating the menu. More... | |
virtual swift::misc::CStatusMessage | loadJsonFile (const QString &fileName) |
Method creating the menu. More... | |
virtual void | displayContainerAsJsonPopup (bool selectedOnly) |
Display the container as JSON popup. | |
virtual bool | reachedResizeThreshold (int containrerSize=-1) const |
Skip resizing because of size? More... | |
virtual void | performModeBasedResizeToContent () |
Perform resizing (no presizing) / non slot method for template. More... | |
virtual int | performUpdateContainer (const swift::misc::CVariant &variant, bool sort, bool resize) |
Helper method with template free signature. More... | |
virtual void | updateSortIndicator () |
Set the sort indicator to the current sort column. More... | |
virtual void | mouseOverCallback (const QModelIndex &index, bool mouseOver) |
From delegate indicating we are in mouse over state. More... | |
virtual void | drawDropIndicator (bool indicator) |
Draw drop indicator. More... | |
virtual void | copy () |
Clipboard cut/copy/paste. More... | |
virtual void | cut () |
Clipboard cut/copy/paste. More... | |
virtual void | paste () |
Clipboard cut/copy/paste. More... | |
virtual void | displayJsonPopup () |
Display JSON data. More... | |
virtual void | displaySelectedJsonPopup () |
Display JSON data. More... | |
virtual bool | filterDialogFinished (int status) |
Filter dialog finished. More... | |
virtual bool | filterWidgetChangedFilter (bool enabled) |
Filter changed in filter widget. More... | |
virtual void | removeFilter () |
Remove filter. More... | |
virtual void | onClicked (const QModelIndex &index) |
Remove filter. More... | |
virtual void | onDoubleClicked (const QModelIndex &index) |
Index double clicked. More... | |
virtual void | onRowSelected (const QModelIndex &index) |
Row selected. More... | |
virtual swift::misc::CStatusMessage | loadJson (const QString &directory={}) |
Load JSON. More... | |
virtual swift::misc::CStatusMessage | saveJson (bool selectedOnly=false, const QString &directory={}) |
Save JSON. More... | |
![]() | |
CViewBaseNonTemplate (QWidget *parent) | |
Constructor. | |
virtual | ~CViewBaseNonTemplate () |
Destructor. | |
virtual bool | isResizeConditionMet (int containerSize=-1) const |
Resize or skip resize? | |
int | getPresizeRandomElementsSize (int containerSize=-1) const |
Calculate presize count. | |
void | centerLoadIndicator () |
Center / re-center load indicator. | |
void | init () |
Init default values. | |
QString | getFileDialogFileName (bool load) const |
Default file for load/save operations. | |
menus::CMenuActions | initMenuActions (MenuFlag menu) |
Init menu actions. | |
void | saveJsonAction () |
Save JSON for action/menu, void return signatur. | |
void | saveSelectedJsonAction () |
Save JSON for action/menu, void return signatur. | |
void | loadJsonAction () |
Load JSON for action/menu, void return signatur. | |
void | displayFilterDialog () |
Display the filter dialog. | |
void | settingsChanged () |
Settings have been changed. | |
void | selectAll () |
Select all rows. | |
virtual void | rememberLastJsonDirectory (const QString &selectedFileOrDir) |
JSON directory. More... | |
virtual QString | getRememberedLastJsonDirectory () const |
JSON directory. More... | |
void | triggerReload () |
Trigger reload from backend by signal requestUpdate();. | |
void | triggerReloadFromBackend () |
Trigger reload from backend by signal requestNewBackendData() | |
void | showVerticalHeader () |
Vertical header. | |
components::CTextEditDialog * | textEditDialog () |
Init text edit dialog if required and return pointer to it. | |
virtual void | resizeEvent (QResizeEvent *event) |
virtual void | dragEnterEvent (QDragEnterEvent *event) |
virtual void | dragMoveEvent (QDragMoveEvent *event) |
virtual void | dragLeaveEvent (QDragLeaveEvent *event) |
void | setMultiSelection () |
Change selection modes. | |
void | setExtendedSelection () |
Change selection modes. | |
void | setSingleSelection () |
Change selection modes. | |
![]() | |
CEnableForDockWidgetInfoArea (CDockWidgetInfoArea *parentInfoArea=nullptr) | |
Constructor. More... | |
virtual | ~CEnableForDockWidgetInfoArea () |
Destructor. | |
![]() | |
ModelClass * | m_model |
corresponding model | |
![]() | |
ResizeMode | m_resizeMode = PresizeSubset |
mode | |
RowsResizeMode | m_rowResizeMode = Interactive |
row resize mode for row height | |
SelectionMode | m_originalSelectionMode = this->selectionMode() |
Selection mode set. | |
int | m_resizeCount = 0 |
flag / counter, how many resize activities | |
int | m_skipResizeThreshold = 40 |
when to skip resize (rows count) | |
int | m_resizeAutoNthTime = 1 |
with ResizeAuto, resize every n-th time | |
std::chrono::milliseconds | m_loadIndicatorTimeoutDefault { 30 * 1000 } |
default time for timeout | |
bool | m_forceStretchLastColumnWhenResized |
a small table might (few columns) fail stretching, force again More... | |
bool | m_showingLoadIndicator = false |
showing loading indicator | |
bool | m_enabledLoadIndicator = false |
loading indicator enabled/disabled | |
bool | m_acceptClickSelection = false |
clicked | |
bool | m_acceptRowSelection = false |
selection changed | |
bool | m_acceptDoubleClickSelection = false |
double clicked | |
bool | m_displayAutomatically = true |
display directly when loaded | |
bool | m_enableDeleteSelectedRows = false |
selected rows can be deleted | |
bool | m_dropIndicator = false |
drop indicator | |
bool | m_forceColumnsToMaxSize = true |
force that columns are extended to full viewport width | |
bool | m_allowCacheFileJson = true |
allow Cache format JSON to be loaded | |
QWidget * | m_filterWidget = nullptr |
filter widget or dialog | |
Menu | m_menus = MenuDefault |
Default menu settings. | |
menus::IMenuDelegate * | m_menu = nullptr |
custom menu if any | |
menus::CFontMenu * | m_fontMenu = nullptr |
font menu if applicable | |
CLoadIndicator * | m_loadIndicator = nullptr |
load indicator if needed | |
components::CTextEditDialog * | m_textEditDialog = nullptr |
text edit dialog | |
QMap< MenuFlag, menus::CMenuActions > | m_menuFlagActions |
initialized actions for menu flag (enum) | |
QString | m_saveFileName |
save file name (JSON) | |
swift::misc::CDirectories::ColumnIndex | m_dirSettingsIndex |
allows to set more specialized directories //!< remember last JSON directory, having this member allows to have specific dir More... | |
swift::misc::CSetting< swift::misc::settings::TDirectorySettings > | m_dirSettings |
directory for load/save More... | |
swift::misc::CSettingReadOnly< settings::TGeneralGui > | m_guiSettings |
general GUI settings More... | |
![]() | |
CDockWidgetInfoArea * | m_parentDockableInfoArea = nullptr |
my parent dockable widget | |
swift::misc::CConnectionGuard | m_connections |
connections | |
![]() | |
bool | isShowingLoadIndicator |
Load indicator property allows using in stylesheet. | |
Network servers.
Definition at line 18 of file serverview.h.