MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / monthCmp

Function monthCmp

pj_widgets/src/DateRangePicker.cpp:561–572  ·  view source on GitHub ↗

Signed month comparison. Returns 0 for an invalid date.

Source from the content-addressed store, hash-verified

559namespace {
560// Signed month comparison. Returns 0 for an invalid date.
561int monthCmp(const QDate& d, int year, int month) {
562 if (!d.isValid()) {
563 return 0;
564 }
565 if (d.year() != year) {
566 return (d.year() < year) ? -1 : +1;
567 }
568 if (d.month() != month) {
569 return (d.month() < month) ? -1 : +1;
570 }
571 return 0;
572}
573} // namespace
574
575void DualCalendarWidget::advanceMonth(int& year, int& month, int delta) {

Callers 1

updateNavButtonsMethod · 0.85

Calls 3

yearMethod · 0.80
monthMethod · 0.80
isValidMethod · 0.45

Tested by

no test coverage detected