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

36 lines
800 B

#ifndef CQWIDGETSPINBOX_H
#define CQWIDGETSPINBOX_H
#include <QWidget>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QLineEdit>
#include <QToolButton>
class CQWidgetSpinBox : public QWidget
{
Q_OBJECT
public:
explicit CQWidgetSpinBox(QWidget *parent = 0);
void focusInEvent(QFocusEvent *event); //覆盖这两个函数
void focusOutEvent(QFocusEvent *event);
void setText(QString s);
QString text();
private:
QLineEdit *m_lineEdit;
QToolButton *m_toolButtonUp, *m_toolButtonDown;
QHBoxLayout *m_hLayout;
QVBoxLayout *m_vLayout;
void init();
signals:
void GetFocus(); //获得焦点信号
void LostFocus(); //失去焦点信号
void UpClicked();
void DownClicked();
};
#endif // CQWIDGETSPINBOX_H