Commit cb74b9c1 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

KHBox --

parent 32fac4ef
......@@ -27,17 +27,23 @@
#include <kglobal.h>
#include <KLocalizedString>
#include <QHBoxLayout>
#include <QTime>
TimeEdit::TimeEdit(QWidget* parent)
: KHBox(parent),
: QWidget(parent),
mAmPm(0),
mAmIndex(-1),
mPmIndex(-1),
mReadOnly(false)
{
QHBoxLayout *hbox = new QHBoxLayout;
hbox->setMargin(0);
setLayout(hbox);
bool use12hour = KLocale::global()->use12Clock();
mSpinBox = new TimeSpinBox(!use12hour, this);
hbox->addWidget(mSpinBox);
mSpinBox->setFixedSize(mSpinBox->sizeHint());
connect(mSpinBox, SIGNAL(valueChanged(int)), SLOT(slotValueChanged(int)));
if (use12hour)
......@@ -45,6 +51,7 @@ TimeEdit::TimeEdit(QWidget* parent)
mAmPm = new ComboBox(this);
setAmPmCombo(1, 1); // add "am" and "pm" options to the combo box
mAmPm->setFixedSize(mAmPm->sizeHint());
hbox->addWidget(mAmPm);
connect(mAmPm, SIGNAL(highlighted(int)), SLOT(slotAmPmChanged(int)));
}
}
......
......@@ -21,7 +21,6 @@
#ifndef TIMEEDIT_H
#define TIMEEDIT_H
#include <khbox.h>
#include <QTime>
class ComboBox;
class TimeSpinBox;
......@@ -46,7 +45,7 @@ class TimeSpinBox;
*
* @author David Jarvie <djarvie@kde.org>
*/
class TimeEdit : public KHBox
class TimeEdit : public QWidget
{
Q_OBJECT
public:
......
......@@ -27,6 +27,7 @@
#include <KLocalizedString>
#include <kdialog.h>
#include <QHBoxLayout>
#include <QStackedWidget>
using namespace KCalCore;
......@@ -46,14 +47,18 @@ static const int maxMinutes = 1000*60-1; // absolute maximum value for hours:m
=============================================================================*/
TimePeriod::TimePeriod(bool allowHourMinute, QWidget* parent)
: KHBox(parent),
: QWidget(parent),
mMaxDays(9999),
mNoHourMinute(!allowHourMinute),
mReadOnly(false)
{
setSpacing(KDialog::spacingHint());
QHBoxLayout *layout = new QHBoxLayout;
setLayout(layout);
layout->setSpacing(KDialog::spacingHint());
layout->setMargin(0);
mSpinStack = new QStackedWidget(this);
layout->addWidget(mSpinStack);
mSpinBox = new SpinBox(mSpinStack);
mSpinBox->setSingleStep(1);
mSpinBox->setSingleShiftStep(10);
......@@ -71,6 +76,7 @@ TimePeriod::TimePeriod(bool allowHourMinute, QWidget* parent)
showHourMin(!mNoHourMinute);
mUnitsCombo = new ComboBox(this);
layout->addWidget(mUnitsCombo);
mUnitsCombo->setEditable(false);
if (mNoHourMinute)
mDateOnlyOffset = 2;
......
......@@ -22,7 +22,7 @@
#define TIMEPERIOD_H
#include <KCalCore/Duration>
#include <khbox.h>
#include <QWidget>
#include <QString>
class QStackedWidget;
......@@ -48,7 +48,7 @@ class TimeSpinBox;
*
* @author David Jarvie <djarvie@kde.org>
*/
class TimePeriod : public KHBox
class TimePeriod : public QWidget
{
Q_OBJECT
public:
......
......@@ -38,6 +38,7 @@
#include "timespinbox.h"
#include "buttongroup.h"
#include <KHBox>
#include <kalarmcal/kaevent.h>
#include <kalarmcal/karecurrence.h>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment