MCPcopy Create free account
hub / github.com/YACReader/yacreader / mousePressEvent

Method mousePressEvent

custom_widgets/yacreader_table_view.cpp:89–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87 // disabled mouseMoveEvent in the parent class
88}
89void YACReaderTableView::mousePressEvent(QMouseEvent *event)
90{
91 QTableView::mousePressEvent(event);
92 QModelIndex mi = indexAt(event->pos());
93 if (mi.isValid()) {
94 QList<QModelIndex> selectedIndexes = this->selectedIndexes();
95 if (selectedIndexes.contains(mi)) {
96 if (mi.column() == ComicModel::Rating) {
97 if (!editing) {
98 editing = true;
99 currentIndexEditing = mi;
100 edit(mi);
101 myeditor = indexWidget(mi);
102 }
103 return;
104 }
105 }
106 }
107
108 // this could be the origin of a new drag acction
109 if (event->button() == Qt::LeftButton) {
110 startDragPos = event->pos();
111 }
112}
113void YACReaderTableView::leaveEvent(QEvent *event)
114{
115 closeRatingEditor();

Callers

nothing calls this directly

Calls 5

selectedIndexesMethod · 0.80
starCountMethod · 0.80
setStarCountMethod · 0.80
isValidMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected