8#include <QDragEnterEvent>
9#include <QDragLeaveEvent>
87 void dropEvent(QDropEvent* event)
override;
153 QModelIndex
moveCursor(QAbstractItemView::CursorAction cursorAction,
154 Qt::KeyboardModifiers modifiers)
override;
void updateMouseHoverRow(int row)
Sets mouse_hover_row_ to the given row and updates the view accordingly.
Definition modlistview.cpp:109
bool mouseInUpperHalfOfRow() const
Returns true iff mouse is currently in the upper half of a row.
Definition modlistview.cpp:143
void focusOutEvent(QFocusEvent *event) override
Gets called when this widget loses focus. Changes highlight color to inactive.
Definition modlistview.cpp:210
void mouseDoubleClickEvent(QMouseEvent *event) override
Gets called when a double click has been performed in this widget.
Definition modlistview.cpp:188
void dropEvent(QDropEvent *event) override
If dropped item was a file or a list of files, emit modAdded.
Definition modlistview.cpp:16
int getHoverRow() const
Returns the row currently under the mouse, or -1 if no row is under the mouse.
Definition modlistview.cpp:177
void mouseReleaseEvent(QMouseEvent *event) override
Gets called when the mouse has been released while in this widget.
Definition modlistview.cpp:85
void mouseMoveEvent(QMouseEvent *event) override
Gets called when the mouse has been moved while in this widget.
Definition modlistview.cpp:182
void modAdded(QList< QUrl > path)
Signals files have been dropped into this widget.
void dragLeaveEvent(QDragLeaveEvent *event) override
Enables drag leave events.
Definition modlistview.cpp:28
bool mouse_in_upper_half_of_row_
Stores if mouse is currently in the upper half of a row.
Definition modlistview.h:81
void mousePressEvent(QMouseEvent *event) override
Gets called when the mouse has been pressed while in this widget.
Definition modlistview.cpp:38
int mouse_down_row_
Last row on which a mouse button has been pressed.
Definition modlistview.h:73
void modStatusChanged(int mod_id, bool status)
Signals that a mods activation status has been changed.
bool enable_buttons_
Determines if buttons react to inputs.
Definition modlistview.h:77
void focusInEvent(QFocusEvent *event) override
Gets called when this widget gains focus. Changes highlight color to active.
Definition modlistview.cpp:218
void dragMoveEvent(QDragMoveEvent *event) override
Enables drag move events.
Definition modlistview.cpp:33
int mouse_hover_row_
Last row over which the cursor hovered.
Definition modlistview.h:75
void leaveEvent(QEvent *event) override
Gets called when the cursor leaves this widget. Resets mouse over highlighting.
Definition modlistview.cpp:201
void updateMouseDownRow(int row)
Sets mouse_down_row_ to the given row and updates the view accordingly.
Definition modlistview.cpp:119
QModelIndex moveCursor(QAbstractItemView::CursorAction cursorAction, Qt::KeyboardModifiers modifiers) override
Disables moving the cursor with keyboard inputs.
Definition modlistview.cpp:223
void updateRow(int row)
Repaints the given rows.
Definition modlistview.cpp:129
ModListView(QWidget *parent=nullptr)
Simply calls QTableview's constructor with parent as argument.
Definition modlistview.cpp:11
std::vector< int > getSelectedModIds() const
Returns a vector of selected mod ids.
Definition modlistview.cpp:153
QModelIndexList getSelectedRowIndices() const
Returns one index for every selected row. Columns will be set to 0.
Definition modlistview.cpp:166
bool enableButtons() const
Returns true iff buttons in this view will react to mouse inputs.
Definition modlistview.cpp:228
void setEnableButtons(bool enabled)
Sets whether buttons in this view will react to mouse inputs.
Definition modlistview.cpp:233
bool rowIndexIsValid(int row) const
Checks if given row index refers to an existing row.
Definition modlistview.cpp:104
bool is_in_drag_drop_
Indicates if an item is currently being moved by drag and drop.
Definition modlistview.h:79
void modRemoved(int mod_id, QString name)
Signals that a mod has been removed.
int getNumSelectedRows() const
Returns the number of currently selected rows.
Definition modlistview.cpp:148
bool isInDragDrop() const
Returns true iff an item is currently being moved by drag and drop.
Definition modlistview.cpp:138
void dragEnterEvent(QDragEnterEvent *event) override
Enables drag enter events.
Definition modlistview.cpp:23
char path[256]
Path to which to extract the file.
Definition lspakfilelistentry.h:1