SettingsView

Detailed Description

Classes

struct  SettingsEntry
 
class  SettingsTreeModel
 
class  SettingsFilterProxyModel
 
class  SettingsOutlineProxyModel
 
class  SettingsEditor
 
class  SettingsDelegate
 
class  SettingsTreeView
 
class  BinaryViewScopeLabel
 
class  SettingsScopeBar
 
class  SearchFilter
 
class  SettingsView
 

Class Documentation

◆ SettingsEntry

struct SettingsEntry

Public Member Functions

 SettingsEntry (int p, const QString &h, const QString &g, std::vector< void * > &&j)
 

Public Attributes

int parent
 
QString heading
 
QString group
 
std::vector< void * > jsonDefs
 
std::vector< QString > subgroups
 

Constructor & Destructor Documentation

◆ SettingsEntry()

SettingsEntry::SettingsEntry ( int  p,
const QString &  h,
const QString &  g,
std::vector< void * > &&  j 
)
inline

Member Data Documentation

◆ parent

int SettingsEntry::parent

◆ heading

QString SettingsEntry::heading

◆ group

QString SettingsEntry::group

◆ jsonDefs

std::vector<void*> SettingsEntry::jsonDefs

◆ subgroups

std::vector<QString> SettingsEntry::subgroups

◆ SettingsTreeModel

class SettingsTreeModel

Public Member Functions

 SettingsTreeModel (std::string schema, QObject *parent=0)
 
 ~SettingsTreeModel ()
 
QVariant data (const QModelIndex &index, int role) const override
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
 
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const override
 
QModelIndex parent (const QModelIndex &index) const override
 
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 
int columnCount (const QModelIndex &parent=QModelIndex()) const override
 
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
 
void updateModel ()
 

Constructor & Destructor Documentation

◆ SettingsTreeModel()

SettingsTreeModel::SettingsTreeModel ( std::string  schema,
QObject *  parent = 0 
)

◆ ~SettingsTreeModel()

SettingsTreeModel::~SettingsTreeModel ( )

Member Function Documentation

◆ data()

QVariant SettingsTreeModel::data ( const QModelIndex &  index,
int  role 
) const
override

◆ flags()

Qt::ItemFlags SettingsTreeModel::flags ( const QModelIndex &  index) const
override

◆ headerData()

QVariant SettingsTreeModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role = Qt::DisplayRole 
) const
override

◆ index()

QModelIndex SettingsTreeModel::index ( int  row,
int  column,
const QModelIndex &  parent = QModelIndex() 
) const
override

◆ parent()

QModelIndex SettingsTreeModel::parent ( const QModelIndex &  index) const
override

◆ rowCount()

int SettingsTreeModel::rowCount ( const QModelIndex &  parent = QModelIndex()) const
override

◆ columnCount()

int SettingsTreeModel::columnCount ( const QModelIndex &  parent = QModelIndex()) const
override

◆ setData()

bool SettingsTreeModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role = Qt::EditRole 
)
override

◆ updateModel()

void SettingsTreeModel::updateModel ( )

◆ SettingsFilterProxyModel

class SettingsFilterProxyModel

Public Slots

void updateScope (const std::string &key, int scope)
 

Public Member Functions

 SettingsFilterProxyModel (QObject *parent=0)
 
int scopeFilter ()
 
void setScopeFilter (int scope)
 
int scopeForSchema ()
 
void setScopeForSchema (int scope)
 
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const override
 

Protected Member Functions

bool filterAcceptsRow (int sourceRow, const QModelIndex &sourceParent) const override
 
bool lessThan (const QModelIndex &left, const QModelIndex &right) const override
 

Constructor & Destructor Documentation

◆ SettingsFilterProxyModel()

SettingsFilterProxyModel::SettingsFilterProxyModel ( QObject *  parent = 0)

Member Function Documentation

◆ scopeFilter()

int SettingsFilterProxyModel::scopeFilter ( )
inline

◆ setScopeFilter()

void SettingsFilterProxyModel::setScopeFilter ( int  scope)
inline

◆ scopeForSchema()

int SettingsFilterProxyModel::scopeForSchema ( )
inline

◆ setScopeForSchema()

void SettingsFilterProxyModel::setScopeForSchema ( int  scope)
inline

◆ data()

QVariant SettingsFilterProxyModel::data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const
override

◆ filterAcceptsRow()

bool SettingsFilterProxyModel::filterAcceptsRow ( int  sourceRow,
const QModelIndex &  sourceParent 
) const
overrideprotected

◆ lessThan()

bool SettingsFilterProxyModel::lessThan ( const QModelIndex &  left,
const QModelIndex &  right 
) const
overrideprotected

◆ updateScope

void SettingsFilterProxyModel::updateScope ( const std::string &  key,
int  scope 
)
inlineslot

◆ SettingsOutlineProxyModel

class SettingsOutlineProxyModel

Public Member Functions

 SettingsOutlineProxyModel (QObject *parent=0)
 

Protected Member Functions

bool filterAcceptsRow (int sourceRow, const QModelIndex &sourceParent) const override
 

Constructor & Destructor Documentation

◆ SettingsOutlineProxyModel()

SettingsOutlineProxyModel::SettingsOutlineProxyModel ( QObject *  parent = 0)

Member Function Documentation

◆ filterAcceptsRow()

bool SettingsOutlineProxyModel::filterAcceptsRow ( int  sourceRow,
const QModelIndex &  sourceParent 
) const
overrideprotected

◆ SettingsEditor

class SettingsEditor

Public Slots

void updateScope (BinaryViewRef, BNSettingsScope)
 
void updateSize ()
 
void notifyGeometryChanged ()
 
void updateViewMode (bool enabled)
 

Signals

void settingChanged ()
 
void allSettingsChanged ()
 
void showIdentifiers (bool enable)
 
void notifyScope (const std::string &key, int scope)
 
void notifySettingChanged (QString)
 
void notifyNeedsRestart ()
 

Public Member Functions

 SettingsEditor (QWidget *parent, SettingsRef settings, BinaryViewRef view, BNSettingsScope scope, const Json::Value *setting)
 
 ~SettingsEditor ()
 
void setSetting (const Json::Value *value, bool updateSchema=false)
 

Protected Member Functions

bool eventFilter (QObject *obj, QEvent *event) override
 
void mousePressEvent (QMouseEvent *event) override
 
void paintEvent (QPaintEvent *event) override
 

Constructor & Destructor Documentation

◆ SettingsEditor()

SettingsEditor::SettingsEditor ( QWidget *  parent,
SettingsRef  settings,
BinaryViewRef  view,
BNSettingsScope  scope,
const Json::Value *  setting 
)

◆ ~SettingsEditor()

SettingsEditor::~SettingsEditor ( )

Member Function Documentation

◆ setSetting()

void SettingsEditor::setSetting ( const Json::Value *  value,
bool  updateSchema = false 
)

◆ settingChanged

void SettingsEditor::settingChanged ( )
signal

◆ allSettingsChanged

void SettingsEditor::allSettingsChanged ( )
signal

◆ showIdentifiers

void SettingsEditor::showIdentifiers ( bool  enable)
signal

◆ notifyScope

void SettingsEditor::notifyScope ( const std::string &  key,
int  scope 
)
signal

◆ notifySettingChanged

void SettingsEditor::notifySettingChanged ( QString  )
signal

◆ notifyNeedsRestart

void SettingsEditor::notifyNeedsRestart ( )
signal

◆ updateScope

void SettingsEditor::updateScope ( BinaryViewRef  ,
BNSettingsScope   
)
slot

◆ updateSize

void SettingsEditor::updateSize ( )
slot

◆ notifyGeometryChanged

void SettingsEditor::notifyGeometryChanged ( )
slot

◆ updateViewMode

void SettingsEditor::updateViewMode ( bool  enabled)
slot

◆ eventFilter()

bool SettingsEditor::eventFilter ( QObject *  obj,
QEvent *  event 
)
overrideprotected

◆ mousePressEvent()

void SettingsEditor::mousePressEvent ( QMouseEvent *  event)
overrideprotected

◆ paintEvent()

void SettingsEditor::paintEvent ( QPaintEvent *  event)
overrideprotected

◆ SettingsDelegate

class SettingsDelegate

Public Slots

void notifyUpdateModel ()
 
void updateFonts ()
 
void updateModel ()
 
void updateScope (BinaryViewRef, BNSettingsScope)
 
void notifyResizeEvent ()
 
void updateViewMode (bool enabled) const
 

Signals

void refreshAllSettings () const
 
void scopeChanged (BinaryViewRef, BNSettingsScope)
 
void sizeChanged ()
 
void viewModeChanged (bool enabled) const
 
void notifyNeedsRestart () const
 
void notifySettingChanged (QString settingId) const
 
void performHoverAction (QModelIndex index) const
 

Public Member Functions

 SettingsDelegate (QWidget *parent, SettingsRef settings, SettingsFilterProxyModel *filterModel, const std::function< void(const QModelIndex &index)> &hoverAction=nullptr)
 
 ~SettingsDelegate ()
 
void setDefaultSelection (const QString &group, const QString &subgroup, const std::function< void(const QString &, const QString &)> &selectionAction)
 
void paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
 
QSize sizeHint (const QStyleOptionViewItem &option, const QModelIndex &index) const override
 
QWidget * createEditor (QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override
 
void setEditorData (QWidget *editor, const QModelIndex &index) const override
 
void setModelData (QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override
 
void updateEditorGeometry (QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const override
 

Constructor & Destructor Documentation

◆ SettingsDelegate()

SettingsDelegate::SettingsDelegate ( QWidget *  parent,
SettingsRef  settings,
SettingsFilterProxyModel filterModel,
const std::function< void(const QModelIndex &index)> &  hoverAction = nullptr 
)

◆ ~SettingsDelegate()

SettingsDelegate::~SettingsDelegate ( )

Member Function Documentation

◆ setDefaultSelection()

void SettingsDelegate::setDefaultSelection ( const QString &  group,
const QString &  subgroup,
const std::function< void(const QString &, const QString &)> &  selectionAction 
)

◆ paint()

void SettingsDelegate::paint ( QPainter *  painter,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
override

◆ sizeHint()

QSize SettingsDelegate::sizeHint ( const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
override

◆ createEditor()

QWidget * SettingsDelegate::createEditor ( QWidget *  parent,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
override

◆ setEditorData()

void SettingsDelegate::setEditorData ( QWidget *  editor,
const QModelIndex &  index 
) const
override

◆ setModelData()

void SettingsDelegate::setModelData ( QWidget *  editor,
QAbstractItemModel *  model,
const QModelIndex &  index 
) const
override

◆ updateEditorGeometry()

void SettingsDelegate::updateEditorGeometry ( QWidget *  editor,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
override

◆ refreshAllSettings

void SettingsDelegate::refreshAllSettings ( ) const
signal

◆ scopeChanged

void SettingsDelegate::scopeChanged ( BinaryViewRef  ,
BNSettingsScope   
)
signal

◆ sizeChanged

void SettingsDelegate::sizeChanged ( )
signal

◆ viewModeChanged

void SettingsDelegate::viewModeChanged ( bool  enabled) const
signal

◆ notifyNeedsRestart

void SettingsDelegate::notifyNeedsRestart ( ) const
signal

◆ notifySettingChanged

void SettingsDelegate::notifySettingChanged ( QString  settingId) const
signal

◆ performHoverAction

void SettingsDelegate::performHoverAction ( QModelIndex  index) const
signal

◆ notifyUpdateModel

void SettingsDelegate::notifyUpdateModel ( )
slot

◆ updateFonts

void SettingsDelegate::updateFonts ( )
slot

◆ updateModel

void SettingsDelegate::updateModel ( )
slot

◆ updateScope

void SettingsDelegate::updateScope ( BinaryViewRef  ,
BNSettingsScope   
)
slot

◆ notifyResizeEvent

void SettingsDelegate::notifyResizeEvent ( )
slot

◆ updateViewMode

void SettingsDelegate::updateViewMode ( bool  enabled) const
slot

◆ SettingsTreeView

class SettingsTreeView

Public Slots

void modelChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight)
 

Public Member Functions

 SettingsTreeView (QWidget *parent)
 
 ~SettingsTreeView ()
 
void updateTheme ()
 

Protected Member Functions

virtual void resizeEvent (QResizeEvent *event) override
 

Constructor & Destructor Documentation

◆ SettingsTreeView()

SettingsTreeView::SettingsTreeView ( QWidget *  parent)
explicit

◆ ~SettingsTreeView()

SettingsTreeView::~SettingsTreeView ( )

Member Function Documentation

◆ updateTheme()

void SettingsTreeView::updateTheme ( )

◆ resizeEvent()

virtual void SettingsTreeView::resizeEvent ( QResizeEvent *  event)
overrideprotectedvirtual

◆ modelChanged

void SettingsTreeView::modelChanged ( const QModelIndex &  topLeft,
const QModelIndex &  bottomRight 
)
slot

◆ BinaryViewScopeLabel

class BinaryViewScopeLabel

Signals

void itemSelected (BinaryViewRef, BNSettingsScope)
 
- Signals inherited from MenuHelper
void clicked ()
 

Public Member Functions

 BinaryViewScopeLabel (QWidget *parent, const QString &name="", BNSettingsScope scope=SettingsAutoScope)
 
void refresh ()
 
void setSelection (BinaryViewRef view, BNSettingsScope scope)
 
const QString & currentSelection ()
 
BinaryViewRef currentBinaryView ()
 
- Public Member Functions inherited from MenuHelper
 MenuHelper ()
 
 MenuHelper (QWidget *parent)
 
void setBackgroundColorRole (QPalette::ColorRole role)
 
void setActiveBackgroundColorRole (QPalette::ColorRole role)
 
void setPressedBackgroundColorRole (QPalette::ColorRole role)
 
void setForegroundColorRole (QPalette::ColorRole role)
 
void setActiveForegroundColorRole (QPalette::ColorRole role)
 
void setPressedForegroundColorRole (QPalette::ColorRole role)
 

Protected Member Functions

virtual void showEvent (QShowEvent *event) override
 
virtual void showMenu () override
 
- Protected Member Functions inherited from MenuHelper
void enterEvent (QEnterEvent *event) override
 
void leaveEvent (QEvent *event) override
 
void mousePressEvent (QMouseEvent *event) override
 
void mouseReleaseEvent (QMouseEvent *event) override
 
void updateColors ()
 

Additional Inherited Members

- Protected Slots inherited from MenuHelper
virtual void showMenu ()=0
 
- Protected Attributes inherited from MenuHelper
Menu m_menu
 
ContextMenuManagerm_contextMenuManager
 
QTimer * m_timer
 
bool m_active
 
bool m_pressed
 

Constructor & Destructor Documentation

◆ BinaryViewScopeLabel()

BinaryViewScopeLabel::BinaryViewScopeLabel ( QWidget *  parent,
const QString &  name = "",
BNSettingsScope  scope = SettingsAutoScope 
)

Member Function Documentation

◆ refresh()

void BinaryViewScopeLabel::refresh ( )

◆ setSelection()

void BinaryViewScopeLabel::setSelection ( BinaryViewRef  view,
BNSettingsScope  scope 
)

◆ currentSelection()

const QString & BinaryViewScopeLabel::currentSelection ( )
inline

◆ currentBinaryView()

BinaryViewRef BinaryViewScopeLabel::currentBinaryView ( )
inline

◆ itemSelected

void BinaryViewScopeLabel::itemSelected ( BinaryViewRef  ,
BNSettingsScope   
)
signal

◆ showEvent()

virtual void BinaryViewScopeLabel::showEvent ( QShowEvent *  event)
overrideprotectedvirtual

◆ showMenu()

virtual void BinaryViewScopeLabel::showMenu ( )
overrideprotectedvirtual

Implements MenuHelper.

◆ SettingsScopeBar

class SettingsScopeBar

Signals

void scopeChanged (BinaryViewRef, BNSettingsScope)
 

Public Member Functions

 SettingsScopeBar (QWidget *parent=nullptr)
 
void refresh ()
 
void setResource (BinaryViewRef view)
 
void setScope (BNSettingsScope scope)
 
void updateTheme ()
 

Constructor & Destructor Documentation

◆ SettingsScopeBar()

SettingsScopeBar::SettingsScopeBar ( QWidget *  parent = nullptr)

Member Function Documentation

◆ refresh()

void SettingsScopeBar::refresh ( )

◆ setResource()

void SettingsScopeBar::setResource ( BinaryViewRef  view)

◆ setScope()

void SettingsScopeBar::setScope ( BNSettingsScope  scope)

◆ updateTheme()

void SettingsScopeBar::updateTheme ( )

◆ scopeChanged

void SettingsScopeBar::scopeChanged ( BinaryViewRef  ,
BNSettingsScope   
)
signal

◆ SearchFilter

class SearchFilter

Signals

void delayedTextChanged ()
 

Public Member Functions

 SearchFilter (QWidget *parent=nullptr)
 
void addTag (const QString &tagName, int tag)
 
void setDelay (int msec=100)
 
void setFilter ()
 
std::pair< QString, std::vector< int > > getSearchParams ()
 

Protected Member Functions

void keyPressEvent (QKeyEvent *event) override
 

Constructor & Destructor Documentation

◆ SearchFilter()

SearchFilter::SearchFilter ( QWidget *  parent = nullptr)

Member Function Documentation

◆ addTag()

void SearchFilter::addTag ( const QString &  tagName,
int  tag 
)

◆ setDelay()

void SearchFilter::setDelay ( int  msec = 100)
inline

◆ setFilter()

void SearchFilter::setFilter ( )

◆ getSearchParams()

std::pair< QString, std::vector< int > > SearchFilter::getSearchParams ( )

◆ keyPressEvent()

void SearchFilter::keyPressEvent ( QKeyEvent *  event)
overrideprotected

◆ delayedTextChanged

void SearchFilter::delayedTextChanged ( )
signal

◆ SettingsView

class SettingsView

Public Slots

void updateFonts ()
 
void updateTheme ()
 

Signals

void fontsChanged ()
 
void notifyNeedsRestart ()
 
void notifySettingChanged (QString settingId) const
 

Public Member Functions

 SettingsView (QWidget *parent)
 
 SettingsView (QWidget *parent, SettingsRef settings)
 
 ~SettingsView ()
 
SettingsRef getSettings ()
 
void openPersistentEditors (int numToOpen=0, bool update=true)
 
void init (std::string schema, bool uiScopeSelection)
 
void refreshAllSettings ()
 
void refreshCurrentScope ()
 
void setData (BinaryViewRef view, const QString &name="")
 
void setScope (BNSettingsScope scope)
 
void setDefaultGroupSelection (const QString &group, const QString &subgroup="")
 
void focusSearch ()
 
void setSearchFilter (const QString &filter)
 

Constructor & Destructor Documentation

◆ SettingsView() [1/2]

SettingsView::SettingsView ( QWidget *  parent)

◆ SettingsView() [2/2]

SettingsView::SettingsView ( QWidget *  parent,
SettingsRef  settings 
)

◆ ~SettingsView()

SettingsView::~SettingsView ( )

Member Function Documentation

◆ getSettings()

SettingsRef SettingsView::getSettings ( )
inline

◆ openPersistentEditors()

void SettingsView::openPersistentEditors ( int  numToOpen = 0,
bool  update = true 
)

◆ init()

void SettingsView::init ( std::string  schema,
bool  uiScopeSelection 
)

◆ refreshAllSettings()

void SettingsView::refreshAllSettings ( )

◆ refreshCurrentScope()

void SettingsView::refreshCurrentScope ( )

◆ setData()

void SettingsView::setData ( BinaryViewRef  view,
const QString &  name = "" 
)

◆ setScope()

void SettingsView::setScope ( BNSettingsScope  scope)

◆ setDefaultGroupSelection()

void SettingsView::setDefaultGroupSelection ( const QString &  group,
const QString &  subgroup = "" 
)

◆ focusSearch()

void SettingsView::focusSearch ( )

◆ setSearchFilter()

void SettingsView::setSearchFilter ( const QString &  filter)
inline

◆ updateFonts

void SettingsView::updateFonts ( )
slot

◆ updateTheme

void SettingsView::updateTheme ( )
slot

◆ fontsChanged

void SettingsView::fontsChanged ( )
signal

◆ notifyNeedsRestart

void SettingsView::notifyNeedsRestart ( )
signal

◆ notifySettingChanged

void SettingsView::notifySettingChanged ( QString  settingId) const
signal