RedPanda-CPP/RedPandaIDE/widgets/functiontooltipwidget.h

45 lines
1.0 KiB
C
Raw Normal View History

2021-09-22 17:43:21 +08:00
#ifndef FUNCTIONTOOLTIPWIDGET_H
#define FUNCTIONTOOLTIPWIDGET_H
#include <QLabel>
#include <QToolButton>
#include <QWidget>
struct FunctionInfo {
QString name;
QString fullname;
QStringList params;
QStringList nonameParams;
QString returnType;
};
using PFunctionInfo = std::shared_ptr<FunctionInfo>;
class FunctionTooltipWidget : public QWidget
{
Q_OBJECT
public:
explicit FunctionTooltipWidget(QWidget *parent = nullptr);
void addTip(const QString& name, const QString& fullName,
const QString& returnType, const QString& args,
const QString& noNameArgs);
void clearTips();
int paramPos() const;
void setParamPos(int newParamPos);
int index() const;
void setIndex(int newIndex);
signals:
private:
QStringList splitArgs(QString args);
2021-09-22 17:43:21 +08:00
private:
QLabel* mInfoLabel;
QLabel* mTotalLabel;
QToolButton* mUpButton;
QToolButton* mDownButton;
int mParamPos;
int mIndex;
QList<PFunctionInfo> mInfos;
};
#endif // FUNCTIONTOOLTIPWIDGET_H