⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dialogoption.h

📁 c++的guiQt做的开发
💻 H
字号:
#ifndef __DIALOGOPTION_H__#define __DIALOGOPTION_H__#include "option.h"class QString;class QLineEdit;class QPushButton;class QResizeEvent;namespace gui {/** Abstract class for widget containing one editable string setting, with nearby "..." button allowing to invoke dialog to change the setting in some possibly  more user-friently way<br> Subclasses should reimplement the dialog function to invoke some dialog and change the string value accordingly \brief Abstract class for option editable as string and pickable by dialog*/class DialogOption : public Option { Q_OBJECTpublic: DialogOption(const QString &_key=0,QWidget *parent=0,const QString &defValue=QString::null); virtual ~DialogOption(); virtual void writeValue(); virtual void readValue(); virtual QSize sizeHint() const; //Abstract functions /**  Invoke the dialog to alter the edited value  Reference to edited value is passed as parameter.  This function should return after the dialog ended  and may update the value as it seems approprieate  based on user's interaction with the dialog  @param value Reference to edited string */ virtual void dialog(QString &value)=0;protected slots: void enableChange(const QString &newText); void invokeDialog();protected: virtual void resizeEvent (QResizeEvent *e);private: /** one line edit control used for editing the value */ QLineEdit *ed; /** Push button for invoking the dialog */ QPushButton *pb;};} // namespace gui#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -