You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
996 B
C++

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#ifndef SARIBBONLINEWIDGETCONTAINER_H
#define SARIBBONLINEWIDGETCONTAINER_H
#include <QtCore/qglobal.h>
#include <QWidget>
#include <QLabel>
#include "SARibbonGlobal.h"
/**
* @brief 一个窗口容器把窗口放置中间前面后面都可以设置文本主要用于放置在pannel上的小窗口
*
* 实现如下效果:
*
* PrefixLabel|_Widget_|SuffixLabel
*
*/
class SA_RIBBON_EXPORT SARibbonLineWidgetContainer : public QWidget
{
public:
SARibbonLineWidgetContainer(QWidget* par = nullptr);
//设置widget,不允许设置一个nullptr
void setWidget(QWidget* innerWidget);
//设置前缀
void setPrefix(const QString& str);
//设置后缀
void setSuffix(const QString& str);
//前缀文本框
QLabel* labelPrefix() const;
//后缀文本框
QLabel* labelSuffix() const;
private:
//两个文本
QLabel* m_labelPrefix;
QLabel* m_labelSuffix;
QWidget* m_innerWidget;
};
#endif // SARIBBONWIDGETCONTAINER_H