-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added sorting by different values
- Loading branch information
Showing
15 changed files
with
213 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include "conferenceeventcompare.h" | ||
#include "conferenceevent.h" | ||
|
||
bool ConferenceEventPointerCompare::operator()(const QObject *a, const QObject *b) { | ||
const ConferenceEvent* aa = dynamic_cast<const ConferenceEvent*>(a); | ||
const ConferenceEvent* bb = dynamic_cast<const ConferenceEvent*>(b); | ||
|
||
if(aa == nullptr || bb == nullptr) | ||
return false; | ||
|
||
switch (sortingOrder) { | ||
case ConferenceEventSortingOrder::SortingOrder::BY_TIME: | ||
return aa->compareByTime(*bb); | ||
case ConferenceEventSortingOrder::SortingOrder::BY_TITLE: | ||
return aa->compareByTitle(*bb); | ||
case ConferenceEventSortingOrder::SortingOrder::BY_TRACK: | ||
return aa->compareByTrack(*bb); | ||
case ConferenceEventSortingOrder::SortingOrder::BY_ROOM: | ||
return aa->compareByRoom(*bb); | ||
default: | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#ifndef CONFERENCEEVENTCOMPARE_H | ||
#define CONFERENCEEVENTCOMPARE_H | ||
|
||
#include "conferenceeventsortingorder.h" | ||
|
||
struct ConferenceEventPointerCompare { | ||
ConferenceEventSortingOrder::SortingOrder sortingOrder; | ||
bool operator()(const QObject* a, const QObject* b); | ||
}; | ||
|
||
#endif // CONFERENCEEVENTCOMPARE_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#ifndef CONFERENCEEVENTSORTINGORDER_H | ||
#define CONFERENCEEVENTSORTINGORDER_H | ||
|
||
#include <QObject> | ||
|
||
class ConferenceEventSortingOrder: public QObject { | ||
Q_OBJECT | ||
public: | ||
enum SortingOrder { | ||
BY_TIME, | ||
BY_TITLE, | ||
BY_TRACK, | ||
BY_ROOM | ||
}; | ||
|
||
Q_ENUM(SortingOrder) | ||
}; | ||
|
||
#endif // CONFERENCEEVENTSORTINGORDER_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.