public AnalogClock(QWidget parent) : base(parent) { QTimer timer = new QTimer(this); Connect(timer, SIGNAL("timeout()"), this, SLOT("update()")); timer.Start(1000); WindowTitle = Tr("Analog Clock"); Resize(200, 200); }
public AnalogClock(QWidget parent) : base(parent) { QTimer timer = new QTimer(this); Connect(timer, SIGNAL("timeout()"), this, SLOT("update()")); timer.Start(1000); WindowTitle = Tr("Analog Clock"); Resize(200,200); }
public void shoot() { if (autoShootTimer.Active) { return; } timerCount = 0; shootAngle = currentAngle; shootForce = currentForce; autoShootTimer.Start(5); }
public void Shoot() { if (IsShooting) { return; } timerCount = 0; shootAngle = currentAngle; shootForce = currentForce; autoShootTimer.Start(25); Emit.CanShoot(false); }
public void shoot() { if (isShooting()) { return; } timerCount = 0; shootAngle = currentAngle; shootForce = currentForce; autoShootTimer.Start(5); Emit.canShoot(false); }
void UpdateHoverItem() { var oldItem = m_HoverItem; var pos = this.MapFromGlobal(QCursor.Pos()); var item = this.ItemAt(pos); // Since we map the point to scene coords, we could accidently // focus items outside the visible viewport. if (m_SuppressTooltips || !this.Viewport().Geometry.Contains(pos) || !this.IsVisible()) { m_TooltipTimer.Stop(); m_HoverItem = null; m_InfoPopup.Item = null; } else { if (item is RosterItem <T> ) { m_HoverItem = (RosterItem <T>)item; m_HoverItem.Update(); if (m_InfoPopup.Item != m_HoverItem) { if (m_InfoPopup.IsVisible()) { m_InfoPopup.Item = m_HoverItem; } else { m_TooltipTimer.Stop(); m_InfoPopup.Item = m_HoverItem; m_TooltipTimer.Start(); } } } else { m_TooltipTimer.Stop(); m_HoverItem = null; // Allow a buffer around the active item so that the tooltip // can change items without having to be closed/re-opened. if (m_InfoPopup.Item != null) { var itemRect = m_InfoPopup.Item.SceneBoundingRect(); var itemPos = this.MapFromScene(itemRect.X(), itemRect.Y()); QRectF rect = new QRectF(itemPos.X() - IconPadding, itemPos.Y() - IconPadding, itemRect.Width() + IconPadding + IconPadding, itemRect.Height() + IconPadding + IconPadding); if (!rect.Contains(pos)) { m_InfoPopup.Item = null; } } } } if (oldItem != null && oldItem != m_HoverItem) { oldItem.Update(); } }