bool operator instead of optional + qobject_cast
This commit is contained in:
@@ -253,16 +253,22 @@ private:
|
||||
typedef QVector<Note *> NoteVector;
|
||||
|
||||
|
||||
/*! \brief Bounding box of notes
|
||||
*
|
||||
* Defaults to all zero, and will in that case evaluate to false if converted to bool.
|
||||
*/
|
||||
struct NoteBounds
|
||||
{
|
||||
TimePos start;
|
||||
TimePos end;
|
||||
int lowest;
|
||||
int highest;
|
||||
|
||||
operator bool() { return start.getTicks() || end.getTicks() || lowest || highest; }
|
||||
};
|
||||
|
||||
|
||||
std::optional<NoteBounds> boundsForNotes(const NoteVector& notes);
|
||||
NoteBounds boundsForNotes(const NoteVector& notes);
|
||||
|
||||
|
||||
} // namespace lmms
|
||||
|
||||
Reference in New Issue
Block a user