#include "selectableitem.h"
+#include <QApplication>
+#include <QPalette>
+
namespace pv {
namespace view {
+const int SelectableItem::HighlightRadius = 6;
+
SelectableItem::SelectableItem() :
_selected(false)
{
_selected = select;
}
+QPen SelectableItem::highlight_pen()
+{
+ return QPen(QApplication::palette().brush(
+ QPalette::Highlight), HighlightRadius,
+ Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin);
+}
+
} // namespace view
} // namespace pv
#include <list>
-#include <QObject>
+#include <QPen>
class QAction;
{
Q_OBJECT
+private:
+ static const int HighlightRadius;
+
public:
SelectableItem();
*/
void select(bool select = true);
+protected:
+ static QPen highlight_pen();
+
private:
bool _selected;
};
namespace view {
const int Signal::LabelHitPadding = 2;
-const int Signal::LabelHighlightRadius = 6;
const QPen Signal::SignalAxisPen(QColor(128, 128, 128, 64));
};
if (selected()) {
- p.setPen(QPen(QApplication::palette().brush(
- QPalette::Highlight), LabelHighlightRadius,
- Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
+ p.setPen(highlight_pen());
p.setBrush(Qt::transparent);
p.drawPolygon(points, countof(points));
}
private:
static const int LabelHitPadding;
- static const int LabelHighlightRadius;
static const QPen SignalAxisPen;