fix day checking at schedule
This commit is contained in:
parent
73951fe69c
commit
e869379b24
5 changed files with 19 additions and 13 deletions
|
@ -271,7 +271,7 @@ void MainScreen::on_getCalendarBtn_clicked()
|
|||
page = loginHandel->getCurrentPageContect();
|
||||
calendar->setCalendar(page);
|
||||
|
||||
qDebug() << Q_FUNC_INFO << "calendar is loaded";
|
||||
qDebug() << Q_FUNC_INFO << "calendar is loaded. getting exam schedule";
|
||||
|
||||
//auto getting exam
|
||||
if (loginHandel->isLoggedInFlag())
|
||||
|
|
|
@ -6,10 +6,9 @@
|
|||
*/
|
||||
void CalendarPage::setPage(QString html)
|
||||
{
|
||||
courses.clear();
|
||||
courses.clear();
|
||||
tempHtml = getString(html);
|
||||
calendarListInit(tempHtml);
|
||||
|
||||
}
|
||||
/**
|
||||
* @brief CalendarPage::calendarListInit - make an object from each line of course
|
||||
|
|
|
@ -113,7 +113,7 @@ int calendarCourse::getDay() const
|
|||
*/
|
||||
void calendarCourse::setDay(const QString &value)
|
||||
{
|
||||
std::string dayTemp = value.toStdString().substr(0,2); //recieving two characters respresting days
|
||||
QString dayTemp = value.mid(0,1); //recieving two characters respresting days
|
||||
if (dayTemp.compare("\u05D0") == 0) //alef
|
||||
day = 1;
|
||||
else if (dayTemp.compare("\u05D1") == 0) //bet
|
||||
|
@ -127,7 +127,10 @@ void calendarCourse::setDay(const QString &value)
|
|||
else if (dayTemp.compare("\u05D5") == 0) //vav
|
||||
day = 6;
|
||||
else
|
||||
{
|
||||
qDebug() << "error on parsing day!";
|
||||
day= -1;
|
||||
}
|
||||
}
|
||||
QString calendarCourse::getRoom() const
|
||||
{
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include "../../course.h"
|
||||
#include <QTime>
|
||||
#include <QDebug>
|
||||
|
||||
#define CALENDAR_COURSE_FIELDS 8
|
||||
|
||||
|
|
|
@ -28,8 +28,9 @@ calendarSchedule::calendarSchedule(QWidget *parent) : QTableWidget(parent)
|
|||
setHorizontalHeaderLabels(days);
|
||||
setVerticalHeaderLabels(hours);
|
||||
setEditTriggers(QAbstractItemView::NoEditTriggers);
|
||||
horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
||||
verticalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
||||
|
||||
this->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
||||
this->resizeRowsToContents();
|
||||
|
||||
}
|
||||
|
||||
|
@ -47,8 +48,8 @@ void calendarSchedule::clearTableItems()
|
|||
for (j = 0; j < columnCount(); j++)
|
||||
if (this->takeItem(i,j) != NULL)
|
||||
delete this->takeItem(i,j);
|
||||
horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
||||
verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
||||
this->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
|
||||
this->resizeRowsToContents();
|
||||
}
|
||||
|
||||
void calendarSchedule::insertCourseIntoTable()
|
||||
|
@ -82,20 +83,22 @@ 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);
|
||||
// qDebug() << "set row,col,item" << row << "," << col << "," << coursePtr->getSerialNum();
|
||||
|
||||
currentHour++;
|
||||
--blocksNumber;
|
||||
}
|
||||
horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
||||
verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
||||
}
|
||||
|
||||
horizontalHeader()->setSectionResizeMode(QHeaderView::Interactive);
|
||||
verticalHeader()->setSectionResizeMode(QHeaderView::Interactive);
|
||||
this->resizeRowsToContents();
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue