Limo
A simple mod manager
Loading...
Searching...
No Matches
DeployerListView Class Reference

Displays mod data either in the form of a deployer list using a DeployerListModel. More...

#include <deployerlistview.h>

Inheritance diagram for DeployerListView:
Collaboration diagram for DeployerListView:

Signals

void modMoved (int from_row, int to_row)
 Signals a mod has been dragged to a new position.
 
- Signals inherited from ModListView
void modAdded (QList< QUrl > path)
 Signals files have been dropped into this widget.
 
void modStatusChanged (int mod_id, bool status)
 Signals that a mods activation status has been changed.
 
void modRemoved (int mod_id, QString name)
 Signals that a mod has been removed.
 

Public Member Functions

 DeployerListView (QWidget *parent=nullptr)
 Simply calls ModListView's constructor with parent as argument.
 
bool enableDragReorder () const
 Checks if drag and drop is enabled.
 
void setEnableDragReorder (bool enabled)
 Enables or disables drag and drop support.
 
- Public Member Functions inherited from ModListView
 ModListView (QWidget *parent=nullptr)
 Simply calls QTableview's constructor with parent as argument.
 
bool enableButtons () const
 Returns true iff buttons in this view will react to mouse inputs.
 
void setEnableButtons (bool enabled)
 Sets whether buttons in this view will react to mouse inputs.
 
int getHoverRow () const
 Returns the row currently under the mouse, or -1 if no row is under the mouse.
 
bool isInDragDrop () const
 Returns true iff an item is currently being moved by drag and drop.
 
bool mouseInUpperHalfOfRow () const
 Returns true iff mouse is currently in the upper half of a row.
 
int getNumSelectedRows () const
 Returns the number of currently selected rows.
 
std::vector< int > getSelectedModIds () const
 Returns a vector of selected mod ids.
 
QModelIndexList getSelectedRowIndices () const
 Returns one index for every selected row. Columns will be set to 0.
 

Protected Member Functions

void mousePressEvent (QMouseEvent *event) override
 Gets called when the mouse has been pressed while in this widget.
 
void mouseReleaseEvent (QMouseEvent *event) override
 Gets called when the mouse has been released while in this widget.
 
void mouseMoveEvent (QMouseEvent *event) override
 Gets called when the mouse has been moved while in this widget.
 
- Protected Member Functions inherited from ModListView
void dropEvent (QDropEvent *event) override
 If dropped item was a file or a list of files, emit modAdded.
 
void dragEnterEvent (QDragEnterEvent *event) override
 Enables drag enter events.
 
void dragLeaveEvent (QDragLeaveEvent *event) override
 Enables drag leave events.
 
void dragMoveEvent (QDragMoveEvent *event) override
 Enables drag move events.
 
void mousePressEvent (QMouseEvent *event) override
 Gets called when the mouse has been pressed while in this widget.
 
void mouseReleaseEvent (QMouseEvent *event) override
 Gets called when the mouse has been released while in this widget.
 
void mouseMoveEvent (QMouseEvent *event) override
 Gets called when the mouse has been moved while in this widget.
 
void mouseDoubleClickEvent (QMouseEvent *event) override
 Gets called when a double click has been performed in this widget.
 
void leaveEvent (QEvent *event) override
 Gets called when the cursor leaves this widget. Resets mouse over highlighting.
 
void focusOutEvent (QFocusEvent *event) override
 Gets called when this widget loses focus. Changes highlight color to inactive.
 
void focusInEvent (QFocusEvent *event) override
 Gets called when this widget gains focus. Changes highlight color to active.
 
QModelIndex moveCursor (QAbstractItemView::CursorAction cursorAction, Qt::KeyboardModifiers modifiers) override
 Disables moving the cursor with keyboard inputs.
 
bool rowIndexIsValid (int row) const
 Checks if given row index refers to an existing row.
 
void updateMouseHoverRow (int row)
 Sets mouse_hover_row_ to the given row and updates the view accordingly.
 
void updateMouseDownRow (int row)
 Sets mouse_down_row_ to the given row and updates the view accordingly.
 
void updateRow (int row)
 Repaints the given rows.
 

Private Attributes

bool enable_drag_reorder_ = false
 Toggles drag and drop support.
 

Additional Inherited Members

- Protected Attributes inherited from ModListView
int mouse_down_row_ = -1
 Last row on which a mouse button has been pressed.
 
int mouse_hover_row_ = -1
 Last row over which the cursor hovered.
 
bool enable_buttons_ = true
 Determines if buttons react to inputs.
 
bool is_in_drag_drop_ = false
 Indicates if an item is currently being moved by drag and drop.
 
bool mouse_in_upper_half_of_row_ = false
 Stores if mouse is currently in the upper half of a row.
 

Detailed Description

Displays mod data either in the form of a deployer list using a DeployerListModel.

Constructor & Destructor Documentation

◆ DeployerListView()

DeployerListView::DeployerListView ( QWidget * parent = nullptr)
explicit

Simply calls ModListView's constructor with parent as argument.

Parameters
parentThe parent widget for this widget.

Member Function Documentation

◆ modMoved

void DeployerListView::modMoved ( int from_row,
int to_row )
signal

Signals a mod has been dragged to a new position.

Parameters
Originalmod row.
Newmod row.

◆ mouseMoveEvent()

void DeployerListView::mouseMoveEvent ( QMouseEvent * event)
overrideprotected

Gets called when the mouse has been moved while in this widget.

Highlights the row currently under the cursor. Sets cursor style to a drag and drop design if left button is being held.

Parameters
eventThe source event.

◆ mousePressEvent()

void DeployerListView::mousePressEvent ( QMouseEvent * event)
overrideprotected

Gets called when the mouse has been pressed while in this widget.

Highlights the currently selected row and implements drag and drop.

Parameters
eventThe source event.

◆ mouseReleaseEvent()

void DeployerListView::mouseReleaseEvent ( QMouseEvent * event)
overrideprotected

Gets called when the mouse has been released while in this widget.

Implements drag and drop and emits modMoved. Resets cursor style to default. If the mouse was released on column 0 and the same row on which it was pressed: Emits modStatusChanged.

Parameters
eventThe source event.

◆ setEnableDragReorder()

void DeployerListView::setEnableDragReorder ( bool enabled)

Enables or disables drag and drop support.

Parameters
enabledMew state.

The documentation for this class was generated from the following files: