summaryrefslogtreecommitdiffabout
path: root/libkdepim
authorzautrix <zautrix>2005-02-16 22:38:07 (UTC)
committer zautrix <zautrix>2005-02-16 22:38:07 (UTC)
commit0eca506b6b4c7d7ef52bcecc5ad64193698dc3f3 (patch) (side-by-side diff)
tree5bc6d924f1a71cc04cb8f1ee0001fce7cde0fa71 /libkdepim
parentf33a37a0f7c9b37cfea1346ed373ce1c27c1d6ba (diff)
downloadkdepimpi-0eca506b6b4c7d7ef52bcecc5ad64193698dc3f3.zip
kdepimpi-0eca506b6b4c7d7ef52bcecc5ad64193698dc3f3.tar.gz
kdepimpi-0eca506b6b4c7d7ef52bcecc5ad64193698dc3f3.tar.bz2
added today but to datepicker
Diffstat (limited to 'libkdepim') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/kdatepicker.cpp12
-rw-r--r--libkdepim/kdatepicker.h2
2 files changed, 13 insertions, 1 deletions
diff --git a/libkdepim/kdatepicker.cpp b/libkdepim/kdatepicker.cpp
index c13734f..77793c4 100644
--- a/libkdepim/kdatepicker.cpp
+++ b/libkdepim/kdatepicker.cpp
@@ -49,2 +49,3 @@ KDatePicker::KDatePicker(QWidget *parent, QDate dt, const char *name)
selectYear(new QToolButton(this)),
+ todayBut(new QToolButton(this)),
//line(new QLineEdit(this)),
@@ -68,2 +69,3 @@ KDatePicker::KDatePicker(QWidget *parent, QDate dt, const char *name)
monthBackward->setPixmap(SmallIcon("1leftarrowB"));
+ todayBut->setPixmap(SmallIcon("today"));
setDate(dt); // set button texts
@@ -77,2 +79,3 @@ KDatePicker::KDatePicker(QWidget *parent, QDate dt, const char *name)
connect(selectYear, SIGNAL(clicked()), SLOT(selectYearClicked()));
+ connect(todayBut, SIGNAL(clicked()), SLOT(goToday()));
//connect(line, SIGNAL(returnPressed()), SLOT(lineEnterPressed()));
@@ -138,3 +141,5 @@ KDatePicker::resizeEvent(QResizeEvent*)
//line->setGeometry(0, height()-sizes[0].height(), width(), sizes[0].height());
- lineDate->setGeometry(0, height()-sizes[0].height(), width(), sizes[0].height());
+ int todaywid = todayBut->sizeHint().width();
+todayBut->setGeometry(0, height()-sizes[0].height(),todaywid, sizes[0].height());
+ lineDate->setGeometry(0+todaywid, height()-sizes[0].height(), width()-todaywid, sizes[0].height());
// ----- adjust the table:
@@ -172,2 +177,7 @@ KDatePicker::date() const
+void KDatePicker::goToday()
+{
+ slotSetDate( QDate::currentDate() );
+
+}
void KDatePicker::slotSetDate( QDate date )
diff --git a/libkdepim/kdatepicker.h b/libkdepim/kdatepicker.h
index 6625357..3db9a89 100644
--- a/libkdepim/kdatepicker.h
+++ b/libkdepim/kdatepicker.h
@@ -109,2 +109,3 @@ protected:
void resizeEvent(QResizeEvent*);
+ QToolButton *todayBut;
/// the year forward button
@@ -143,2 +144,3 @@ protected slots:
void slotSetDate(QDate);
+ void goToday();
signals: