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>
</property>
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<property name="documentMode">
<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
{
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;
}
else // input is valid
{
this->resize(610,310);
changeLabeStatusIcon(true);
ui->lbl_status->setText(tr("Looks fine, Click \"OK\""));
this->isOK = true;
@ -69,7 +71,7 @@ void CalendarDialog::on_calEnd_selectionChanged()
if(ui->calStart->selectedDate() >= ui->calEnd->selectedDate())
{
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;
}

View file

@ -6,12 +6,12 @@
<rect>
<x>0</x>
<y>0</y>
<width>610</width>
<width>609</width>
<height>310</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@ -156,6 +156,15 @@
</item>
<item row="0" column="1">
<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">
<string>&lt;b&gt;Please chose your dates correctly&lt;/b&gt;</string>
</property>

View file

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