LeechCraft
0.6.70-17793-g6e56308e78
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
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<
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
}
LC::Util::ProgressDelegate::ProgressGetter_t
std::function< Progress(QModelIndex)> ProgressGetter_t
Definition
progressdelegate.h:27
LC::Util::ProgressDelegate::ProgressDelegate
ProgressDelegate(ProgressGetter_t &&progress, QObject *parent=nullptr)
Definition
progressdelegate.cpp:15
LC::Util::ProgressDelegate::paint
void paint(QPainter *, const QStyleOptionViewItem &, const QModelIndex &) const override
Definition
progressdelegate.cpp:21
guiconfig.h
UTIL_GUI_API
#define UTIL_GUI_API
Definition
guiconfig.h:16
LC::Util
Definition
icoreproxy.h:34
LC::Util::ProgressDelegate::Progress
Definition
progressdelegate.h:20
LC::Util::ProgressDelegate::Progress::Progress_
int Progress_
Definition
progressdelegate.h:23
LC::Util::ProgressDelegate::Progress::Maximum_
int Maximum_
Definition
progressdelegate.h:22
LC::Util::ProgressDelegate::Progress::Text_
QString Text_
Definition
progressdelegate.h:24
LC::Util::ProgressDelegate::Progress::Minimum_
int Minimum_
Definition
progressdelegate.h:21
src
util
gui
progressdelegate.h
Generated by
1.16.1