30 #ifndef MAPVIZ_WIDGETS_H_ 31 #define MAPVIZ_WIDGETS_H_ 35 #include <QListWidget> 36 #include <QListWidgetItem> 38 #include <QMouseEvent> 55 for (
size_t i = 0; i < count(); i++)
57 item(i)->setData(Qt::UserRole, QVariant((
float)i));
67 QListWidget::dropEvent(event);
81 virtual bool operator< (
const QListWidgetItem & other)
const 83 return data(Qt::UserRole).toFloat() < other.data(Qt::UserRole).toFloat();
93 QLabel(parent, flags) {}
113 QWidget(parent, flags) {}
118 void DoubleClicked();
124 if (event->button() == Qt::LeftButton)
126 Q_EMIT DoubleClicked();
132 if (event->button() == Qt::RightButton)
134 Q_EMIT RightClicked();
144 explicit IconWidget(QWidget *parent = 0, Qt::WindowFlags flags = 0) :
145 QWidget(parent, flags)
147 pixmap_ = QPixmap(16, 16);
148 pixmap_.fill(Qt::transparent);
162 QPainter painter(
this);
163 painter.fillRect(0, 0, width(), height(), palette().color(QPalette::Button));
165 int x_offset = (width() - pixmap_.width()) / 2.0;
166 int y_offset = (height() - pixmap_.height()) / 2.0;
168 painter.drawPixmap(x_offset, y_offset, pixmap_);
175 #endif // MAPVIZ_WIDGETS_H_
PluginConfigListItem(QListWidget *parent=0)
void update(const std::string &key, const XmlRpc::XmlRpcValue &v)
PluginConfigList(QWidget *parent=0)
virtual void dropEvent(QDropEvent *event)
SingleClickLabel(QWidget *parent=0, Qt::WindowFlags flags=0)
virtual void mousePressEvent(QMouseEvent *event)