calendar tooltip

This commit is contained in:
liranbg 2014-10-10 22:24:19 +03:00
parent 3d826864d2
commit b1957f7f56
3 changed files with 23 additions and 1 deletions

View file

@ -147,3 +147,22 @@ void calendarCourse::setPoints(double value)
{
points = value;
}
double points;
QString lecturer;
double semesterHours;
int day;
int hourBegin;
int minutesBegin;
int hourEnd;
int minutesEnd;
QString room;
QString calendarCourse::toString()
{
QTime begin,end;
begin.setHMS(hourBegin,minutesBegin,0);
end.setHMS(hourEnd,minutesEnd,0);
return QString("%1 %2 %3\n%4 %5\n%6 - %7").arg(QString::number(this->getSerialNum()),this->getName(),QString::number(this->points),this->getLecturer(),this->getRoom(),
begin.toString("hh:mm"),end.toString(("hh:mm")));
}

View file

@ -47,7 +47,7 @@ public:
int getMinutesBegin() const;
int getHourEnd() const;
int getMinutesEnd() const;
double getPoints() const;
double getPoints() const;
void setDay(const QString &value);
void setLecturer(const QString &value);
@ -59,6 +59,8 @@ public:
void setMinutesEnd(int value);
void setPoints(double value);
QString toString();
private:
void setDayAndHour(QString parse);

View file

@ -83,6 +83,7 @@ void calendarSchedule::insertCourseIntoTable()
item = new QTableWidgetItem(courseString);
item->setToolTip(coursePtr->toString());
if (this->takeItem(row,col) != NULL)
delete this->takeItem(row,col);
this->setItem(row,col,item);