1 Star 0 Fork 0

fuchaow/Property-Editor

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
CButtonBasedEditor.h 967 Bytes
一键复制 编辑 原始数据 按行查看 历史
Shujaat 提交于 2019-10-27 19:22 . Add files via upload
#ifndef CBUTTONBASEDEDITOR_H
#define CBUTTONBASEDEDITOR_H
#include <QToolButton>
class CButtonBasedEditor : public QWidget
{
Q_OBJECT
public:
explicit CButtonBasedEditor(QWidget* hostedEditor, QWidget *parent = 0);
virtual ~CButtonBasedEditor();
public Q_SLOTS:
void enableButton(bool on);
protected Q_SLOTS:
// reimp
virtual void onEditButtonActivated() = 0;
protected:
virtual bool event(QEvent* e);
virtual void showEvent(QShowEvent *e);
QWidget* m_hostedEditor;
QToolButton* m_button;
};
template<class EditorClass>
class TButtonBasedEditor : public CButtonBasedEditor
{
public:
TButtonBasedEditor(EditorClass* hostedEditor, QWidget *parent = 0)
: CButtonBasedEditor(hostedEditor, parent)
{
}
protected:
EditorClass* getEditor() const
{
return dynamic_cast<EditorClass*>(m_hostedEditor);
}
};
#endif // CBUTTONBASEDEDITOR_H
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/fuchaow/Property-Editor.git
git@gitee.com:fuchaow/Property-Editor.git
fuchaow
Property-Editor
Property-Editor
master

搜索帮助