openmw-tes3coop/apps/opencs/view/widget/pushbutton.hpp

52 lines
1.1 KiB
C++
Raw Normal View History

2014-07-10 09:03:55 +00:00
#ifndef CSV_WIDGET_PUSHBUTTON_H
#define CSV_WIDGET_PUSHBUTTON_H
#include <QPushButton>
namespace CSVWidget
{
class PushButton : public QPushButton
{
Q_OBJECT
public:
enum Type
{
Type_TopMode, // top level button for mode selector panel
Type_Mode // mode button
};
private:
2014-07-10 09:03:55 +00:00
bool mKeepOpen;
Type mType;
2014-07-10 10:53:57 +00:00
private:
void setExtendedToolTip (const std::string& text);
2014-07-10 09:03:55 +00:00
protected:
virtual void keyPressEvent (QKeyEvent *event);
virtual void keyReleaseEvent (QKeyEvent *event);
2014-07-10 09:03:55 +00:00
virtual void mouseReleaseEvent (QMouseEvent *event);
public:
/// \param push Do not maintain a toggle state
PushButton (const QIcon& icon, Type type, const std::string& tooltip = "",
2014-07-10 10:53:57 +00:00
QWidget *parent = 0);
/// \param push Do not maintain a toggle state
PushButton (Type type, const std::string& tooltip = "",
2014-07-10 10:53:57 +00:00
QWidget *parent = 0);
2014-07-10 09:03:55 +00:00
bool hasKeepOpen() const;
};
}
#endif