displays a list of items with an icon next to each which indicates the current task performed on the item (e.g. not started, in progress, success, failed, ...)
More...
#include <jkqteprogresslistwidget.h>
displays a list of items with an icon next to each which indicates the current task performed on the item (e.g. not started, in progress, success, failed, ...)
Usage example:
timJKQTEProgressListWidget=new QTimer(progress);
stateJKQTEProgressListWidget=0;
timJKQTEProgressListWidget->setInterval(500);
connect(timJKQTEProgressListWidget, &QTimer::timeout, std::bind([progress](int& state){
if (state==1) {
for (
int i=0; i<progress->
count(); i++) {
}
} else if (state>10) {
state=0;
} else {
}
state++;
}, std::ref(stateJKQTEProgressListWidget)));
timJKQTEProgressListWidget->start();
There are two types of APIs that allow to modify the items:
◆ JKQTEProgressListWidget::widgetstruct
| struct JKQTEProgressListWidget::widgetstruct |
| Class Members |
|
QLabel * |
labIcon |
|
|
QLabel * |
labText |
|
◆ anonymous enum
| Enumerator |
|---|
| statusNone | |
| statusNotStarted | |
| statusDone | |
| statusFailed | |
| statusInProgress | |
| statusUser | |
◆ JKQTEProgressListWidget()
| JKQTEProgressListWidget::JKQTEProgressListWidget |
( |
QWidget * |
parent = nullptr | ) |
|
|
explicit |
◆ addItem()
| void JKQTEProgressListWidget::addItem |
( |
const QString & |
text, |
|
|
int |
status = statusNotStarted |
|
) |
| |
◆ count()
| int JKQTEProgressListWidget::count |
( |
| ) |
const |
returns the number of items in the list
◆ defineIcon()
| void JKQTEProgressListWidget::defineIcon |
( |
int |
status, |
|
|
QIcon |
icon |
|
) |
| |
◆ deleteItem()
| void JKQTEProgressListWidget::deleteItem |
( |
int |
item | ) |
|
◆ getIcon()
| QIcon JKQTEProgressListWidget::getIcon |
( |
int |
status | ) |
const |
returns the icon used for a given status
◆ getIconSize()
| QSize JKQTEProgressListWidget::getIconSize |
( |
| ) |
const |
returns currently used icon size for status icons
◆ getStatus()
| int JKQTEProgressListWidget::getStatus |
( |
int |
item | ) |
const |
returns the status of a given item
◆ getText()
| QString JKQTEProgressListWidget::getText |
( |
int |
item | ) |
const |
returns the text of a given item
◆ isCentered()
| bool JKQTEProgressListWidget::isCentered |
( |
| ) |
const |
inidctaes whether to center the display
◆ nextItem
| void JKQTEProgressListWidget::nextItem |
( |
int |
newStatusLast = statusDone | ) |
|
|
slot |
searches for the first item with status statusInProgress and switches it's status to newStatusLast The next item with status statusNotStarted is switched to statusInProgress
◆ reset
| void JKQTEProgressListWidget::reset |
( |
| ) |
|
|
slot |
◆ setCentered
| void JKQTEProgressListWidget::setCentered |
( |
bool |
centered | ) |
|
|
slot |
inidctaes whether to center the display
◆ setIconSize [1/2]
| void JKQTEProgressListWidget::setIconSize |
( |
int |
size | ) |
|
|
slot |
sets the currently used icon size for status icons
◆ setIconSize [2/2]
| void JKQTEProgressListWidget::setIconSize |
( |
QSize |
size | ) |
|
|
slot |
sets the currently used icon size for status icons
◆ setItemStatus
| void JKQTEProgressListWidget::setItemStatus |
( |
int |
item, |
|
|
int |
status |
|
) |
| |
|
slot |
◆ setItemText
| void JKQTEProgressListWidget::setItemText |
( |
int |
item, |
|
|
const QString & |
text |
|
) |
| |
|
slot |
set the text of the item -th item
◆ start
| void JKQTEProgressListWidget::start |
( |
| ) |
|
|
slot |
searched for the first item with status statusNotStarted and sets it to statusInProgress
◆ updateWidgets()
| void JKQTEProgressListWidget::updateWidgets |
( |
| ) |
|
|
protected |
◆ layout
| QGridLayout* JKQTEProgressListWidget::layout |
|
protected |
◆ m_centered
| bool JKQTEProgressListWidget::m_centered |
|
protected |
◆ m_icons
| QMap<int, QIcon> JKQTEProgressListWidget::m_icons |
|
protected |
◆ m_iconSize
| QSize JKQTEProgressListWidget::m_iconSize |
|
protected |
◆ m_items
| QStringList JKQTEProgressListWidget::m_items |
|
protected |
◆ m_status
| QList<int> JKQTEProgressListWidget::m_status |
|
protected |
◆ m_widgets
The documentation for this class was generated from the following file: