projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Switch segment storage from single vector to vector of arrays
[pulseview.git]
/
pv
/
view
/
viewitem.cpp
diff --git
a/pv/view/viewitem.cpp
b/pv/view/viewitem.cpp
index 0c61578c0c2acfcb1517e40009a5a91675568caa..05e14164b338b145160e981fbd395f736d7a6eee 100644
(file)
--- 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
* 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 <http://www.gnu.org/licenses/>.
*/
#include "viewitem.hpp"
*/
#include "viewitem.hpp"
@@
-27,7
+26,8
@@
#include <QPalette>
namespace pv {
#include <QPalette>
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
const QSizeF ViewItem::LabelPadding(4, 0);
const int ViewItem::HighlightRadius = 3;
const QSizeF ViewItem::LabelPadding(4, 0);
const int ViewItem::HighlightRadius = 3;
@@
-49,6
+49,11
@@
void ViewItem::select(bool select)
selected_ = select;
}
selected_ = select;
}
+bool ViewItem::is_draggable() const
+{
+ return true;
+}
+
bool ViewItem::dragging() const
{
return drag_point_.x() != INT_MIN && drag_point_.y() != INT_MIN;
bool ViewItem::dragging() const
{
return drag_point_.x() != INT_MIN && drag_point_.y() != INT_MIN;
@@
-56,7
+61,8
@@
bool ViewItem::dragging() const
void ViewItem::drag()
{
void ViewItem::drag()
{
- drag_point_ = point(QRect());
+ if (is_draggable())
+ drag_point_ = point(QRect());
}
void ViewItem::drag_release()
}
void ViewItem::drag_release()
@@
-64,12
+70,18
@@
void ViewItem::drag_release()
drag_point_ = QPoint(INT_MIN, INT_MIN);
}
drag_point_ = QPoint(INT_MIN, INT_MIN);
}
-QRectF ViewItem::
hit_box
_rect(const QRectF &rect) const
+QRectF ViewItem::
label
_rect(const QRectF &rect) const
{
(void)rect;
return QRectF();
}
{
(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;
QMenu* ViewItem::create_context_menu(QWidget *parent)
{
context_parent_ = parent;
@@
-123,5
+135,6
@@
QColor ViewItem::select_text_colour(QColor background)
return (background.lightness() > 110) ? Qt::black : Qt::white;
}
return (background.lightness() > 110) ? Qt::black : Qt::white;
}
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
} // namespace pv