change: change code style to Linux style except indent.
This commit is contained in:
@@ -22,36 +22,37 @@
|
||||
|
||||
#include <QMouseEvent>
|
||||
|
||||
namespace olive {
|
||||
|
||||
ProjectExplorerListViewBase::ProjectExplorerListViewBase(QWidget *parent) :
|
||||
QListView(parent)
|
||||
namespace olive
|
||||
{
|
||||
// FIXME Is this necessary?
|
||||
setMovement(QListView::Free);
|
||||
|
||||
// Set selection mode (allows multiple item selection)
|
||||
setSelectionMode(QAbstractItemView::ExtendedSelection);
|
||||
ProjectExplorerListViewBase::ProjectExplorerListViewBase(QWidget *parent)
|
||||
: QListView(parent)
|
||||
{
|
||||
// FIXME Is this necessary?
|
||||
setMovement(QListView::Free);
|
||||
|
||||
// Set resize mode
|
||||
setResizeMode(QListView::Adjust);
|
||||
// Set selection mode (allows multiple item selection)
|
||||
setSelectionMode(QAbstractItemView::ExtendedSelection);
|
||||
|
||||
// Set widget to emit a signal on right click
|
||||
setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
// Set resize mode
|
||||
setResizeMode(QListView::Adjust);
|
||||
|
||||
// Set widget to emit a signal on right click
|
||||
setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
}
|
||||
|
||||
void ProjectExplorerListViewBase::mouseDoubleClickEvent(QMouseEvent *event)
|
||||
{
|
||||
// Cache here so if the index becomes invalid after the base call, we still know the truth
|
||||
bool item_at_location = indexAt(event->pos()).isValid();
|
||||
// Cache here so if the index becomes invalid after the base call, we still know the truth
|
||||
bool item_at_location = indexAt(event->pos()).isValid();
|
||||
|
||||
// Perform default double click functions
|
||||
QListView::mouseDoubleClickEvent(event);
|
||||
// Perform default double click functions
|
||||
QListView::mouseDoubleClickEvent(event);
|
||||
|
||||
// QAbstractItemView already has a doubleClicked() signal, but we emit another here for double clicking empty space
|
||||
if (!item_at_location) {
|
||||
emit DoubleClickedEmptyArea();
|
||||
}
|
||||
// QAbstractItemView already has a doubleClicked() signal, but we emit another here for double clicking empty space
|
||||
if (!item_at_location) {
|
||||
emit DoubleClickedEmptyArea();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user