当前位置: 首页>>代码示例>>C#>>正文


C# Qyoto.QWidget类代码示例

本文整理汇总了C#中Qyoto.QWidget的典型用法代码示例。如果您正苦于以下问题:C# QWidget类的具体用法?C# QWidget怎么用?C# QWidget使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


QWidget类属于Qyoto命名空间,在下文中一共展示了QWidget类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: HandleAccountAdded

        public void HandleAccountAdded(Account account)
        {
            QApplication.Invoke(delegate {
                QTextEdit textEdit = new QTextEdit(this);
                textEdit.FrameShape = QFrame.Shape.NoFrame;
                textEdit.ReadOnly = true;

                QWidget widget = new QWidget();

                QVBoxLayout layout = new QVBoxLayout(widget);
                layout.Margin = 0;
                layout.AddWidget(textEdit);

                m_XmlToolBox.AddItem(widget, account.Jid);

                m_AccountXmlWidgets.Add(account, widget);

                account.Client.OnWriteText += delegate(object sender, string txt) {
                    QApplication.Invoke(delegate {
                        if (enableConsoleCheckBox.Checked)
                            textEdit.Append("<b>" + Qt.Escape(txt) + "</b><br/>");
                    });
                };

                account.Client.OnReadText += delegate(object sender, string txt) {
                    QApplication.Invoke(delegate {
                        if (enableConsoleCheckBox.Checked)
                            textEdit.Append(Qt.Escape(txt) + "<br/>");
                    });
                };
            });
        }
开发者ID:jrudolph,项目名称:synapse,代码行数:32,代码来源:DebugWindow.cs

示例2: EditGroupsWidget

        public EditGroupsWidget(QWidget parent)
            : base(parent)
        {
            SetupUi();

            addButton.icon = Gui.LoadIcon("add", 16);
        }
开发者ID:goto,项目名称:synapse,代码行数:7,代码来源:EditGroupsWidget.cs

示例3: MucAffiliationDialog

        public MucAffiliationDialog(Room room, RoomParticipant participant, QWidget parentWindow)
            : base(parentWindow)
        {
            SetupUi();

            m_Room = room;
            m_Participant = participant;

            roomLabel.Text = room.JID.Bare;
            userLabel.Text = participant.RealJID.Bare;

            switch (participant.Affiliation) {
            case RoomAffiliation.owner:
                ownerRadioButton.Checked = true;
                break;
            case RoomAffiliation.admin:
                adminRadioButton.Checked = true;
                break;
            case RoomAffiliation.member:
                memberRadioButton.Checked = true;
                break;
            case RoomAffiliation.outcast:
                outcastRadioButton.Checked = true;
                break;
            default:
                noneRadioButton.Checked = true;
                break;
            }

            buttonBox.StandardButtons = (uint)QDialogButtonBox.StandardButton.Ok | (uint)QDialogButtonBox.StandardButton.Cancel;

            Gui.CenterWidgetOnScreen(this);
        }
开发者ID:jrudolph,项目名称:synapse,代码行数:33,代码来源:MucAffiliationDialog.cs

示例4: CannonField

 public CannonField(QWidget parent)
     : base(parent)
 {
     currentAngle = 45;
     Palette = new QPalette(new QColor(250, 250, 200));
     AutoFillBackground = true;
 }
开发者ID:KDE,项目名称:qyoto,代码行数:7,代码来源:t8.cs

示例5: Paint

    public override void Paint(QPainter painter, QStyleOptionGraphicsItem option, QWidget widget)
    {
        // Body
        painter.SetBrush(color);
        painter.DrawEllipse(-10, -20, 20, 40);

        // Eyes
        painter.SetBrush(Qt.GlobalColor.white);
        painter.DrawEllipse(-10, -17, 8, 8);
        painter.DrawEllipse(2, -17, 8, 8);

        // Nose
        painter.SetBrush(Qt.GlobalColor.black);
        painter.DrawEllipse(new QRectF(-2, -22, 4, 4));

        // Pupils
        painter.DrawEllipse(new QRectF(-8.0 + mouseEyeDirection, -17, 4, 4));
        painter.DrawEllipse(new QRectF(4.0 + mouseEyeDirection, -17, 4, 4));

        // Ears
        painter.SetBrush(Scene().CollidingItems(this).Count == 0 ? Qt.GlobalColor.darkYellow : Qt.GlobalColor.red);
        painter.DrawEllipse(-17, -12, 16, 16);
        painter.DrawEllipse(1, -12, 16, 16);

        // Tail
        QPainterPath path = new QPainterPath(new QPointF(0, 20));
        path.CubicTo(-5, 22, -5, 22, 0, 25);
        path.CubicTo(5, 27, 5, 32, 0, 30);
        path.CubicTo(-5, 32, -5, 42, 0, 35);
        painter.SetBrush(Qt.BrushStyle.NoBrush);
        painter.DrawPath(path);
    }
开发者ID:KDE,项目名称:qyoto,代码行数:32,代码来源:mouse.cs

示例6: NoAccountsWidget

        public NoAccountsWidget(QWidget parent)
            : base(parent)
        {
            SetupUi();

            m_Scene = new QGraphicsScene(m_Scene);
            m_GraphicsView.SetScene(m_Scene);
            m_Scene.SetSceneRect(0, 0, 200, 200);

            var octy = new QGraphicsPixmapItem(new QPixmap("resource:/octy.png"));
            octy.SetPos(0, 10);
            m_Scene.AddItem(octy);

            // TODO: Add bubbles!

            m_TimeLine = new QTimeLine(2000, m_Scene);
            m_TimeLine.curveShape = QTimeLine.CurveShape.EaseOutCurve;
            QObject.Connect(m_TimeLine, Qt.SIGNAL("finished()"), HandleTimerFinished);

            QGraphicsItemAnimation animation = new QGraphicsItemAnimation(m_Scene);
            animation.SetItem(octy);
            animation.SetTimeLine(m_TimeLine);
            animation.SetPosAt(1, new QPointF(0, 0));

            m_TimeLine.Start();
        }
开发者ID:toothrot,项目名称:synapse,代码行数:26,代码来源:NoAccountsWidget.cs

示例7: AboutDialog

        public AboutDialog(QWidget parentWindow)
            : base(parentWindow)
        {
            SetupUi();

            m_Scene = new QGraphicsScene(m_Scene);
            graphicsView.SetScene(m_Scene);
            m_Scene.SetSceneRect(0, 0, 200, 200);

            textLabel.Pixmap = new QPixmap("resource:/text.png");

            var octy = new QGraphicsPixmapItem(new QPixmap("resource:/octy.png"));
            octy.SetPos(0, 10);
            m_Scene.AddItem(octy);

            m_TimeLine = new QTimeLine(2000, m_Scene);
            m_TimeLine.curveShape = QTimeLine.CurveShape.EaseOutCurve;
            QObject.Connect(m_TimeLine, Qt.SIGNAL("finished()"), TimerFinished);

            QGraphicsItemAnimation animation = new QGraphicsItemAnimation(m_Scene);
            animation.SetItem(octy);
            animation.SetTimeLine(m_TimeLine);
            animation.SetPosAt(1, new QPointF(0, 0));

            m_TimeLine.Start();

            Gui.CenterWidgetOnScreen(this);
        }
开发者ID:jrudolph,项目名称:synapse,代码行数:28,代码来源:AboutDialog.cs

示例8: InviteToMucDialog

        public InviteToMucDialog(IChatHandler handler, QWidget parentWindow)
            : base(parentWindow)
        {
            SetupUi();

            buttonBox.StandardButtons = (uint)QDialogButtonBox.StandardButton.Ok | (uint)QDialogButtonBox.StandardButton.Cancel | (uint)QDialogButtonBox.StandardButton.Close;
            buttonBox.Button(QDialogButtonBox.StandardButton.Close).Hide();
            buttonBox.Button(QDialogButtonBox.StandardButton.Ok).Text = "&Invite";

            m_Handler = handler;

            if (handler is ChatHandler) {
                foreach (var room in m_Handler.Account.ConferenceManager.Rooms) {
                    mucsListWidget.AddItem(room.JID.ToString());
                }
                stackedWidget.CurrentIndex = 0;
            } else {
                foreach (var jid in m_Handler.Account.Roster) {
                    if (m_Handler.Account.PresenceManager.IsAvailable(jid)) {
                        friendsListWidget.AddItem(jid.ToString());
                    }
                }
                stackedWidget.CurrentIndex = 1;
                urlLineEdit.Text = String.Format("http://chat.synapse.im/room/{0}/", Uri.EscapeUriString(((MucHandler)m_Handler).Room.JID.ToString()));
            }

            Gui.CenterWidgetOnScreen(this);

            on_mucsListWidget_itemSelectionChanged();
        }
开发者ID:jrudolph,项目名称:synapse,代码行数:30,代码来源:InviteToMucDialog.cs

示例9: ViewOnTwitterAction

        public ViewOnTwitterAction(QWidget parent)
            : base(parent)
        {
            base.Text = "View on Twitter";
            base.icon = new QIcon(new QPixmap("resource:/twitter/twitm-16.png"));

            QObject.Connect<bool>(this, Qt.SIGNAL("triggered(bool)"), HandleTriggered);
        }
开发者ID:jrudolph,项目名称:synapse,代码行数:8,代码来源:ViewOnTwitterAction.cs

示例10: InsertLinkDialog

        public InsertLinkDialog(QWidget parentWindow)
            : base(parentWindow)
        {
            SetupUi();
            buttonBox.StandardButtons = (uint)QDialogButtonBox.StandardButton.Ok | (uint)QDialogButtonBox.StandardButton.Cancel;
            Validate();

            Gui.CenterWidgetOnScreen(this);
        }
开发者ID:jrudolph,项目名称:synapse,代码行数:9,代码来源:InsertLinkDialog.cs

示例11: GetItem

 /// <remarks>
 ///  Static convenience function to let the user select an item from a
 ///  list. caption is the text that is displayed in the title bar.
 ///  label is the text that appears as the label for the list. list
 ///  is the string list which is inserted into the list, and current
 ///  is the number of the item which should be the selected item. If
 ///  editable is true, the user can enter his own text.
 /// <param> name="caption" Caption of the dialog
 /// </param><param> name="label" Text of the label for the list
 /// </param><param> name="list" List of item for user to choose from
 /// </param><param> name="current" Index of the selected item
 /// </param><param> name="editable" If true, user can enter own text
 /// </param><param> name="ok" This bool would be set to true if user pressed Ok
 /// </param><param> name="parent" Parent of the dialog widget
 /// </param></remarks>        <return> Text of the selected item. If <code>editable</code> is true this can be
 ///          a text entered by the user.
 ///      </return>
 ///         <short>    Static convenience function to let the user select an item from a  list.</short>
 public static string GetItem(string caption, string label, List<string> list, int current, bool editable, ref bool ok, QWidget parent)
 {
     StackItem[] stack = new StackItem[8];
     #if DEBUG
     stack[1].s_class = (IntPtr) DebugGCHandle.Alloc(caption);
     #else
     stack[1].s_class = (IntPtr) GCHandle.Alloc(caption);
     #endif
     #if DEBUG
     stack[2].s_class = (IntPtr) DebugGCHandle.Alloc(label);
     #else
     stack[2].s_class = (IntPtr) GCHandle.Alloc(label);
     #endif
     #if DEBUG
     stack[3].s_class = (IntPtr) DebugGCHandle.Alloc(list);
     #else
     stack[3].s_class = (IntPtr) GCHandle.Alloc(list);
     #endif
     stack[4].s_int = current;
     stack[5].s_bool = editable;
     stack[6].s_bool = ok;
     #if DEBUG
     stack[7].s_class = (IntPtr) DebugGCHandle.Alloc(parent);
     #else
     stack[7].s_class = (IntPtr) GCHandle.Alloc(parent);
     #endif
     staticInterceptor.Invoke("getItem$$?$$$#", "getItem(const QString&, const QString&, const QStringList&, int, bool, bool*, QWidget*)", stack);
     #if DEBUG
     DebugGCHandle.Free((GCHandle) stack[1].s_class);
     #else
     ((GCHandle) stack[1].s_class).Free();
     #endif
     #if DEBUG
     DebugGCHandle.Free((GCHandle) stack[2].s_class);
     #else
     ((GCHandle) stack[2].s_class).Free();
     #endif
     #if DEBUG
     DebugGCHandle.Free((GCHandle) stack[3].s_class);
     #else
     ((GCHandle) stack[3].s_class).Free();
     #endif
     ok = stack[6].s_bool;
     #if DEBUG
     DebugGCHandle.Free((GCHandle) stack[7].s_class);
     #else
     ((GCHandle) stack[7].s_class).Free();
     #endif
     object returnValue = ((GCHandle) stack[0].s_class).Target;
     #if DEBUG
     DebugGCHandle.Free((GCHandle) stack[0].s_class);
     #else
     ((GCHandle) stack[0].s_class).Free();
     #endif
     return (string) returnValue;
 }
开发者ID:0xd34df00d,项目名称:Qross,代码行数:74,代码来源:KInputDialog.cs

示例12: InsertSnippetAction

        public InsertSnippetAction(QWidget parent)
            : base(parent)
        {
            m_ChatWindow = (ChatWindow)parent;

            QObject.Connect<bool>(this, Qt.SIGNAL("triggered(bool)"), HandleOnTriggered);

            base.Text = "Code Snippet...";
            base.icon = new QIcon(new QPixmap("resource:/codesnippets/insert-code.png"));
        }
开发者ID:jrudolph,项目名称:synapse,代码行数:10,代码来源:InsertSnippetAction.cs

示例13: InsertSnippetAction

        public InsertSnippetAction(QWidget parent)
            : base(parent)
        {
            m_ChatWindow = (ChatWindow)parent;

            QObject.Connect<bool>(this, Qt.SIGNAL("triggered(bool)"), HandleOnTriggered);

            base.Text = "Code Snippet...";
            base.icon = Gui.LoadIcon("stock_script", 16);
        }
开发者ID:goto,项目名称:synapse,代码行数:10,代码来源:InsertSnippetAction.cs

示例14: AnalogClock

    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);
    }
开发者ID:KDE,项目名称:qyoto,代码行数:10,代码来源:analogclock.cs

示例15: Controller

 public Controller(QWidget parent)
     : base(parent)
 {
     ui = new Ui.Controller();
     ui.SetupUi(this);
     car = new QDBusInterface("com.trolltech.CarExample", "/Car",
                              "com.trolltech.Examples.CarInterface",
                              QDBusConnection.SessionBus(), this);
     StartTimer(1000);
 }
开发者ID:KDE,项目名称:qyoto,代码行数:10,代码来源:controller.cs


注:本文中的Qyoto.QWidget类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。