swift
Public Types | Public Slots | Signals | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Properties | Friends | List of all members
swift::gui::views::CViewBaseNonTemplate Class Referenceabstract

Non templated base class, allows Q_OBJECT and signals / slots to be used. More...

Inheritance diagram for swift::gui::views::CViewBaseNonTemplate:
[legend]

Public Types

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...
 

Public Slots

virtual void resizeToContents ()
 Resize to contents, strategy depends on container size.
 
virtual void fullResizeToContents ()
 Full resizing to content, might be slow. More...
 
virtual void presizeOrFullResizeToContents ()=0
 Depending on CViewBaseNonTemplate::ResizeSubsetThreshold presize or fully resize.
 
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.
 
virtual int removeSelectedRows ()=0
 Remove selected rows.
 
virtual void clearHighlighting ()=0
 Clear any highlighted objects.
 
virtual void materializeFilter ()=0
 Materialize filter.
 

Signals

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.
 

Public Member Functions

virtual void clear ()=0
 Clear data.
 
virtual bool isEmpty () const =0
 Empty?
 
virtual int rowCount () const =0
 Elements in container.
 
virtual bool isOrderable () const =0
 Is the corresponding model orderable, swift::misc::models::CListModelBaseNonTemplate::isOrderable.
 
virtual bool setSorting (const swift::misc::CPropertyIndex &propertyIndex, Qt::SortOrder order=Qt::AscendingOrder)=0
 Sorting. More...
 
virtual void sortByPropertyIndex (const swift::misc::CPropertyIndex &propertyIndex, Qt::SortOrder order=Qt::AscendingOrder)=0
 Sort by index. More...
 
virtual void setNoSorting ()=0
 Disable sorting. More...
 
virtual swift::misc::CPropertyIndex getSortProperty () const =0
 Sorted by property. More...
 
virtual int getSortColumn () const =0
 Get sort column property index. More...
 
virtual bool hasValidSortColumn () const =0
 Has valid sort column? More...
 
virtual bool endsWithEmptyColumn () const =0
 Using void column at the end? More...
 
virtual Qt::SortOrder getSortOrder () const =0
 Get sort order. More...
 
virtual void allowDragDrop (bool allowDrag, bool allowDrop, bool allowDropJsonFile=false)=0
 Allow to drag and/or drop value objects.
 
virtual bool isDropAllowed () const =0
 Drop allowed?
 
virtual bool acceptDrop (const QMimeData *mimeData) const =0
 Accept drop data?
 
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::IMenuDelegatesetCustomMenu (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".
 
- Public Member Functions inherited from swift::gui::COverlayMessagesTableView
 COverlayMessagesTableView (QWidget *parent=nullptr)
 Constructor.
 
- Public Member Functions inherited from swift::gui::COverlayMessagesBase< QTableView >
virtual ~COverlayMessagesBase ()
 Destructor.
 
void initOverlayMessages (QSize inner={})
 Init, normally we use lazy init, but by calling init explicitly we can force initalization. More...
 
void activateTextMessages (bool activate)
 Active send/receive of text messages. More...
 
void showStatusMessagesFrame ()
 Show the inner frame.
 
void setOverlaySizeFactors (double widthFactor, double heightFactor, double middleFactor=2)
 Set the size factors.
 
void setForceSmall (bool force)
 Force small (smaller layout) More...
 
void setReducedInfo (bool reduced)
 Display reduced information. More...
 
void showOverlayMessagesWithConfirmation (const swift::misc::CStatusMessageList &messages, bool appendOldMessages, const QString &confirmationMessage, std::function< void()> okLambda, QMessageBox::StandardButton defaultButton=QMessageBox::Cancel, std::chrono::milliseconds timeout=std::chrono::milliseconds(0))
 Show multiple messages with confirmation bar. More...
 
void clearOverlayMessages ()
 Clear the overlay messages. More...
 
void closeOverlay ()
 Close button clicked. More...
 
void showOverlayMessages (const swift::misc::CStatusMessageList &messages, bool appendOldMessages=false, std::chrono::milliseconds timeout=std::chrono::milliseconds(0))
 Show multiple messages. More...
 
void showOverlayMessagesOrSingleMessage (const swift::misc::CStatusMessageList &messages, bool appendOldMessages=false, std::chrono::milliseconds timeout=std::chrono::milliseconds(0))
 Show multiple messages or a single message. More...
 
void showOverlayMessagesOrHTMLMessage (const swift::misc::CStatusMessageList &messages, bool appendOldMessages=false, std::chrono::milliseconds timeout=std::chrono::milliseconds(0))
 Show multiple messages or a single message (HTML) More...
 
void sortOverlayMessages (const swift::misc::CPropertyIndex &property, Qt::SortOrder order)
 Sort of overlay messages. More...
 
void setOverlayMessagesSorting (const swift::misc::CPropertyIndex &property, Qt::SortOrder order)
 Set sorting of overlay messages. More...
 
bool showOverlayMessage (const swift::misc::CStatusMessage &message, std::chrono::milliseconds timeout=std::chrono::milliseconds(0))
 Show single message. More...
 
bool showOverlayTextMessage (const swift::misc::network::CTextMessage &textMessage, std::chrono::milliseconds timeout=std::chrono::milliseconds(0))
 Info message, based on text message. More...
 
void showOverlayVariant (const swift::misc::CVariant &variant, std::chrono::milliseconds timeout=std::chrono::milliseconds(0))
 Display one of the supported types. More...
 
void showOverlayImage (const swift::misc::CPixmap &pixmap, std::chrono::milliseconds timeout=std::chrono::milliseconds(0))
 Image. More...
 
bool showOverlayHTMLMessage (const QString &htmlMessage, std::chrono::milliseconds timeout=std::chrono::milliseconds(0))
 HTML message. More...
 
bool showOverlayHTMLMessage (const swift::misc::CStatusMessage &message, std::chrono::milliseconds timeout=std::chrono::milliseconds(0))
 HTML message. More...
 
void showDownloadProgress (int progress, qint64 current, qint64 max, const QUrl &url, std::chrono::milliseconds timeout=std::chrono::milliseconds(0))
 Download progress. More...
 
void showOverlayInlineTextMessage (components::TextMessageTab tab)
 Image. More...
 
void showOverlayInlineTextMessage (const swift::misc::aviation::CCallsign &callsign)
 Image. More...
 
- Public Member Functions inherited from swift::gui::CEnableForDockWidgetInfoArea
CDockWidgetInfoAreagetDockWidgetInfoArea () const
 Corresponding dockable widget in info area.
 
bool hasDockWidgetArea () const
 Has dock area?
 
CInfoAreagetParentInfoArea () const
 The parent info area.
 
bool isParentDockWidgetFloating () const
 Is the parent dockable widget floating?
 
bool isVisibleWidget () const
 Visible widget. More...
 
CEnableForFramelessWindowmainApplicationWindow () const
 Main application window if any.
 
QWidget * mainApplicationWindowWidget () const
 Main application window widget if any.
 
void displayMyself ()
 Display myself.
 

Static Public Attributes

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...
 

Protected Member Functions

 CViewBaseNonTemplate (QWidget *parent)
 Constructor.
 
virtual ~CViewBaseNonTemplate ()
 Destructor.
 
virtual void customMenu (menus::CMenuActions &menuActions)
 Method creating the menu. More...
 
virtual void performModeBasedResizeToContent ()=0
 Perform resizing (no presizing) / non slot method for template. More...
 
virtual int performUpdateContainer (const swift::misc::CVariant &variant, bool sort, bool resize)=0
 Helper method with template free signature. More...
 
virtual bool reachedResizeThreshold (int containerSize=-1) const =0
 Skip resizing because of size?
 
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.
 
virtual void updateSortIndicator ()=0
 Set the sort indicator to the current sort column.
 
virtual void mouseOverCallback (const QModelIndex &index, bool mouseOver)=0
 From delegate indicating we are in mouse over state.
 
virtual void drawDropIndicator (bool indicator)=0
 Draw drop indicator.
 
void saveJsonAction ()
 Save JSON for action/menu, void return signatur.
 
void saveSelectedJsonAction ()
 Save JSON for action/menu, void return signatur.
 
virtual void displayJsonPopup ()=0
 Display JSON data.
 
virtual void displaySelectedJsonPopup ()=0
 Display JSON data.
 
void loadJsonAction ()
 Load JSON for action/menu, void return signatur.
 
virtual swift::misc::CStatusMessage loadJsonFile (const QString &filePath)=0
 Load JSON file.
 
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...
 
virtual void onClicked (const QModelIndex &index)=0
 Index clicked.
 
virtual void onDoubleClicked (const QModelIndex &index)=0
 Index double clicked.
 
virtual void onRowSelected (const QModelIndex &index)=0
 Row selected.
 
virtual swift::misc::CStatusMessage loadJson (const QString &directory={})=0
 Load JSON.
 
virtual swift::misc::CStatusMessage saveJson (bool selectedOnly=false, const QString &directory={})=0
 Save JSON.
 
void triggerReload ()
 Trigger reload from backend by signal requestUpdate();.
 
void triggerReloadFromBackend ()
 Trigger reload from backend by signal requestNewBackendData()
 
virtual void removeFilter ()=0
 Remove filter.
 
void showVerticalHeader ()
 Vertical header.
 
virtual bool filterDialogFinished (int status)=0
 Filter dialog finished.
 
virtual bool filterWidgetChangedFilter (bool enabled)=0
 Filter changed in filter widget.
 
components::CTextEditDialogtextEditDialog ()
 Init text edit dialog if required and return pointer to it.
 
Functions from QTableView
virtual void resizeEvent (QResizeEvent *event)
 
virtual void dragEnterEvent (QDragEnterEvent *event)
 
virtual void dragMoveEvent (QDragMoveEvent *event)
 
virtual void dragLeaveEvent (QDragLeaveEvent *event)
 
virtual void dropEvent (QDropEvent *event)
 
void setMultiSelection ()
 Change selection modes.
 
void setExtendedSelection ()
 Change selection modes.
 
void setSingleSelection ()
 Change selection modes.
 
virtual void copy ()=0
 Clipboard cut/copy/paste.
 
virtual void cut ()=0
 Clipboard cut/copy/paste.
 
virtual void paste ()=0
 Clipboard cut/copy/paste.
 
- Protected Member Functions inherited from swift::gui::COverlayMessagesBase< QTableView >
 COverlayMessagesBase (QWidget *parent, Qt::WindowFlags f=Qt::WindowFlags())
 Constructor.
 
void initInnerFrame (double widthFactor=-1, double heightFactor=-1)
 Init the inner frame (if not yet initialized)
 
void initMinimalFrame (int lines=4)
 Init a minimal frame (smaller as the normal one)
 
bool hasMinimumSize (int w, int h) const
 Check minimum height/width.
 
virtual void keyPressEvent (QKeyEvent *event)
 
- Protected Member Functions inherited from swift::gui::CEnableForDockWidgetInfoArea
 CEnableForDockWidgetInfoArea (CDockWidgetInfoArea *parentInfoArea=nullptr)
 Constructor. More...
 
virtual ~CEnableForDockWidgetInfoArea ()
 Destructor.
 

Protected Attributes

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::IMenuDelegatem_menu = nullptr
 custom menu if any
 
menus::CFontMenum_fontMenu = nullptr
 font menu if applicable
 
CLoadIndicatorm_loadIndicator = nullptr
 load indicator if needed
 
components::CTextEditDialogm_textEditDialog = nullptr
 text edit dialog
 
QMap< MenuFlag, menus::CMenuActionsm_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::TDirectorySettingsm_dirSettings
 directory for load/save More...
 
swift::misc::CSettingReadOnly< settings::TGeneralGuim_guiSettings
 general GUI settings More...
 
- Protected Attributes inherited from swift::gui::COverlayMessagesBase< QTableView >
COverlayMessagesm_overlayMessages
 embedded QFrame with status messages
 
- Protected Attributes inherited from swift::gui::CEnableForDockWidgetInfoArea
CDockWidgetInfoAream_parentDockableInfoArea = nullptr
 my parent dockable widget
 
swift::misc::CConnectionGuard m_connections
 connections
 

Properties

bool isShowingLoadIndicator
 Load indicator property allows using in stylesheet.
 

Friends

class CViewBaseItemDelegate
 
class CViewBaseProxyStyle
 

Detailed Description

Non templated base class, allows Q_OBJECT and signals / slots to be used.

Definition at line 84 of file viewbase.h.

Member Enumeration Documentation

◆ MenuFlag

Menu flags.

Enumerator
MenuNone 

no menu

MenuClear 

allow clearing the view via menu

MenuRemoveSelectedRows 

allow to remove selected rows

MenuRefresh 

allow refreshing the view via menu

MenuBackend 

allow to request data from backend

MenuDisplayAutomatically 

allow to switch display automatically

MenuDisplayAutomaticallyAndRefresh 

should come together

MenuFilter 

filter can be opened

MenuMaterializeFilter 

materialize filter (filtered data become model data)

MenuSave 

save as JSON

MenuLoad 

load from JSON

MenuToggleSelectionMode 

allow to toggle selection mode

MenuOrderable 

items can be ordered (if container is swift::misc::IOrderableList

MenuCopy 

copy (for copy/paste)

MenuPaste 

paste (for copy/paste)

MenuCut 

cut (for copy/paste)

MenuFont 

font related menu (size)

MenuHighlightStashed 

highlight stashed models

MenuCanStashModels 

stash models

MenuDisableModelsTemp 

temp.

disable model

Definition at line 117 of file viewbase.h.

◆ ResizeMode

Resize mode, when to resize rows / columns.

Remarks
Using own resizing (other than QHeaderView::ResizeMode)
Enumerator
ResizingAuto 

resizing when below threshold,

See also
m_resizeAutoNthTime forcing only every n-th update to be resized
ResizingOnce 

only one time

PresizeSubset 

use a subset of the data to resize

ResizingAlways 

always resize

ResizingOff 

never

Definition at line 99 of file viewbase.h.

◆ RowsResizeMode

How rows are resized, makes sense when.

See also
ResizeMode is
ResizingOff

Definition at line 110 of file viewbase.h.

Member Function Documentation

◆ customMenu()

void swift::gui::views::CViewBaseNonTemplate::customMenu ( menus::CMenuActions menuActions)
protectedvirtual

Method creating the menu.

Remarks
override this method to contribute to the menu
See also
swift::gui::views::CViewBaseNonTemplate::customMenuRequested

QAction *a1 = menuActions.addAction(CIcons::resizeVertical16(), "Resize rows to content (auto), can be slow", CMenuAction::pathViewResize(), nullptr, { this, &CViewBaseNonTemplate::rowsResizeModeToContent }); a1->setEnabled(ww && m_rowResizeMode == Interactive && enabled && !autoResize); QAction *a2 = menuActions.addAction(CIcons::resizeVertical16(), "Resize rows interactively", CMenuAction::pathViewResize(), nullptr, { this, &CViewBaseNonTemplate::rowsResizeModeToInteractive }); a2->setEnabled(ww && m_rowResizeMode == Content && !autoResize);

Reimplemented in swift::gui::views::COrderableViewWithDbObjects< T >, swift::gui::views::COrderableViewWithDbObjects< swift::gui::models::CDistributorListModel >, swift::gui::views::COrderableViewWithDbObjects< models::CAircraftModelListModel >, swift::gui::views::CViewWithDbObjects< T >, swift::gui::views::CViewWithDbObjects< models::CAirlineIcaoCodeListModel >, swift::gui::views::CViewWithDbObjects< models::CAircraftCategoryListModel >, swift::gui::views::CViewWithDbObjects< models::CLiveryListModel >, swift::gui::views::CViewWithDbObjects< models::CAircraftIcaoCodeListModel >, swift::gui::views::CAtcStationView, swift::gui::views::CViewBase< T >, swift::gui::views::CViewBase< models::CServerListModel >, swift::gui::views::CViewBase< models::CUserListModel >, swift::gui::views::CViewBase< models::CTextMessageListModel >, swift::gui::views::CViewBase< models::CNameVariantPairModel >, swift::gui::views::CViewBase< models::CStatusMessageListModel >, swift::gui::views::CViewBase< models::CIdentifierListModel >, swift::gui::views::CViewBase< models::CMatchingStatisticsModel >, swift::gui::views::CViewBase< models::CCountryListModel >, swift::gui::views::CViewBase< models::CClientListModel >, swift::gui::views::CViewBase< models::CApplicationInfoListModel >, swift::gui::views::CViewBase< models::CAudioDeviceInfoListModel >, swift::gui::views::CUserView, swift::gui::views::CSimulatedAircraftView, swift::gui::views::CAircraftSituationView, and swift::gui::views::CAircraftModelView.

Definition at line 360 of file viewbasenontemplate.cpp.

◆ dragEnterEvent()

void swift::gui::views::CViewBaseNonTemplate::dragEnterEvent ( QDragEnterEvent *  event)
protectedvirtual

Definition at line 905 of file viewbasenontemplate.cpp.

◆ dragLeaveEvent()

void swift::gui::views::CViewBaseNonTemplate::dragLeaveEvent ( QDragLeaveEvent *  event)
protectedvirtual

Definition at line 918 of file viewbasenontemplate.cpp.

◆ dragMoveEvent()

void swift::gui::views::CViewBaseNonTemplate::dragMoveEvent ( QDragMoveEvent *  event)
protectedvirtual

Definition at line 912 of file viewbasenontemplate.cpp.

◆ dropEvent()

void swift::gui::views::CViewBaseNonTemplate::dropEvent ( QDropEvent *  event)
protectedvirtual

◆ endsWithEmptyColumn()

virtual bool swift::gui::views::CViewBaseNonTemplate::endsWithEmptyColumn ( ) const
pure virtual

◆ fullResizeToContents

void swift::gui::views::CViewBaseNonTemplate::fullResizeToContents ( )
virtualslot

Full resizing to content, might be slow.

!

Fixme:
2019-04 Disabled the magic FOO trick for resizing Not working anymore and NOT needed ??? anymore, seems like resize to maximum magic trick from: http://stackoverflow.com/q/3433664/356726 this->setVisible(false); const QRect vpOriginal = this->viewport()->geometry(); if (m_forceColumnsToMaxSize) { vpNew.setWidth(std::numeric_limits<qint32>::max()); // largest finite value QGuiApplication::screens(); const QRect screenGeometry = sGui->currentScreen()->geometry(); QRect vpNew = vpOriginal; vpNew.setWidth(screenGeometry.width()); this->viewport()->setGeometry(vpNew); }

Magic FOO if (m_forceColumnsToMaxSize) { this->viewport()->setGeometry(vpOriginal); } if I store the original visibility and then set it back here, the whole view disappears this->setVisible(true);

Definition at line 773 of file viewbasenontemplate.cpp.

◆ getRememberedLastJsonDirectory()

QString swift::gui::views::CViewBaseNonTemplate::getRememberedLastJsonDirectory ( ) const
protectedvirtual

JSON directory.

Remarks
Default implementation, can be overridden with specifi implementation

Definition at line 348 of file viewbasenontemplate.cpp.

◆ getSortColumn()

virtual int swift::gui::views::CViewBaseNonTemplate::getSortColumn ( ) const
pure virtual

◆ getSortOrder()

virtual Qt::SortOrder swift::gui::views::CViewBaseNonTemplate::getSortOrder ( ) const
pure virtual

◆ getSortProperty()

virtual swift::misc::CPropertyIndex swift::gui::views::CViewBaseNonTemplate::getSortProperty ( ) const
pure virtual

◆ hasValidSortColumn()

virtual bool swift::gui::views::CViewBaseNonTemplate::hasValidSortColumn ( ) const
pure virtual

◆ performModeBasedResizeToContent()

virtual void swift::gui::views::CViewBaseNonTemplate::performModeBasedResizeToContent ( )
protectedpure virtual

◆ performUpdateContainer()

virtual int swift::gui::views::CViewBaseNonTemplate::performUpdateContainer ( const swift::misc::CVariant variant,
bool  sort,
bool  resize 
)
protectedpure virtual

◆ rememberLastJsonDirectory()

void swift::gui::views::CViewBaseNonTemplate::rememberLastJsonDirectory ( const QString &  selectedFileOrDir)
protectedvirtual

JSON directory.

Remarks
Default implementation, can be overridden with specifi implementation

Definition at line 334 of file viewbasenontemplate.cpp.

◆ resizeEvent()

void swift::gui::views::CViewBaseNonTemplate::resizeEvent ( QResizeEvent *  event)
protectedvirtual

Reimplemented from swift::gui::COverlayMessagesBase< QTableView >.

Definition at line 497 of file viewbasenontemplate.cpp.

◆ rowsResizeModeToContent

void swift::gui::views::CViewBaseNonTemplate::rowsResizeModeToContent ( )
slot

Resize mode to content.

Remarks
extremely slow for larger views (means views with many rows)

Definition at line 693 of file viewbasenontemplate.cpp.

◆ setAutoResizeFrequency()

void swift::gui::views::CViewBaseNonTemplate::setAutoResizeFrequency ( int  updateEveryNthTime)
inline

In.

See also
ResizingAuto mode, how often to update. "1" updates every time, "2" every 2nd time, ..

Definition at line 216 of file viewbase.h.

◆ setForceColumnsToMaxSize()

void swift::gui::views::CViewBaseNonTemplate::setForceColumnsToMaxSize ( bool  force)
inline

Force that columns are extended to full viewport width. Workaround as of https://stackoverflow.com/q/3433664/356726.

Deprecated:
use setWordWrap

Definition at line 327 of file viewbase.h.

◆ setNoSorting()

virtual void swift::gui::views::CViewBaseNonTemplate::setNoSorting ( )
pure virtual

◆ setParentDockWidgetInfoArea()

bool swift::gui::views::CViewBaseNonTemplate::setParentDockWidgetInfoArea ( swift::gui::CDockWidgetInfoArea parentDockableWidget)
virtual

Corresponding dockable widget in info area.

Remarks
Usually set from CDockWidgetInfoArea when it is fully initialized

Reimplemented from swift::gui::CEnableForDockWidgetInfoArea.

Definition at line 96 of file viewbasenontemplate.cpp.

◆ setSelectionModel()

void swift::gui::views::CViewBaseNonTemplate::setSelectionModel ( QItemSelectionModel *  model)
virtual

Definition at line 161 of file viewbasenontemplate.cpp.

◆ setSorting()

virtual bool swift::gui::views::CViewBaseNonTemplate::setSorting ( const swift::misc::CPropertyIndex propertyIndex,
Qt::SortOrder  order = Qt::AscendingOrder 
)
pure virtual

◆ showLoadIndicator

int swift::gui::views::CViewBaseNonTemplate::showLoadIndicator ( int  containerSizeDependent = -1,
std::chrono::milliseconds  timeout = std::chrono::milliseconds { 0 },
bool  processEvents = true 
)
slot

Show loading indicator.

Parameters
containerSizeDependentcheck against resize threshold if indicator makes sense
timeoutMstimeout the loading indicator
processEventsforce event processing to display indicator by updating GUI

Definition at line 708 of file viewbasenontemplate.cpp.

◆ sortByPropertyIndex()

virtual void swift::gui::views::CViewBaseNonTemplate::sortByPropertyIndex ( const swift::misc::CPropertyIndex propertyIndex,
Qt::SortOrder  order = Qt::AscendingOrder 
)
pure virtual

Member Data Documentation

◆ m_dirSettings

swift::misc::CSetting<swift::misc::settings::TDirectorySettings> swift::gui::views::CViewBaseNonTemplate::m_dirSettings
protected
Initial value:
{
this
}

directory for load/save

Definition at line 613 of file viewbase.h.

◆ m_dirSettingsIndex

swift::misc::CDirectories::ColumnIndex swift::gui::views::CViewBaseNonTemplate::m_dirSettingsIndex
protected
Initial value:
= swift::misc::CDirectories::
IndexDirLastViewJsonOrDefault

allows to set more specialized directories //!< remember last JSON directory, having this member allows to have specific dir

Definition at line 610 of file viewbase.h.

◆ m_forceStretchLastColumnWhenResized

bool swift::gui::views::CViewBaseNonTemplate::m_forceStretchLastColumnWhenResized
protected
Initial value:
=
true

a small table might (few columns) fail stretching, force again

Definition at line 590 of file viewbase.h.

◆ m_guiSettings

swift::misc::CSettingReadOnly<settings::TGeneralGui> swift::gui::views::CViewBaseNonTemplate::m_guiSettings
protected
Initial value:

general GUI settings

Definition at line 616 of file viewbase.h.

◆ ResizeRowsToContentThreshold

constexpr int swift::gui::views::CViewBaseNonTemplate::ResizeRowsToContentThreshold = 20
staticconstexpr

When to use rows resizing (which is slow)

See also
rowsResizeModeToContent

Definition at line 157 of file viewbase.h.


The documentation for this class was generated from the following files: