BuildmLearn Toolkit  2.0.4
BuildmLearn Toolkit is an easy-to-use program that helps users make mobile apps without any knowledge of application development.
 All Classes Functions Enumerations Groups Pages
PlainToolButton Class Reference

Tool button without frame. More...

#include <plaintoolbutton.h>

Collaboration diagram for PlainToolButton:
Collaboration graph

Public Member Functions

 PlainToolButton (QWidget *parent=0)
 
int padding () const
 Padding accessor. More...
 
void setPadding (int padding)
 

Protected Member Functions

void paintEvent (QPaintEvent *e)
 Custom look. More...
 
void keyPressEvent (QKeyEvent *e)
 

Detailed Description

Tool button without frame.

This class represents tool button with simple graphics, no frames, no mouse hover shadows or animations.

Definition at line 41 of file plaintoolbutton.h.

Member Function Documentation

int PlainToolButton::padding ( ) const

Padding accessor.

Returns
Returns padding.
See also
setPadding()

Definition at line 74 of file plaintoolbutton.cpp.

74  {
75  return m_padding;
76 }
void PlainToolButton::paintEvent ( QPaintEvent *  e)
protected

Custom look.

Parameters
eInfo about painting event.

Definition at line 46 of file plaintoolbutton.cpp.

46  {
47  Q_UNUSED(e)
48 
49  QPainter p(this);
50  QRect rect(QPoint(0, 0), size());
51 
52  // Set padding.
53  rect.adjust(m_padding, m_padding, -m_padding, -m_padding);
54 
55  // Paint the icon.
56  if (!isEnabled()) {
57  p.setOpacity(0.4);
58  }
59  else if (underMouse() || hasFocus()) {
60  p.setOpacity(0.7);
61  }
62 
63  icon().paint(&p, rect);
64 }

The documentation for this class was generated from the following files: