fixed resizing calendar dialog

This commit is contained in:
liranbg 2014-10-13 06:49:10 +03:00
parent cb696906f4
commit 773679374b
4 changed files with 16 additions and 8 deletions

View file

@ -74,7 +74,7 @@ background: qlineargradient(spread:pad, x1:0.496, y1:0, x2:0.508, y2:1, stop:0 r
<enum>QTabWidget::Rounded</enum> <enum>QTabWidget::Rounded</enum>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>1</number>
</property> </property>
<property name="documentMode"> <property name="documentMode">
<bool>false</bool> <bool>false</bool>

View file

@ -43,12 +43,14 @@ void CalendarDialog::on_calStart_selectionChanged()
{ {
if(ui->calStart->selectedDate() >= ui->calEnd->selectedDate()) //User input is invalid if(ui->calStart->selectedDate() >= ui->calEnd->selectedDate()) //User input is invalid
{ {
changeLabeStatusIcon(false); changeLabeStatusIcon(false);
ui->lbl_status->setText(tr("The end of the semester can NOT be equal or before the semester begin.")); ui->lbl_status->setText(tr("Invalid dates interval"));
this->isOK = false; this->isOK = false;
} }
else // input is valid else // input is valid
{ {
this->resize(610,310);
changeLabeStatusIcon(true); changeLabeStatusIcon(true);
ui->lbl_status->setText(tr("Looks fine, Click \"OK\"")); ui->lbl_status->setText(tr("Looks fine, Click \"OK\""));
this->isOK = true; this->isOK = true;
@ -69,7 +71,7 @@ void CalendarDialog::on_calEnd_selectionChanged()
if(ui->calStart->selectedDate() >= ui->calEnd->selectedDate()) if(ui->calStart->selectedDate() >= ui->calEnd->selectedDate())
{ {
changeLabeStatusIcon(false); changeLabeStatusIcon(false);
ui->lbl_status->setText(tr("The end of the semester can NOT be equal or before the semester begin.")); ui->lbl_status->setText(tr("Invalid dates interval"));
this->isOK = false; this->isOK = false;
} }

View file

@ -6,12 +6,12 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>610</width> <width>609</width>
<height>310</height> <height>310</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum"> <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -156,6 +156,15 @@
</item> </item>
<item row="0" column="1"> <item row="0" column="1">
<widget class="QLabel" name="lbl_status"> <widget class="QLabel" name="lbl_status">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text"> <property name="text">
<string>&lt;b&gt;Please chose your dates correctly&lt;/b&gt;</string> <string>&lt;b&gt;Please chose your dates correctly&lt;/b&gt;</string>
</property> </property>

View file

@ -1,7 +1,4 @@
#include "calendarSchedule.h" #include "calendarSchedule.h"
/*
* BUG: fix resizing when showing error on dates validation
*/
calendarSchedule::calendarSchedule(QWidget *parent) : QTableWidget(parent) calendarSchedule::calendarSchedule(QWidget *parent) : QTableWidget(parent)
{ {
QStringList days,hours; QStringList days,hours;