From 5e3c2fb7e4c506c760fe8f356a32f87312c2d528 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Sat, 6 Jul 2019 23:32:01 -0500 Subject: [PATCH] documented (nearly) ever class --- app/core.h | 4 +- app/decoder/decoder.h | 4 +- app/decoder/frame.h | 4 +- app/panel/project/project.h | 3 + app/panel/taskmanager/taskmanager.h | 3 + app/panel/tool/tool.h | 3 + app/panel/viewer/viewer.h | 4 +- app/project/item/folder/folder.cpp | 5 + app/project/item/folder/folder.h | 5 +- app/project/item/footage/audiostream.h | 3 + app/project/item/footage/footage.h | 7 ++ app/project/item/footage/stream.h | 4 +- app/project/item/footage/videostream.h | 3 + app/project/item/item.cpp | 5 + app/project/item/item.h | 8 ++ app/project/project.h | 5 +- app/project/projectviewmodel.cpp | 14 ++- app/project/projectviewmodel.h | 7 +- app/rational.h | 4 +- app/task/task.h | 4 +- app/task/taskmanager.h | 13 ++- app/task/taskthread.h | 4 +- app/tool/tool.h | 4 +- app/undo/undostack.h | 3 + app/widget/menu/menu.h | 107 +++++++++++++++++- app/widget/menu/menushared.h | 3 + app/widget/panel/panel.h | 4 +- .../playbackcontrols/playbackcontrols.h | 27 +++++ .../projectexplorer/projectexplorer.cpp | 6 +- app/widget/projectexplorer/projectexplorer.h | 4 +- .../projectexplorer/projectexplorerdefines.h | 4 + .../projectexplorericonviewitemdelegate.h | 3 + .../projectexplorer/projectexplorerlistview.h | 3 + .../projectexplorerlistviewbase.h | 4 + .../projectexplorer/projectexplorertreeview.h | 2 +- app/widget/taskview/taskview.h | 13 +++ app/widget/taskview/taskviewitem.h | 16 +++ app/widget/toolbar/toolbar.h | 4 +- app/widget/toolbar/toolbarbutton.h | 4 +- app/widget/viewer/viewer.h | 4 +- app/widget/viewer/viewerglwidget.h | 6 +- app/window/mainwindow/mainmenu.h | 5 +- app/window/mainwindow/mainwindow.h | 4 +- 43 files changed, 284 insertions(+), 62 deletions(-) diff --git a/app/core.h b/app/core.h index 132a2be53..1734ab5ca 100644 --- a/app/core.h +++ b/app/core.h @@ -30,9 +30,9 @@ #include "tool/tool.h" /** - * @brief The Core class + * @brief The main central Olive application instance * - * The main Olive application instance. This runs both in GUI and CLI modes (and handles what to init based on that). + * This runs both in GUI and CLI modes (and handles what to init based on that). * It also contains various global functions/variables for use throughout Olive. * * The "public slots" are usually user-triggered actions and can be connected to UI elements (e.g. creating a folder, diff --git a/app/decoder/decoder.h b/app/decoder/decoder.h index 2af70e1ff..6b4dd381b 100644 --- a/app/decoder/decoder.h +++ b/app/decoder/decoder.h @@ -29,9 +29,9 @@ #include "decoder/frame.h" /** - * @brief The Decoder class + * @brief A decoder's is the main class for bringing external media into Olive * - * A decoder's is the main class for bringing external media into Olive. Its responsibilities are to serve as + * Its responsibilities are to serve as * abstraction from codecs/decoders and provide complete frames. These frames can be video or audio data and are * provided as Frame objects in shared pointers to alleviate the responsibility of memory handling. * diff --git a/app/decoder/frame.h b/app/decoder/frame.h index df2e896ba..7e8c412dd 100644 --- a/app/decoder/frame.h +++ b/app/decoder/frame.h @@ -30,9 +30,7 @@ extern "C" { #include "rational.h" /** - * @brief The Frame class - * - * Abstraction from AVFrame. Currently a simple AVFrame wrapper. + * @brief Abstraction from AVFrame. Currently a simple AVFrame wrapper. * * This class does not support copying at this time. */ diff --git a/app/panel/project/project.h b/app/panel/project/project.h index 5527162e2..75cef8dbf 100644 --- a/app/panel/project/project.h +++ b/app/panel/project/project.h @@ -25,6 +25,9 @@ #include "widget/panel/panel.h" #include "widget/projectexplorer/projectexplorer.h" +/** + * @brief A PanelWidget wrapper around a ProjectExplorer and a ProjectToolbar + */ class ProjectPanel : public PanelWidget { Q_OBJECT diff --git a/app/panel/taskmanager/taskmanager.h b/app/panel/taskmanager/taskmanager.h index e96971fc7..d994048da 100644 --- a/app/panel/taskmanager/taskmanager.h +++ b/app/panel/taskmanager/taskmanager.h @@ -24,6 +24,9 @@ #include "widget/taskview/taskview.h" #include "widget/panel/panel.h" +/** + * @brief A PanelWidget wrapper around a TaskView widget + */ class TaskManagerPanel : public PanelWidget { Q_OBJECT diff --git a/app/panel/tool/tool.h b/app/panel/tool/tool.h index 7d94f8b48..1ecd6dcc0 100644 --- a/app/panel/tool/tool.h +++ b/app/panel/tool/tool.h @@ -23,6 +23,9 @@ #include "widget/panel/panel.h" +/** + * @brief A PanelWidget wrapper around a Toolbar + */ class ToolPanel : public PanelWidget { Q_OBJECT diff --git a/app/panel/viewer/viewer.h b/app/panel/viewer/viewer.h index 7a30bb274..181441864 100644 --- a/app/panel/viewer/viewer.h +++ b/app/panel/viewer/viewer.h @@ -24,9 +24,7 @@ #include "widget/panel/panel.h" /** - * @brief The ViewerPanel class - * - * Dockable wrapper around a ViewerWidget + * @brief Dockable wrapper around a ViewerWidget */ class ViewerPanel : public PanelWidget { Q_OBJECT diff --git a/app/project/item/folder/folder.cpp b/app/project/item/folder/folder.cpp index 37f85bafb..2de856664 100644 --- a/app/project/item/folder/folder.cpp +++ b/app/project/item/folder/folder.cpp @@ -31,3 +31,8 @@ Item::Type Folder::type() const { return kFolder; } + +bool Folder::CanHaveChildren() const +{ + return true; +} diff --git a/app/project/item/folder/folder.h b/app/project/item/folder/folder.h index 23fda54d5..7d9a68a71 100644 --- a/app/project/item/folder/folder.h +++ b/app/project/item/folder/folder.h @@ -26,7 +26,8 @@ /** * @brief The Folder class representing a directory in a project structure * - * + * The Item base class already has support for children, but this functionality is disabled by default + * (see CanHaveChildren() override). The Folder is a specific type that enables this functionality. */ class Folder : public Item { @@ -35,6 +36,8 @@ public: virtual Type type() const override; + virtual bool CanHaveChildren() const override; + private: }; diff --git a/app/project/item/footage/audiostream.h b/app/project/item/footage/audiostream.h index 024e46aea..fec4dd438 100644 --- a/app/project/item/footage/audiostream.h +++ b/app/project/item/footage/audiostream.h @@ -28,6 +28,9 @@ extern "C" { #include "rational.h" #include "stream.h" +/** + * @brief A Stream derivative containing audio-specific information + */ class AudioStream : public Stream { public: diff --git a/app/project/item/footage/footage.h b/app/project/item/footage/footage.h index 0ef52e43e..d9790ab0c 100644 --- a/app/project/item/footage/footage.h +++ b/app/project/item/footage/footage.h @@ -29,6 +29,13 @@ #include "project/item/footage/videostream.h" #include "rational.h" +/** + * @brief A reference to an external media file with metadata in a project structure + * + * Footage objects serve two purposes: storing metadata about external media and storing it as a project item. + * Footage objects store a list of Stream objects which store the majority of video/audio metadata. These streams + * are identical to the stream data in the files. + */ class Footage : public Item { public: diff --git a/app/project/item/footage/stream.h b/app/project/item/footage/stream.h index 70da35be2..f668f71e1 100644 --- a/app/project/item/footage/stream.h +++ b/app/project/item/footage/stream.h @@ -26,9 +26,9 @@ class Footage; /** - * @brief The Stream class + * @brief A base class for keeping metadata about a media stream. * - * A base class for keeping metadata about a media stream. A Stream can contain video data, audio data, subtitle data, + * A Stream can contain video data, audio data, subtitle data, * etc. and a Stream object stores metadata about it. * * The Stream class is fairly simple and is intended to be subclassed for data that pertains specifically to one diff --git a/app/project/item/footage/videostream.h b/app/project/item/footage/videostream.h index 159a7bb5b..a45102bdf 100644 --- a/app/project/item/footage/videostream.h +++ b/app/project/item/footage/videostream.h @@ -24,6 +24,9 @@ #include "rational.h" #include "stream.h" +/** + * @brief A Stream derivative containing video-specific information + */ class VideoStream : public Stream { public: diff --git a/app/project/item/item.cpp b/app/project/item/item.cpp index 2389440f6..b931dc60a 100644 --- a/app/project/item/item.cpp +++ b/app/project/item/item.cpp @@ -115,3 +115,8 @@ Item *Item::parent() const { return parent_; } + +bool Item::CanHaveChildren() const +{ + return false; +} diff --git a/app/project/item/item.h b/app/project/item/item.h index b8e02666a..b1f00ae81 100644 --- a/app/project/item/item.h +++ b/app/project/item/item.h @@ -29,6 +29,12 @@ class Item; using ItemPtr = std::shared_ptr; +/** + * @brief A base-class representing any element in a Project + * + * Project objects implement a parent-child hierarchy of Items that can be used throughout the Project. The Item class + * itself is abstract and will need to be subclassed to be used in a Project. + */ class Item { public: @@ -88,6 +94,8 @@ public: Item *parent() const; + virtual bool CanHaveChildren() const; + private: QList children_; diff --git a/app/project/project.h b/app/project/project.h index c60f4d032..08d3c0f48 100644 --- a/app/project/project.h +++ b/app/project/project.h @@ -27,12 +27,13 @@ #include "project/item/folder/folder.h" /** - * @brief The Project class + * @brief A project instance containing all the data pertaining to the user's project * - * A project instance containing all the data pertaining to the user's project, including: + * A project instance uses a parent-child hierarchy of Item objects. Projects will usually contain the following: * * * Footage * * Sequences + * * Folders * * Project Settings * * Window Layout */ diff --git a/app/project/projectviewmodel.cpp b/app/project/projectviewmodel.cpp index 3b339914e..2b3f51ac4 100644 --- a/app/project/projectviewmodel.cpp +++ b/app/project/projectviewmodel.cpp @@ -182,7 +182,7 @@ bool ProjectViewModel::hasChildren(const QModelIndex &parent) const // Check if this item is a kFolder type // If it's a folder, we always return TRUE in order to always show the "expand triangle" icon, // even when there are no "physical" children - if (item->type() == Item::kFolder) { + if (item->CanHaveChildren()) { return true; } } @@ -216,7 +216,7 @@ bool ProjectViewModel::canFetchMore(const QModelIndex &parent) const // Check if this item is a kFolder type // If it's a folder, we always return TRUE in order to always show the "expand triangle" icon, // even when there are no "physical" children - if (item->type() == Item::kFolder) { + if (item->CanHaveChildren()) { return true; } } @@ -232,7 +232,11 @@ Qt::ItemFlags ProjectViewModel::flags(const QModelIndex &index) const return Qt::ItemIsDropEnabled; } - Qt::ItemFlags f = Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled | QAbstractItemModel::flags(index); + Qt::ItemFlags f = Qt::ItemIsDragEnabled | QAbstractItemModel::flags(index); + + if (GetItemObjectFromIndex(index)->CanHaveChildren()) { + f |= Qt::ItemIsDropEnabled; + } // If the column is the kName column, that means it's editable if (columns_.at(index.column()) == kName) { @@ -308,7 +312,7 @@ bool ProjectViewModel::dropMimeData(const QMimeData *data, Qt::DropAction action Item* drop_location = GetItemObjectFromIndex(drop); // If this is not a folder, we cannot drop these items here - if (drop_location->type() != Item::kFolder) { + if (!drop_location->CanHaveChildren()) { return false; } @@ -365,7 +369,7 @@ bool ProjectViewModel::dropMimeData(const QMimeData *data, Qt::DropAction action Item* drop_item = GetItemObjectFromIndex(drop); // If we didn't drop onto an item, find the nearest parent folder (should eventually terminate at root either way) - while (drop_item->type() != Item::kFolder) { + while (!drop_item->CanHaveChildren()) { drop_item = drop_item->parent(); } diff --git a/app/project/projectviewmodel.h b/app/project/projectviewmodel.h index dec60c6e2..1f7f191db 100644 --- a/app/project/projectviewmodel.h +++ b/app/project/projectviewmodel.h @@ -27,9 +27,12 @@ #include "project.h" /** - * @brief The ProjectViewModel class + * @brief An adapter that interprets the data in a Project into a Qt item model for usage in ViewModel Views. * - * An adapter that interprets the data in a Project into a Qt item model for usage in ViewModel Views. + * Assuming a Project is currently "open" (i.e. the Project is connected to a ProjectExplorer/ProjectPanel through + * a ProjectViewModel), it may be better to make modifications (e.g. additions/removals/renames) through the + * ProjectViewModel so that the views can be efficiently and correctly updated. ProjectViewModel contains several + * "wrapper" functions for Project and Item functions that also signal any connected views to update accordingly. */ class ProjectViewModel : public QAbstractItemModel { diff --git a/app/rational.h b/app/rational.h index bbac6d00d..7ba50b124 100644 --- a/app/rational.h +++ b/app/rational.h @@ -33,9 +33,7 @@ extern "C" { } /** - * @brief The Rational class - * - * A rational (numerator/denominator) class with C++ operations built in for ease of use. + * @brief A rational (numerator/denominator) class with C++ operations built in for ease of use. * * Rationals in Olive most frequently represent timing information to easily handle timing in various different * frame/sample rates without the inaccuracy/rounding errors of a floating point type. diff --git a/app/task/task.h b/app/task/task.h index 3ff9d7315..1b5956065 100644 --- a/app/task/task.h +++ b/app/task/task.h @@ -27,9 +27,7 @@ #include "task/taskthread.h" /** - * @brief The Task class - * - * A base class for background tasks running in Olive. + * @brief A base class for background tasks running in Olive. * * Tasks are multithreaded by design (i.e. they will always spawn * a new thread and run in it). diff --git a/app/task/taskmanager.h b/app/task/taskmanager.h index 872ffc99c..24eac4e8a 100644 --- a/app/task/taskmanager.h +++ b/app/task/taskmanager.h @@ -27,7 +27,7 @@ #include "task/task.h" /** - * @brief The TaskManager class + * @brief An object that manages background Task objects, handling their start and end * * TaskManager handles the life of a Task object. After a new Task is created, it should be sent to TaskManager through * AddTask(). TaskManager will take ownership of the task and add it to a queue until it system resources are available @@ -99,8 +99,19 @@ public: public: AddTaskCommand(TaskPtr t, QUndoCommand* parent = nullptr); + /** + * @brief Adds the Task to the TaskManager + * + * If there are available threads, TaskManager will start running it. + */ virtual void redo() override; + /** + * @brief Undoes adding the Task + * + * If the Task is running, it is cancelled. Then the Task is removed from the TaskManager and the Task's state is + * reset. + */ virtual void undo() override; private: diff --git a/app/task/taskthread.h b/app/task/taskthread.h index 5d3fff208..3af5e2fd4 100644 --- a/app/task/taskthread.h +++ b/app/task/taskthread.h @@ -26,9 +26,9 @@ class Task; /** - * @brief The TaskThread class + * @brief An internal class only used by Task. * - * An internal class only used by Task. TaskThread is a simple QThread subclass designed to create a thread and run the + * TaskThread is a simple QThread subclass designed to create a thread and run the * Task's Action() function. It also stores the result of Action() which can be read using result() when the thread * signals that it has finished(). */ diff --git a/app/tool/tool.h b/app/tool/tool.h index 2d4ca2407..01b189393 100644 --- a/app/tool/tool.h +++ b/app/tool/tool.h @@ -25,9 +25,7 @@ namespace olive { namespace tool { /** - * @brief The Tool enum - * - * A list of tools that can be used throughout the application + * @brief A list of tools that can be used throughout the application */ enum Tool { /// No tool. This should never be set as the application tool, its only real purpose is to indicate the lack of diff --git a/app/undo/undostack.h b/app/undo/undostack.h index cb525d370..0aabcf787 100644 --- a/app/undo/undostack.h +++ b/app/undo/undostack.h @@ -4,6 +4,9 @@ #include namespace olive { +/** + * @brief A static undo stack for undoable commands throughout Olive + */ extern QUndoStack undo_stack; } diff --git a/app/widget/menu/menu.h b/app/widget/menu/menu.h index a956fb20f..bbfd07070 100644 --- a/app/widget/menu/menu.h +++ b/app/widget/menu/menu.h @@ -24,24 +24,129 @@ #include #include +/** + * @brief A menu widget for context menus and menu bars + * + * A QMenu subclass with functions for creating menus and menu items that conform to Olive's menu and keyboard shortcut + * system. + * + * In Olive, menu items in the menu bar are also responsible for keyboard shortcuts throughout the application. To allow + * these to be configurable and these configurations saveable, every item needs a unique ID. This ID gets linked to the + * keyboard shortcuts in config files. The ID doesn't get translated so it can also persist through language changes. + * + * The ID gets stored in the QAction's "id" property. If a keyboard shortcut is provided, it gets stored in the + * QAction's "keydefault" property. + * + * It is always recommended to use this over QMenu in any situation. + */ class Menu : public QMenu { public: + /** + * @brief Construct a Menu and add it to a QMenuBar + * + * This Menu can be connected to a slot that's triggered when the Menu is "about to show". Use `receiver` and + * `member` to connect this (same syntax as QObject::connect) or leave as nullptr to not. + */ Menu(QMenuBar* bar, const QObject* receiver = nullptr, const char* member = nullptr); + + /** + * @brief Construct a Menu and add it as a submenu to another Menu + * + * This Menu can be connected to a slot that's triggered when the Menu is "about to show". Use `receiver` and + * `member` to connect this (same syntax as QObject::connect) or leave as nullptr to not. + */ Menu(Menu* bar, const QObject* receiver = nullptr, const char* member = nullptr); + /** + * @brief Create a menu item and add it to this menu + * + * @param id + * + * The action's unique ID + * + * @param receiver + * + * The QObject to receive the signal when this item is triggered + * + * @param member + * + * The QObject slot to connect this action's triggered signal to + * + * @param key + * + * Default keyboard sequence + * + * @return + * + * The QAction that was created and added to this Menu + */ QAction* AddItem(const QString& id, const QObject* receiver, const char* member, const QString &key = QString()); + /** + * @brief Create a menu item + * + * @param parent + * + * The QAction's parent + * + * @param id + * + * The action's unique ID + * + * @param receiver + * + * The QObject to receive the signal when this item is triggered + * + * @param member + * + * The QObject slot to connect this action's triggered signal to + * + * @param key + * + * Default keyboard sequence + * + * @return + * + * The QAction that was created and added to this Menu + */ static QAction* CreateItem(QObject* parent, const QString& id, const QObject* receiver, const char* member, const QString& key = QString()); - static void ConformItem(QAction *a, const QString& id, + /** + * @brief Conform a QAction to Olive's ID/keydefault system + * + * If a QAction was created elsewhere (e.g. through QUndoStack::createUndoAction()), this function will give it + * properties conforming it to Olive's menu item system + * + * @param a + * + * The QAction's to conform + * + * @param id + * + * The action's unique ID + * + * @param receiver + * + * The QObject to receive the signal when this item is triggered + * + * @param member + * + * The QObject slot to connect this action's triggered signal to + * + * @param key + * + * Default keyboard sequence + */ + static void ConformItem(QAction *a, + const QString& id, const QObject* receiver, const char* member, const QString& key = QString()); diff --git a/app/widget/menu/menushared.h b/app/widget/menu/menushared.h index 1cf0a57fa..0acc7ba56 100644 --- a/app/widget/menu/menushared.h +++ b/app/widget/menu/menushared.h @@ -23,6 +23,9 @@ #include "widget/menu/menu.h" +/** + * @brief A static object that provides various "stock" menus for use throughout the application + */ class MenuShared : public QObject { public: MenuShared(); diff --git a/app/widget/panel/panel.h b/app/widget/panel/panel.h index 742850899..912559f54 100644 --- a/app/widget/panel/panel.h +++ b/app/widget/panel/panel.h @@ -25,9 +25,7 @@ #include /** - * @brief The PanelWidget class - * - * A widget that is always dockable within the MainWindow. + * @brief A widget that is always dockable within the MainWindow. */ class PanelWidget : public QDockWidget { Q_OBJECT diff --git a/app/widget/playbackcontrols/playbackcontrols.h b/app/widget/playbackcontrols/playbackcontrols.h index cd948d249..59c5aee4e 100644 --- a/app/widget/playbackcontrols/playbackcontrols.h +++ b/app/widget/playbackcontrols/playbackcontrols.h @@ -24,18 +24,45 @@ #include #include +/** + * @brief A playback controls widget providing buttons for navigating media + * + * This widget optionally features timecode displays for the current timecode and end timecode. + */ class PlaybackControls : public QWidget { public: PlaybackControls(QWidget* parent); + /** + * @brief Set whether the timecodes should be shown or not + */ void SetTimecodeEnabled(bool enabled); signals: + /** + * @brief Signal emitted when "Go to Start" is clicked + */ void BeginClicked(); + + /** + * @brief Signal emitted when "Previous Frame" is clicked + */ void PrevFrameClicked(); + + /** + * @brief Signal emitted when "Play/Pause" is clicked + */ void PlayClicked(); + + /** + * @brief Signal emitted when "Next Frame" is clicked + */ void NextFrameClicked(); + + /** + * @brief Signal emitted when "Go to End" is clicked + */ void EndClicked(); private: diff --git a/app/widget/projectexplorer/projectexplorer.cpp b/app/widget/projectexplorer/projectexplorer.cpp index a6df4bf13..a12f9f21c 100644 --- a/app/widget/projectexplorer/projectexplorer.cpp +++ b/app/widget/projectexplorer/projectexplorer.cpp @@ -162,7 +162,7 @@ void ProjectExplorer::DoubleClickViewSlot(const QModelIndex &index) Item* i = static_cast(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) { diff --git a/app/widget/projectexplorer/projectexplorer.h b/app/widget/projectexplorer/projectexplorer.h index b62207171..383323e1d 100644 --- a/app/widget/projectexplorer/projectexplorer.h +++ b/app/widget/projectexplorer/projectexplorer.h @@ -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. diff --git a/app/widget/projectexplorer/projectexplorerdefines.h b/app/widget/projectexplorer/projectexplorerdefines.h index 3bb2c23d8..e8d49e5e2 100644 --- a/app/widget/projectexplorer/projectexplorerdefines.h +++ b/app/widget/projectexplorer/projectexplorerdefines.h @@ -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; } diff --git a/app/widget/projectexplorer/projectexplorericonviewitemdelegate.h b/app/widget/projectexplorer/projectexplorericonviewitemdelegate.h index a4b3f5f55..16e244370 100644 --- a/app/widget/projectexplorer/projectexplorericonviewitemdelegate.h +++ b/app/widget/projectexplorer/projectexplorericonviewitemdelegate.h @@ -23,6 +23,9 @@ #include +/** + * @brief The delegate that's used to draw items when ProjectExplorer is in Icon view + */ class ProjectExplorerIconViewItemDelegate : public QStyledItemDelegate { public: ProjectExplorerIconViewItemDelegate(QObject *parent = nullptr); diff --git a/app/widget/projectexplorer/projectexplorerlistview.h b/app/widget/projectexplorer/projectexplorerlistview.h index 77962118c..be92cd867 100644 --- a/app/widget/projectexplorer/projectexplorerlistview.h +++ b/app/widget/projectexplorer/projectexplorerlistview.h @@ -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 diff --git a/app/widget/projectexplorer/projectexplorerlistviewbase.h b/app/widget/projectexplorer/projectexplorerlistviewbase.h index ffbbce84f..72e5f5fd2 100644 --- a/app/widget/projectexplorer/projectexplorerlistviewbase.h +++ b/app/widget/projectexplorer/projectexplorerlistviewbase.h @@ -23,6 +23,10 @@ #include +/** + * @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 diff --git a/app/widget/projectexplorer/projectexplorertreeview.h b/app/widget/projectexplorer/projectexplorertreeview.h index 0a7e4c29e..8ab60ac14 100644 --- a/app/widget/projectexplorer/projectexplorertreeview.h +++ b/app/widget/projectexplorer/projectexplorertreeview.h @@ -24,7 +24,7 @@ #include /** - * @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). diff --git a/app/widget/taskview/taskview.h b/app/widget/taskview/taskview.h index 59b77b083..18aa95317 100644 --- a/app/widget/taskview/taskview.h +++ b/app/widget/taskview/taskview.h @@ -26,6 +26,14 @@ #include "widget/taskview/taskviewitem.h" +/** + * @brief A widget that shows a list of Tasks + * + * TaskView is a fairly simple widget for showing TaskViewItem widgets that each represent a Task object. The main + * entry point is the slot AddTask() which should be connected to a TaskManager's TaskAdded() signal. No more connecting + * is necessary since TaskViewItem will automatically delete itself (thus removing itself from the TaskView) when the + * Task finishes. + */ class TaskView : public QScrollArea { Q_OBJECT @@ -33,6 +41,11 @@ public: TaskView(QWidget* parent); public slots: + /** + * @brief Creates a TaskViewItem, connects it to a Task, and adds it to this widget + * + * Connect this to TaskManager::TaskAdded(). + */ void AddTask(Task* t); private: diff --git a/app/widget/taskview/taskviewitem.h b/app/widget/taskview/taskviewitem.h index 65546fc37..9ac712b0c 100644 --- a/app/widget/taskview/taskviewitem.h +++ b/app/widget/taskview/taskviewitem.h @@ -28,12 +28,28 @@ #include "task/task.h" +/** + * @brief A widget that visually represents the status of a Task + * + * The TaskViewItem widget shows a description of the Task (Task::text(), a progress bar (updated by + * Task::ProgressChanged), the Task's status (text generated from Task::status() or Task::error()), and provides + * a cancel button (triggering Task::Cancel()) for cancelling a Task before it finishes. + * + * The main entry point is SetTask() after a Task and TaskViewItem objects are created. + */ class TaskViewItem : public QFrame { Q_OBJECT public: TaskViewItem(QWidget* parent); + /** + * @brief Connects a Task to this object + * + * If a Task has already been connected, this will disconnect this TaskViewItem from the previously connected + * Task before connecting to the next one - however there are very few circumstances where this would be necessary + * since TaskViewItem is designed to delete itself when a Task is complete. + */ void SetTask(Task* t); private: diff --git a/app/widget/toolbar/toolbar.h b/app/widget/toolbar/toolbar.h index bbbb03bb4..2cd7ae997 100644 --- a/app/widget/toolbar/toolbar.h +++ b/app/widget/toolbar/toolbar.h @@ -28,9 +28,9 @@ #include "tool/tool.h" /** - * @brief The Toolbar class + * @brief A widget containing buttons for all of Olive's application-wide tools. * - * A widget containing buttons for all of Olive's application-wide tools. Buttons are displayed in a FlowLayout that + * Buttons are displayed in a FlowLayout that * adjusts and wraps (like text) depending on the widget's size. * * By default, this Toolbar is not connected to anything. It's recommended to connect SLOT(SetTool()) and diff --git a/app/widget/toolbar/toolbarbutton.h b/app/widget/toolbar/toolbarbutton.h index aa4724fc6..4e59d06b9 100644 --- a/app/widget/toolbar/toolbarbutton.h +++ b/app/widget/toolbar/toolbarbutton.h @@ -26,9 +26,7 @@ #include "tool/tool.h" /** - * @brief The ToolbarButton class - * - * Simple derived class of QPushButton to contain an Tool ID. Used as the main widget through Toolbar. + * @brief Simple derived class of QPushButton to contain an Tool ID. Used as the main widget through Toolbar. */ class ToolbarButton : public QPushButton { diff --git a/app/widget/viewer/viewer.h b/app/widget/viewer/viewer.h index fa2a5d0b8..6cd1325ae 100644 --- a/app/widget/viewer/viewer.h +++ b/app/widget/viewer/viewer.h @@ -29,9 +29,7 @@ #include "widget/playbackcontrols/playbackcontrols.h" /** - * @brief The ViewerWidget class - * - * An OpenGL-based viewer widget with playback controls. + * @brief An OpenGL-based viewer widget with playback controls (a PlaybackControls widget). */ class ViewerWidget : public QWidget { diff --git a/app/widget/viewer/viewerglwidget.h b/app/widget/viewer/viewerglwidget.h index eee686dda..a84d6ac38 100644 --- a/app/widget/viewer/viewerglwidget.h +++ b/app/widget/viewer/viewerglwidget.h @@ -26,10 +26,10 @@ #include "render/gl/shaderptr.h" /** - * @brief The ViewerGLWidget class + * @brief The inner display/rendering widget of a Viewer class. * - * The inner display/rendering widget of a Viewer class. Actual rendering/composition occurs elsewhere offscreen and - * multithreaded, so its main purpose is receiving an OpenGL texture to display it. + * Actual composition occurs elsewhere offscreen and + * multithreaded, so its main purpose is receiving a finalized OpenGL texture and displaying it. * * The main entry point is SetTexture() which will receive an OpenGL texture ID, store it, and then call update() to * draw it on screen. The drawing function is in paintGL() (called during the update() process by Qt) and is fairly diff --git a/app/window/mainwindow/mainmenu.h b/app/window/mainwindow/mainmenu.h index 5c0e81a6d..538ecbc14 100644 --- a/app/window/mainwindow/mainmenu.h +++ b/app/window/mainwindow/mainmenu.h @@ -26,10 +26,9 @@ #include "widget/menu/menu.h" /** - * @brief The MainMenu class + * @brief Olive's main menubar attached to its main window. * - * Olive's menubar attached to its main window. Responsible for creating the menu, connecting signals/slots, and - * retranslating the items on a language change. + * Responsible for creating the menu, connecting signals/slots, and retranslating the items on a language change. */ class MainMenu : public QMenuBar { diff --git a/app/window/mainwindow/mainwindow.h b/app/window/mainwindow/mainwindow.h index e08747a50..685d52308 100644 --- a/app/window/mainwindow/mainwindow.h +++ b/app/window/mainwindow/mainwindow.h @@ -28,9 +28,7 @@ namespace olive { /** - * @brief The MainWindow class - * - * Olive's main window responsible for docking widgets and the main menu bar. + * @brief Olive's main window responsible for docking widgets and the main menu bar. */ class MainWindow : public QMainWindow { Q_OBJECT