1.1 is coming

This commit is contained in:
liranbg 2014-10-24 03:24:50 +03:00
commit ba13f4324b
5 changed files with 27 additions and 23 deletions

View file

@ -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())

View file

@ -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

View file

@ -113,21 +113,25 @@ int calendarCourse::getDay() const
*/
void calendarCourse::setDay(const QString &value)
{
std::string dayTemp = value.toStdString().substr(0,2); //recieving two characters respresting days
if (dayTemp.compare("\u05D0") == 0) //alef
QString dayTemp = value.mid(0,1); //recieving character's respresting the day
QChar letter = (QString::fromWCharArray(&dayTemp.toStdWString().at(0)).at(0));
if (letter.unicode() == 1488) //alef
day = 1;
else if (dayTemp.compare("\u05D1") == 0) //bet
else if (letter.unicode() == 1489) //bet
day = 2;
else if (dayTemp.compare("\u05D2") == 0) //gimel
else if (letter.unicode() == 1490) //gimel
day = 3;
else if (dayTemp.compare("\u05D3") == 0) //dalet
else if (letter.unicode() == 1491) //dalet
day = 4;
else if (dayTemp.compare("\u05D4") == 0) //hey
else if (letter.unicode() == 1492) //hey
day = 5;
else if (dayTemp.compare("\u05D5") == 0) //vav
else if (letter.unicode() == 1493) //vav
day = 6;
else
{
qDebug() << "error on parsing day!";
day= -1;
}
}
QString calendarCourse::getRoom() const
{

View file

@ -3,6 +3,7 @@
#include "../../course.h"
#include <QTime>
#include <QDebug>
#define CALENDAR_COURSE_FIELDS 8

View file

@ -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();
}
@ -46,9 +47,9 @@ void calendarSchedule::clearTableItems()
for (i = 0; i < rowCount(); i++)
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);
delete this->takeItem(i,j);s
this->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
this->resizeRowsToContents();
}
void calendarSchedule::insertCourseIntoTable()
@ -82,23 +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);
horizontalHeader()->stretchLastSection();
verticalHeader()->stretchLastSection();
this->resizeRowsToContents();
}