JulyLightChanges::JulyLightChanges(QDoubleSpinBox *parent)
	: QObject()
{
	lastValue=0.0;
	parentSpinBox=parent;
	setParent(parentSpinBox);
	changeTimer=new QTimer;
	connect(changeTimer,SIGNAL(timeout()),this,SLOT(changeTimerSlot()));
	changeTimer->setSingleShot(true);
	valueChanged(parentSpinBox->value());
	connect(parent,SIGNAL(valueChanged(double)),this,SLOT(valueChanged(double)));
}
Пример #2
0
/*!
 * \brief Constructs the component and its dialog.
 * \details Constructs the component and its dialog, also connects Q_SIGNALS
 * used
 * to notify when timers have changed.
 * \param parent
 */
WaiterComponent::WaiterComponent(QWidget *parent)
    : Component(parent),
      dialog(parent, QCoreApplication::applicationDirPath() + "/murasaki.png")
{
  dialog.setWindowFlags(Qt::Window);
  connect(&dialog, SIGNAL(changeTimers()), this, SLOT(changeTimerSlot()));
  connect(&dialog, SIGNAL(emitText(QString)), this, SLOT(emitSpeak(QString)));
#ifndef Q_OS_WIN
  new WaiterAdaptor(this);
  QDBusConnection dbus = QDBusConnection::sessionBus();
  dbus.registerObject("/Waiter", this);
// dbus.registerService("com.coderfrog.qcompanion.waiter");
#endif
}