vnote/src/vuetitlecontentpanel.cpp
2018-06-06 23:10:51 +08:00

36 lines
794 B
C++

#include "vuetitlecontentpanel.h"
#include <QLabel>
#include <QVBoxLayout>
#include <QVariant>
#include <QString>
VUETitleContentPanel::VUETitleContentPanel(QWidget *p_contentWidget,
QWidget *p_parent)
: QWidget(p_parent)
{
m_titleLabel = new QLabel(this);
m_titleLabel->setProperty("TitleLabel", true);
p_contentWidget->setParent(this);
QVBoxLayout *layout = new QVBoxLayout();
layout->addWidget(m_titleLabel);
layout->addWidget(p_contentWidget);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
setLayout(layout);
}
void VUETitleContentPanel::setTitle(const QString &p_title)
{
m_titleLabel->setText(p_title);
}
void VUETitleContentPanel::clearTitle()
{
m_titleLabel->clear();
}