示例#1
0
文件: analogclock.cs 项目: KDE/qyoto
    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);
    }
示例#2
0
    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);
    }
示例#3
0
 public void shoot()
 {
     if (autoShootTimer.Active)
     {
         return;
     }
     timerCount = 0;
     shootAngle = currentAngle;
     shootForce = currentForce;
     autoShootTimer.Start(5);
 }
示例#4
0
 public void Shoot()
 {
     if (IsShooting)
     {
         return;
     }
     timerCount = 0;
     shootAngle = currentAngle;
     shootForce = currentForce;
     autoShootTimer.Start(25);
     Emit.CanShoot(false);
 }
示例#5
0
 public void shoot()
 {
     if (isShooting())
     {
         return;
     }
     timerCount = 0;
     shootAngle = currentAngle;
     shootForce = currentForce;
     autoShootTimer.Start(5);
     Emit.canShoot(false);
 }
示例#6
0
        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();
            }
        }