assign numbers 1-9 as shortcuts for the first 9 results of system applications
Αυτή η υποβολή περιλαμβάνεται σε:
γονέας
45abb2bf27
υποβολή
1dc7ef935d
@ -57,6 +57,7 @@ int EntryPushButton::getRow() const { return config.row; }
|
||||
int EntryPushButton::getCol() const { return config.col; }
|
||||
QString EntryPushButton::getName() const { return config.name; }
|
||||
QString EntryPushButton::getShortcutKey() const { return config.key; }
|
||||
void EntryPushButton::setShortcutKey(QString key) { this->config.key = key; }
|
||||
void EntryPushButton::setRow(int row) { this->config.row = row; }
|
||||
void EntryPushButton::setCol(int col) { this->config.col = col; }
|
||||
QStringList EntryPushButton::getArguments() const { return this->config.arguments; }
|
||||
|
@ -43,6 +43,7 @@ public:
|
||||
QString getCommand() const;
|
||||
void setRow(int row);
|
||||
void setCol(int col);
|
||||
void setShortcutKey(QString key);
|
||||
|
||||
|
||||
};
|
||||
|
@ -269,8 +269,8 @@ void Window::keyPressEvent(QKeyEvent *event)
|
||||
QKeySequence seq(event->key());
|
||||
QString key = seq.toString().toLower();
|
||||
|
||||
auto it = std::find_if(userEntryButtons.begin(), userEntryButtons.end(), [&key](const EntryPushButton *y) { return y->getShortcutKey() == key; });
|
||||
if(it != userEntryButtons.end())
|
||||
auto it = std::find_if(buttonsInGrid.begin(), buttonsInGrid.end(), [&key](const EntryPushButton *y) { return y->getShortcutKey() == key; });
|
||||
if(it != buttonsInGrid.end())
|
||||
{
|
||||
buttonClick(**it);
|
||||
}
|
||||
@ -304,7 +304,10 @@ void Window::filterGridFor(QString filter)
|
||||
if(button->getName().contains(filter, Qt::CaseInsensitive))
|
||||
{
|
||||
button->setVisible(true);
|
||||
button->setShortcut(QString::number(i++));
|
||||
if(i < 10)
|
||||
{
|
||||
button->setShortcutKey(QString::number(i++));
|
||||
}
|
||||
grid->addWidget(button, currow, curcol++);
|
||||
this->buttonsInGrid.append(button);
|
||||
if(curcol == 3)
|
||||
|
Φόρτωση…
Αναφορά σε νέο ζήτημα
Block a user