LeechCraft
0.6.70-18450-gabe19ee3b0
Modular cross-platform feature rich live environment.
progressdelegate.h
Go to the documentation of this file.
1
/**********************************************************************
2
* LeechCraft - modular cross-platform feature rich internet client.
3
* Copyright (C) 2006-2014 Georg Rudoy
4
*
5
* Distributed under the Boost Software License, Version 1.0.
6
* (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7
**********************************************************************/
8
9
#pragma once
10
11
#include <QStyledItemDelegate>
12
#include "
guiconfig.h
"
13
14
namespace
LC::Util
15
{
16
class
UTIL_GUI_API
ProgressDelegate
:
public
QStyledItemDelegate
17
{
18
public
:
19
struct
Progress
20
{
21
int
Minimum_ = 0;
22
int
Maximum_
;
23
int
Progress_
;
24
QString
Text_
;
25
};
26
27
using
ProgressGetter_t
= std::function<std::optional<Progress> (QModelIndex)>;
28
private
:
29
ProgressGetter_t
ProgressGetter_;
30
public
:
31
explicit
ProgressDelegate
(
ProgressGetter_t
&& progress, QObject *parent =
nullptr
);
32
33
void
paint (QPainter*,
const
QStyleOptionViewItem&,
const
QModelIndex&)
const override
;
34
};
35
}
UTIL_GUI_API
#define UTIL_GUI_API
Definition:
guiconfig.h:16
LC::Util::ProgressDelegate::Progress::Maximum_
int Maximum_
Definition:
progressdelegate.h:22
LC::Util::ProgressDelegate::ProgressGetter_t
std::function< std::optional< Progress >(QModelIndex)> ProgressGetter_t
Definition:
progressdelegate.h:27
guiconfig.h
LC::Util::ProgressDelegate::Progress::Progress_
int Progress_
Definition:
progressdelegate.h:23
LC::Util
Definition:
icoreproxy.h:33
LC::Util::ProgressDelegate
Definition:
progressdelegate.h:16
LC::Util::ProgressDelegate::Progress
Definition:
progressdelegate.h:19
LC::Util::ProgressDelegate::Progress::Text_
QString Text_
Definition:
progressdelegate.h:24
src
util
gui
progressdelegate.h
Generated by
1.8.14