documented (nearly) ever class
This commit is contained in:
@@ -162,7 +162,7 @@ void ProjectExplorer::DoubleClickViewSlot(const QModelIndex &index)
|
||||
Item* i = static_cast<Item*>(index.internalPointer());
|
||||
|
||||
// If the item is a folder, browse to it
|
||||
if (i->type() == Item::kFolder
|
||||
if (i->CanHaveChildren()
|
||||
&& (view_type() == olive::ListView || view_type() == olive::IconView)) {
|
||||
|
||||
BrowseToFolder(index);
|
||||
@@ -261,10 +261,10 @@ Folder *ProjectExplorer::GetSelectedFolder()
|
||||
Item* sel_item = selected_items.at(i);
|
||||
|
||||
// If this item is not a folder, presumably it's parent is
|
||||
if (sel_item->type() != Item::kFolder) {
|
||||
if (!sel_item->CanHaveChildren()) {
|
||||
sel_item = sel_item->parent();
|
||||
|
||||
Q_ASSERT(sel_item->type() == Item::kFolder);
|
||||
Q_ASSERT(sel_item->CanHaveChildren());
|
||||
}
|
||||
|
||||
if (folder == nullptr) {
|
||||
|
||||
@@ -34,9 +34,7 @@
|
||||
#include "widget/projectexplorer/projectexplorernavigation.h"
|
||||
|
||||
/**
|
||||
* @brief A widget for browsing through Project classes
|
||||
*
|
||||
* A widget for browsing through a Project structure.
|
||||
* @brief A widget for browsing through a Project structure.
|
||||
*
|
||||
* ProjectExplorer automatically handles the view<->model system using a ProjectViewModel. Therefore, all that needs to
|
||||
* be provided is the Project structure itself.
|
||||
|
||||
@@ -3,9 +3,13 @@
|
||||
|
||||
namespace olive {
|
||||
|
||||
/// The minimum size an icon in ProjectExplorer can be
|
||||
const int kProjectIconSizeMinimum = 16;
|
||||
|
||||
/// The maximum size an icon in ProjectExplorer can be
|
||||
const int kProjectIconSizeMaximum = 256;
|
||||
|
||||
/// The default size an icon in ProjectExplorer can be
|
||||
const int kProjectIconSizeDefault = 64;
|
||||
|
||||
}
|
||||
|
||||
@@ -23,6 +23,9 @@
|
||||
|
||||
#include <QStyledItemDelegate>
|
||||
|
||||
/**
|
||||
* @brief The delegate that's used to draw items when ProjectExplorer is in Icon view
|
||||
*/
|
||||
class ProjectExplorerIconViewItemDelegate : public QStyledItemDelegate {
|
||||
public:
|
||||
ProjectExplorerIconViewItemDelegate(QObject *parent = nullptr);
|
||||
|
||||
@@ -24,6 +24,9 @@
|
||||
#include "projectexplorerlistviewbase.h"
|
||||
#include "projectexplorerlistviewitemdelegate.h"
|
||||
|
||||
/**
|
||||
* @brief The view widget used when ProjectExplorer is in List View
|
||||
*/
|
||||
class ProjectExplorerListView : public ProjectExplorerListViewBase
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -23,6 +23,10 @@
|
||||
|
||||
#include <QListView>
|
||||
|
||||
/**
|
||||
* @brief A QListView derivative that contains functionality used by both List view and Icon view (which are both based
|
||||
* on QListView)
|
||||
*/
|
||||
class ProjectExplorerListViewBase : public QListView
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include <QTreeView>
|
||||
|
||||
/**
|
||||
* @brief The ProjectExplorerTreeView class
|
||||
* @brief The view widget used when ProjectExplorer is in Tree View
|
||||
*
|
||||
* A fairly simple subclass of QTreeView that provides a double clicked signal whether the index is valid or not
|
||||
* (QAbstractItemView has a doubleClicked() signal but it's only emitted with a valid index).
|
||||
|
||||
Reference in New Issue
Block a user