The RecentTasksList class models the UI for a list of recently opened tasks.
More...
#include <recenttaskslist.h>
|
static QString | getDisplayNameForTaskPath (const QUrl &url) |
| getDisplayNameForTaskPath Extracts a display name suitable for displaying to the user from the task URL/file path. More...
|
|
The RecentTasksList class models the UI for a list of recently opened tasks.
◆ RecentTasksList()
geometrize::dialog::RecentTasksList::RecentTasksList |
( |
QWidget * |
parent = nullptr | ) |
|
|
explicit |
173 : QListWidget(parent),
d{std::make_unique<RecentTasksList::RecentTasksListImpl>(
this)}
◆ ~RecentTasksList()
geometrize::dialog::RecentTasksList::~RecentTasksList |
( |
| ) |
|
|
virtual |
◆ changeEvent()
void geometrize::dialog::RecentTasksList::changeEvent |
( |
QEvent * |
event | ) |
|
|
overrideprotected |
210 if (event->type() == QEvent::LanguageChange) {
211 d->onLanguageChange();
213 QWidget::changeEvent(event);
◆ getDisplayNameForTaskPath()
QString geometrize::dialog::RecentTasksList::getDisplayNameForTaskPath |
( |
const QUrl & |
url | ) |
|
|
static |
getDisplayNameForTaskPath Extracts a display name suitable for displaying to the user from the task URL/file path.
- Parameters
-
url | The URL pointing to the task (could be a local file, a webpage, a file from a template or sample, whatever). |
- Returns
- A display name for the task, suitable for showing to the user in the recent tasks list.
◆ keyPressEvent()
void geometrize::dialog::RecentTasksList::keyPressEvent |
( |
QKeyEvent * |
e | ) |
|
|
overrideprivatevirtual |
193 QListWidget::keyPressEvent(e);
195 const QList<QListWidgetItem*> items{selectedItems()};
197 if(e->matches(QKeySequence::Copy)) {
199 for(
const QListWidgetItem* item : items) {
200 strings.push_back(item->text());
202 QApplication::clipboard()->setText(strings.join(
"\n"));
203 }
else if(e->key() == Qt::Key_Delete || e->key() == Qt::Key_Backspace) {
204 d->removeItemDataAndMenuItems(items);
◆ setRecentItems()
void geometrize::dialog::RecentTasksList::setRecentItems |
( |
RecentItems * |
items | ) |
|
setRecentItems Sets the items that the list will keep track of.
- Parameters
-
items | The list of items, the recent tasks list does not take ownership of this. |
183 d->setRecentItems(recents);
The documentation for this class was generated from the following files: