Loading...
Searching...
No Matches
CommandPalette

Detailed Description

Classes

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

Class Documentation

◆ CommandListItem

struct CommandListItem

Public Types

enum  CommandListItemType {
  Help , UIAction , OpenTab , NavigationHistory ,
  RecentFile , RecentProject , ProjectFile , Expression ,
  RecentExpression , Function , Symbol , Type ,
  String , DerivedString , LastItemType
}

Public Attributes

CommandListItemType type
QString name
QString secondary
QString shortcut
QString extraSearchableText
QVariant action
Qt::TextElideMode secondaryElide = Qt::ElideRight
int score = 0
bool addToRecents = true
bool includeUnfiltered = true
bool scoreFast = false

Member Enumeration Documentation

◆ CommandListItemType

Enumerator
Help 
UIAction 
OpenTab 
NavigationHistory 
RecentFile 
RecentProject 
ProjectFile 
Expression 
RecentExpression 
Function 
Symbol 
Type 
String 
DerivedString 
LastItemType 

Member Data Documentation

◆ type

CommandListItemType CommandListItem::type

◆ name

QString CommandListItem::name

◆ secondary

QString CommandListItem::secondary

◆ shortcut

QString CommandListItem::shortcut

◆ extraSearchableText

QString CommandListItem::extraSearchableText

◆ action

QVariant CommandListItem::action

◆ secondaryElide

Qt::TextElideMode CommandListItem::secondaryElide = Qt::ElideRight

◆ score

int CommandListItem::score = 0

◆ addToRecents

bool CommandListItem::addToRecents = true

◆ includeUnfiltered

bool CommandListItem::includeUnfiltered = true

◆ scoreFast

bool CommandListItem::scoreFast = false

◆ CommandListItemSearchInfo

struct CommandListItemSearchInfo

Static Public Member Functions

static std::vector< CommandListItemSearchInfoGetSearchTypes ()

Public Attributes

std::unordered_set< CommandListItem::CommandListItemTypetypes
QString name
QString searchName
std::string prefix
QKeySequence shortcut

Member Function Documentation

◆ GetSearchTypes()

std::vector< CommandListItemSearchInfo > CommandListItemSearchInfo::GetSearchTypes ( )
static

Member Data Documentation

◆ types

std::unordered_set<CommandListItem::CommandListItemType> CommandListItemSearchInfo::types

◆ name

QString CommandListItemSearchInfo::name

◆ searchName

QString CommandListItemSearchInfo::searchName

◆ prefix

std::string CommandListItemSearchInfo::prefix

◆ shortcut

QKeySequence CommandListItemSearchInfo::shortcut

◆ 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)
 ~CommandListModel ()
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
CommandListItem getItem (int row)
void setFilterText (const QString &text)
size_t getRecentPosition (const CommandListItem &item) const
void addRecentItem (const CommandListItem &item)
void clearCommandList ()
void generateCommandList (UIActionHandler *handler, const UIActionContext &context)
void cancelGenerateCommandList ()
void scoreCommandList (CommandListScoreWorker::OrderStrategy strategy)
void cancelScoreCommandList ()
void pauseCommandListUpdates ()
void unpauseCommandListUpdates ()
void updateDisplayedItems ()

Constructor & Destructor Documentation

◆ CommandListModel()

CommandListModel::CommandListModel ( QWidget * parent)

◆ ~CommandListModel()

CommandListModel::~CommandListModel ( )

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

◆ getItem()

CommandListItem CommandListModel::getItem ( int row)

◆ setFilterText()

void CommandListModel::setFilterText ( const QString & text)

◆ getRecentPosition()

size_t CommandListModel::getRecentPosition ( const CommandListItem & item) const

◆ addRecentItem()

void CommandListModel::addRecentItem ( const CommandListItem & item)

◆ clearCommandList()

void CommandListModel::clearCommandList ( )

◆ generateCommandList()

void CommandListModel::generateCommandList ( UIActionHandler * handler,
const UIActionContext & context )

◆ cancelGenerateCommandList()

void CommandListModel::cancelGenerateCommandList ( )

◆ scoreCommandList()

void CommandListModel::scoreCommandList ( CommandListScoreWorker::OrderStrategy strategy)

◆ cancelScoreCommandList()

void CommandListModel::cancelScoreCommandList ( )

◆ pauseCommandListUpdates()

void CommandListModel::pauseCommandListUpdates ( )

◆ unpauseCommandListUpdates()

void CommandListModel::unpauseCommandListUpdates ( )

◆ updateDisplayedItems()

void CommandListModel::updateDisplayedItems ( )

◆ CommandList

class CommandList

Public Member Functions

 CommandList (CommandPalette *parent)
void setFilter (CommandListFilter *filter)
void setFilterText (const QString &text)
CommandListItem getItem (int row)
QModelIndex index (int row, int col, const QModelIndex &parent=QModelIndex()) const
void addRecentItem (const CommandListItem &item)
void clearCommandList ()
void generateCommandList (UIActionHandler *handler, const UIActionContext &context)
void cancelGenerateCommandList ()
void pauseCommandListUpdates ()
void unpauseCommandListUpdates ()

Protected Member Functions

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

Constructor & Destructor Documentation

◆ CommandList()

CommandList::CommandList ( CommandPalette * parent)

Member Function Documentation

◆ setFilter()

void CommandList::setFilter ( CommandListFilter * filter)
inline

◆ setFilterText()

void CommandList::setFilterText ( const QString & text)

◆ getItem()

CommandListItem CommandList::getItem ( int row)

◆ index()

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

◆ addRecentItem()

void CommandList::addRecentItem ( const CommandListItem & item)

◆ clearCommandList()

void CommandList::clearCommandList ( )

◆ generateCommandList()

void CommandList::generateCommandList ( UIActionHandler * handler,
const UIActionContext & context )

◆ cancelGenerateCommandList()

void CommandList::cancelGenerateCommandList ( )

◆ pauseCommandListUpdates()

void CommandList::pauseCommandListUpdates ( )

◆ unpauseCommandListUpdates()

void CommandList::unpauseCommandListUpdates ( )

◆ 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 focusInEvent (QFocusEvent *event) override
virtual void focusOutEvent (QFocusEvent *event) override
virtual void paintEvent (QPaintEvent *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

◆ focusInEvent()

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

◆ focusOutEvent()

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

◆ paintEvent()

virtual void CommandListFilter::paintEvent ( QPaintEvent * event)
overrideprotectedvirtual

◆ CommandPalette

class CommandPalette

Public Member Functions

 CommandPalette (QWidget *parent)
void openWithInput (const QString &text)
void focusInput ()
void clearCommandList ()
void generateCommandList (UIActionHandler *handler, const UIActionContext &context)
void activateFocusedItem ()
 Activate the focused item, or topmost item if there is no selection.
void selectFirstItem ()
void close (bool restoreFocus=true)
void activateItem (const CommandListItem &item)

Constructor & Destructor Documentation

◆ CommandPalette()

CommandPalette::CommandPalette ( QWidget * parent)

Member Function Documentation

◆ openWithInput()

void CommandPalette::openWithInput ( const QString & text)

◆ focusInput()

void CommandPalette::focusInput ( )

◆ clearCommandList()

void CommandPalette::clearCommandList ( )

◆ generateCommandList()

void CommandPalette::generateCommandList ( UIActionHandler * handler,
const UIActionContext & context )

◆ activateFocusedItem()

void CommandPalette::activateFocusedItem ( )

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

◆ selectFirstItem()

void CommandPalette::selectFirstItem ( )

◆ close()

void CommandPalette::close ( bool restoreFocus = true)

◆ activateItem()

void CommandPalette::activateItem ( const CommandListItem & item)