2016-03-19 21:11:02 +00:00
|
|
|
#include <QVBoxLayout>
|
2016-06-19 09:17:31 +00:00
|
|
|
#include <QProgressBar>
|
|
|
|
#include <QPushButton>
|
2016-03-19 13:40:19 +00:00
|
|
|
#include "appbarexamples.h"
|
2016-03-19 21:11:02 +00:00
|
|
|
#include "components/appbar.h"
|
|
|
|
#include "frame.h"
|
2016-06-18 09:36:40 +00:00
|
|
|
#include "components/progress.h"
|
2016-06-19 09:17:31 +00:00
|
|
|
#include "components/circularprogress.h"
|
2016-03-19 13:40:19 +00:00
|
|
|
|
|
|
|
AppBarExamples::AppBarExamples(QWidget *parent)
|
2016-06-19 09:17:31 +00:00
|
|
|
: QWidget(parent)
|
2016-03-19 13:40:19 +00:00
|
|
|
{
|
2016-06-19 09:17:31 +00:00
|
|
|
Progress *p = new Progress;
|
2016-06-19 10:34:10 +00:00
|
|
|
p->setProgressType(Material::DeterminateProgress);
|
|
|
|
p->setMinimum(0);
|
|
|
|
p->setMaximum(99);
|
|
|
|
p->setValue(22);
|
2016-06-19 09:17:31 +00:00
|
|
|
|
|
|
|
QVBoxLayout *l = new QVBoxLayout;
|
|
|
|
|
|
|
|
setLayout(l);
|
|
|
|
|
|
|
|
l->addStretch(1);
|
|
|
|
|
|
|
|
l->addWidget(p);
|
|
|
|
|
|
|
|
CircularProgress *cp = new CircularProgress;
|
2016-06-19 10:34:10 +00:00
|
|
|
cp->setProgressType(Material::DeterminateProgress);
|
|
|
|
cp->setMinimum(0);
|
|
|
|
cp->setMaximum(99);
|
|
|
|
cp->setValue(90);
|
2016-06-19 09:17:31 +00:00
|
|
|
|
|
|
|
l->addWidget(cp);
|
|
|
|
|
|
|
|
QProgressBar *pb = new QProgressBar;
|
2016-06-19 10:34:10 +00:00
|
|
|
pb->setMinimum(0);
|
|
|
|
pb->setMaximum(99);
|
|
|
|
pb->setValue(50);
|
2016-06-19 09:17:31 +00:00
|
|
|
|
|
|
|
QPushButton *b = new QPushButton;
|
|
|
|
|
|
|
|
l->addWidget(b);
|
|
|
|
|
|
|
|
l->addWidget(pb);
|
|
|
|
|
|
|
|
/*
|
2016-03-19 21:11:02 +00:00
|
|
|
QLayout *mainLayout = widget()->layout();
|
|
|
|
|
|
|
|
{
|
|
|
|
QWidget *widget = new QWidget;
|
|
|
|
QVBoxLayout *layout = new QVBoxLayout;
|
|
|
|
|
|
|
|
widget->setLayout(layout);
|
|
|
|
|
|
|
|
AppBar *appBar = new AppBar;
|
|
|
|
layout->addWidget(appBar);
|
|
|
|
layout->addStretch();
|
|
|
|
layout->setContentsMargins(0, 0, 0, 0);
|
|
|
|
|
|
|
|
QScrollArea *area = new QScrollArea;
|
|
|
|
area->setWidget(widget);
|
|
|
|
area->setWidgetResizable(true);
|
|
|
|
area->setBackgroundRole(QPalette::Base);
|
|
|
|
|
|
|
|
Frame *frame = new Frame;
|
|
|
|
frame->setCodeSnippet(
|
|
|
|
"QVBoxLayout *layout = new QVBoxLayout;\n"
|
|
|
|
"AppBar *appBar = new AppBar;\n"
|
|
|
|
"layout->addWidget(appBar);\n"
|
|
|
|
"layout->addStretch();\n"
|
|
|
|
"layout->setContentsMargins(0, 0, 0, 0);"
|
|
|
|
);
|
|
|
|
frame->setWidget(area);
|
|
|
|
|
2016-06-18 09:36:40 +00:00
|
|
|
mainLayout->addWidget(frame);
|
|
|
|
}
|
|
|
|
{
|
|
|
|
QWidget *widget = new QWidget;
|
|
|
|
QVBoxLayout *layout = new QVBoxLayout;
|
|
|
|
|
|
|
|
widget->setLayout(layout);
|
|
|
|
|
|
|
|
Progress *p = new Progress;
|
|
|
|
|
|
|
|
Frame *frame = new Frame;
|
|
|
|
frame->setCodeSnippet(
|
|
|
|
""
|
|
|
|
);
|
|
|
|
frame->setWidget(p);
|
|
|
|
|
2016-03-19 21:11:02 +00:00
|
|
|
mainLayout->addWidget(frame);
|
|
|
|
}
|
2016-06-19 09:17:31 +00:00
|
|
|
*/
|
2016-03-19 13:40:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
AppBarExamples::~AppBarExamples()
|
|
|
|
{
|
|
|
|
}
|