qt-material-widgets/examples/appbarexamples.cpp

89 lines
1.9 KiB
C++
Raw Normal View History

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;
QVBoxLayout *l = new QVBoxLayout;
setLayout(l);
l->addStretch(1);
l->addWidget(p);
CircularProgress *cp = new CircularProgress;
cp->setSize(30);
l->addWidget(cp);
QProgressBar *pb = new QProgressBar;
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()
{
}