2009-09-17 13:59:10 +02:00
|
|
|
#include "detailsbutton.h"
|
|
|
|
|
|
|
|
using namespace Utils;
|
|
|
|
|
|
|
|
DetailsButton::DetailsButton(QWidget *parent)
|
|
|
|
#ifdef Q_OS_MAC
|
2009-09-29 18:06:13 +02:00
|
|
|
: QPushButton(parent),
|
2009-09-17 13:59:10 +02:00
|
|
|
#else
|
2009-09-29 18:06:13 +02:00
|
|
|
: QToolButton(parent),
|
2009-09-17 13:59:10 +02:00
|
|
|
#endif
|
2009-09-29 18:06:13 +02:00
|
|
|
m_checked(false)
|
2009-09-17 13:59:10 +02:00
|
|
|
{
|
|
|
|
#ifdef Q_OS_MAC
|
|
|
|
setAttribute(Qt::WA_MacSmallSize);
|
|
|
|
setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
|
|
|
#else
|
|
|
|
setCheckable(true);
|
|
|
|
#endif
|
2009-09-29 18:06:13 +02:00
|
|
|
setText(tr("Show Details"));
|
|
|
|
connect(this, SIGNAL(clicked()),
|
|
|
|
this, SLOT(onClicked()));
|
|
|
|
}
|
|
|
|
|
|
|
|
void DetailsButton::onClicked()
|
|
|
|
{
|
|
|
|
m_checked = !m_checked;
|
2009-10-01 14:24:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
bool DetailsButton::isToggled()
|
|
|
|
{
|
|
|
|
return m_checked;
|
2009-09-17 13:59:10 +02:00
|
|
|
}
|