X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fview%2Fviewitem.cpp;h=7213f96d28657b5c9c19475048484d66052d9938;hb=e0ddc2a408e3b667ca8e15d8482ecdcb03d46d30;hp=ae5c427aff426acae5db7baa319567f5e13cda41;hpb=ec39632d1267a42cb858ac6ad7c98486886a46a0;p=pulseview.git
diff --git a/pv/view/viewitem.cpp b/pv/view/viewitem.cpp
index ae5c427..7213f96 100644
--- a/pv/view/viewitem.cpp
+++ b/pv/view/viewitem.cpp
@@ -14,8 +14,7 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this program; if not, see .
*/
#include "viewitem.hpp"
@@ -27,15 +26,16 @@
#include
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
const QSizeF ViewItem::LabelPadding(4, 0);
const int ViewItem::HighlightRadius = 3;
ViewItem::ViewItem() :
- context_parent_(NULL),
- selected_(false),
- drag_point_(INT_MIN, INT_MIN)
+ context_parent_(nullptr),
+ drag_point_(INT_MIN, INT_MIN),
+ selected_(false)
{
}
@@ -49,19 +49,20 @@ void ViewItem::select(bool select)
selected_ = select;
}
-bool ViewItem::dragging() const
+bool ViewItem::is_draggable() const
{
- return drag_point_.x() != INT_MIN && drag_point_.y() != INT_MIN;
+ return true;
}
-QPoint ViewItem::drag_point() const
+bool ViewItem::dragging() const
{
- return drag_point_;
+ return drag_point_.x() != INT_MIN && drag_point_.y() != INT_MIN;
}
void ViewItem::drag()
{
- drag_point_ = point();
+ if (is_draggable())
+ drag_point_ = point(QRect());
}
void ViewItem::drag_release()
@@ -69,12 +70,30 @@ void ViewItem::drag_release()
drag_point_ = QPoint(INT_MIN, INT_MIN);
}
+QRectF ViewItem::label_rect(const QRectF &rect) const
+{
+ (void)rect;
+ return QRectF();
+}
+
+QRectF ViewItem::hit_box_rect(const ViewItemPaintParams &pp) const
+{
+ (void)pp;
+ return QRectF();
+}
+
QMenu* ViewItem::create_context_menu(QWidget *parent)
{
context_parent_ = parent;
return new QMenu(parent);
}
+widgets::Popup* ViewItem::create_popup(QWidget *parent)
+{
+ (void)parent;
+ return nullptr;
+}
+
void ViewItem::delete_pressed()
{
}
@@ -86,19 +105,26 @@ QPen ViewItem::highlight_pen()
Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin);
}
-void ViewItem::paint_back(QPainter &p, const ViewItemPaintParams &pp)
+void ViewItem::paint_label(QPainter &p, const QRect &rect, bool hover)
+{
+ (void)p;
+ (void)rect;
+ (void)hover;
+}
+
+void ViewItem::paint_back(QPainter &p, ViewItemPaintParams &pp)
{
(void)p;
(void)pp;
}
-void ViewItem::paint_mid(QPainter &p, const ViewItemPaintParams &pp)
+void ViewItem::paint_mid(QPainter &p, ViewItemPaintParams &pp)
{
(void)p;
(void)pp;
}
-void ViewItem::paint_fore(QPainter &p, const ViewItemPaintParams &pp)
+void ViewItem::paint_fore(QPainter &p, ViewItemPaintParams &pp)
{
(void)p;
(void)pp;
@@ -106,8 +132,9 @@ void ViewItem::paint_fore(QPainter &p, const ViewItemPaintParams &pp)
QColor ViewItem::select_text_colour(QColor background)
{
- return (background.lightness() > 64) ? Qt::black : Qt::white;
+ return (background.lightness() > 110) ? Qt::black : Qt::white;
}
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv