qt-material-widgets/examples/appbarexamples.cpp

44 lines
1.1 KiB
C++
Raw Normal View History

2016-03-19 21:11:02 +00:00
#include <QVBoxLayout>
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-03-19 13:40:19 +00:00
AppBarExamples::AppBarExamples(QWidget *parent)
: ExampleList(parent)
{
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);
mainLayout->addWidget(frame);
}
2016-03-19 13:40:19 +00:00
}
AppBarExamples::~AppBarExamples()
{
}