Loading...
Searching...
No Matches
CommandPalette

Detailed Description

Classes

struct  CommandListItem
 
class  CommandListDelegate
 
class  CommandListModel
 
class  CommandList
 
class  CommandListFilter
 
class  CommandPalette
 

Class Documentation

◆ CommandListItem

struct CommandListItem
Class Members
QString name
QString shortcut
QString action

◆ CommandListDelegate

class CommandListDelegate

Public Member Functions

 CommandListDelegate (QWidget *parent)
 
virtual void paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &idx) const override
 
virtual QSize sizeHint (const QStyleOptionViewItem &option, const QModelIndex &index) const override
 

Constructor & Destructor Documentation

◆ CommandListDelegate()

CommandListDelegate::CommandListDelegate ( QWidget * parent)

Member Function Documentation

◆ paint()

virtual void CommandListDelegate::paint ( QPainter * painter,
const QStyleOptionViewItem & option,
const QModelIndex & idx ) const
overridevirtual

◆ sizeHint()

virtual QSize CommandListDelegate::sizeHint ( const QStyleOptionViewItem & option,
const QModelIndex & index ) const
overridevirtual

◆ CommandListModel

class CommandListModel

Public Member Functions

 CommandListModel (QWidget *parent, const std::vector< CommandListItem > &items)
 
virtual QModelIndex index (int row, int col, const QModelIndex &parent) const override
 
virtual QModelIndex parent (const QModelIndex &i) const override
 
virtual bool hasChildren (const QModelIndex &parent) const override
 
virtual int rowCount (const QModelIndex &parent=QModelIndex()) const override
 
virtual int columnCount (const QModelIndex &parent) const override
 
virtual QVariant data (const QModelIndex &i, int role) const override
 
QString getActionForItem (int row)
 
void setFilterText (const QString &text)
 
size_t getRecentPosition (const QString &name) const
 
void addRecentItem (const QString &name)
 

Constructor & Destructor Documentation

◆ CommandListModel()

CommandListModel::CommandListModel ( QWidget * parent,
const std::vector< CommandListItem > & items )

Member Function Documentation

◆ index()

virtual QModelIndex CommandListModel::index ( int row,
int col,
const QModelIndex & parent ) const
overridevirtual

◆ parent()

virtual QModelIndex CommandListModel::parent ( const QModelIndex & i) const
overridevirtual

◆ hasChildren()

virtual bool CommandListModel::hasChildren ( const QModelIndex & parent) const
overridevirtual

◆ rowCount()

virtual int CommandListModel::rowCount ( const QModelIndex & parent = QModelIndex()) const
overridevirtual

◆ columnCount()

virtual int CommandListModel::columnCount ( const QModelIndex & parent) const
overridevirtual

◆ data()

virtual QVariant CommandListModel::data ( const QModelIndex & i,
int role ) const
overridevirtual

◆ getActionForItem()

QString CommandListModel::getActionForItem ( int row)

◆ setFilterText()

void CommandListModel::setFilterText ( const QString & text)

◆ getRecentPosition()

size_t CommandListModel::getRecentPosition ( const QString & name) const

◆ addRecentItem()

void CommandListModel::addRecentItem ( const QString & name)

◆ CommandList

class CommandList

Public Member Functions

 CommandList (CommandPalette *parent, const std::vector< CommandListItem > &items)
 
void setFilter (CommandListFilter *filter)
 
void setFilterText (const QString &text)
 
QString getActionForItem (int row)
 
QModelIndex index (int row, int col, const QModelIndex &parent=QModelIndex()) const
 
void addRecentItem (const QString &name)
 

Protected Member Functions

virtual void keyPressEvent (QKeyEvent *event) override
 
virtual void focusOutEvent (QFocusEvent *event) override
 

Constructor & Destructor Documentation

◆ CommandList()

CommandList::CommandList ( CommandPalette * parent,
const std::vector< CommandListItem > & items )

Member Function Documentation

◆ setFilter()

void CommandList::setFilter ( CommandListFilter * filter)
inline

◆ setFilterText()

void CommandList::setFilterText ( const QString & text)

◆ getActionForItem()

QString CommandList::getActionForItem ( int row)

◆ index()

QModelIndex CommandList::index ( int row,
int col,
const QModelIndex & parent = QModelIndex() ) const

◆ addRecentItem()

void CommandList::addRecentItem ( const QString & name)

◆ keyPressEvent()

virtual void CommandList::keyPressEvent ( QKeyEvent * event)
overrideprotectedvirtual

◆ focusOutEvent()

virtual void CommandList::focusOutEvent ( QFocusEvent * event)
overrideprotectedvirtual

◆ CommandListFilter

class CommandListFilter

Public Member Functions

 CommandListFilter (CommandPalette *parent, CommandList *list)
 

Protected Member Functions

bool event (QEvent *event) override
 
virtual void keyPressEvent (QKeyEvent *event) override
 
virtual void focusOutEvent (QFocusEvent *event) override
 

Constructor & Destructor Documentation

◆ CommandListFilter()

CommandListFilter::CommandListFilter ( CommandPalette * parent,
CommandList * list )

Member Function Documentation

◆ event()

bool CommandListFilter::event ( QEvent * event)
overrideprotected

◆ keyPressEvent()

virtual void CommandListFilter::keyPressEvent ( QKeyEvent * event)
overrideprotectedvirtual

◆ focusOutEvent()

virtual void CommandListFilter::focusOutEvent ( QFocusEvent * event)
overrideprotectedvirtual

◆ CommandPalette

class CommandPalette

Public Member Functions

 CommandPalette (QWidget *parent, UIActionHandler *handler)
 
 CommandPalette (QWidget *parent, UIActionHandler *handler, const UIActionContext &context)
 
void focusInput ()
 
void activateFocusedItem ()
 Activate the focused item, or topmost item if there is no selection.
 
void selectFirstItem ()
 
void close ()
 

Constructor & Destructor Documentation

◆ CommandPalette() [1/2]

CommandPalette::CommandPalette ( QWidget * parent,
UIActionHandler * handler )

◆ CommandPalette() [2/2]

CommandPalette::CommandPalette ( QWidget * parent,
UIActionHandler * handler,
const UIActionContext & context )

Member Function Documentation

◆ focusInput()

void CommandPalette::focusInput ( )

◆ activateFocusedItem()

void CommandPalette::activateFocusedItem ( )

Activate the focused item, or topmost item if there is no selection.

◆ selectFirstItem()

void CommandPalette::selectFirstItem ( )

◆ close()

void CommandPalette::close ( )