Gui: allow to add task box with no header and
add methods to add a task box to a watcher
This commit is contained in:
@@ -72,6 +72,14 @@ QWidget* TaskDialog::addTaskBox(const QPixmap& icon,
|
||||
return taskbox;
|
||||
}
|
||||
|
||||
QWidget* TaskDialog::addTaskBoxWithoutHeader(QWidget* widget)
|
||||
{
|
||||
auto taskbox = new Gui::TaskView::TaskBox();
|
||||
taskbox->groupLayout()->addWidget(widget);
|
||||
Content.push_back(taskbox);
|
||||
return taskbox;
|
||||
}
|
||||
|
||||
const std::vector<QWidget*> &TaskDialog::getDialogContent() const
|
||||
{
|
||||
return Content;
|
||||
|
||||
@@ -59,6 +59,7 @@ public:
|
||||
|
||||
QWidget* addTaskBox(QWidget* widget, bool expandable = true, QWidget* parent = nullptr);
|
||||
QWidget* addTaskBox(const QPixmap& icon, QWidget* widget, bool expandable = true, QWidget* parent = nullptr);
|
||||
QWidget* addTaskBoxWithoutHeader(QWidget* widget);
|
||||
|
||||
void setButtonPosition(ButtonPosition p)
|
||||
{ pos = p; }
|
||||
|
||||
@@ -58,6 +58,30 @@ TaskWatcher::~TaskWatcher()
|
||||
|
||||
//==== implementer ===========================================================================
|
||||
|
||||
QWidget* TaskWatcher::addTaskBox(QWidget* widget, bool expandable, QWidget* parent)
|
||||
{
|
||||
return addTaskBox(QPixmap(), widget, expandable, parent);
|
||||
}
|
||||
|
||||
QWidget* TaskWatcher::addTaskBox(const QPixmap& icon,
|
||||
QWidget* widget,
|
||||
bool expandable,
|
||||
QWidget* parent)
|
||||
{
|
||||
auto taskbox = new Gui::TaskView::TaskBox(icon, widget->windowTitle(), expandable, parent);
|
||||
taskbox->groupLayout()->addWidget(widget);
|
||||
Content.push_back(taskbox);
|
||||
return taskbox;
|
||||
}
|
||||
|
||||
QWidget* TaskWatcher::addTaskBoxWithoutHeader(QWidget* widget)
|
||||
{
|
||||
auto taskbox = new Gui::TaskView::TaskBox();
|
||||
taskbox->groupLayout()->addWidget(widget);
|
||||
Content.push_back(taskbox);
|
||||
return taskbox;
|
||||
}
|
||||
|
||||
std::vector<QWidget*> &TaskWatcher::getWatcherContent()
|
||||
{
|
||||
return Content;
|
||||
|
||||
@@ -44,6 +44,10 @@ public:
|
||||
explicit TaskWatcher(const char* Filter);
|
||||
~TaskWatcher() override;
|
||||
|
||||
QWidget* addTaskBox(QWidget* widget, bool expandable = true, QWidget* parent = nullptr);
|
||||
QWidget* addTaskBox(const QPixmap& icon, QWidget* widget, bool expandable = true, QWidget* parent = nullptr);
|
||||
QWidget* addTaskBoxWithoutHeader(QWidget* widget);
|
||||
|
||||
std::vector<QWidget*> &getWatcherContent();
|
||||
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user