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(); }
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); }
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); }
public AvatarGrid(QWidget parent) : base(parent) { // FIXME: Need a preference to turn this on/off. // this.SetViewport(new QGLWidget()); m_Scene = new AvatarGridScene(this); this.SetScene(m_Scene); m_InfoPopup = new InfoPopup <T>(this); m_InfoPopup.DoubleClicked += delegate { MouseDoubleClickEvent(null); }; m_InfoPopup.RightClicked += delegate(QPoint pos) { Emit.CustomContextMenuRequested(this.MapFromGlobal(pos)); }; m_InfoPopup.MouseMoved += delegate { UpdateHoverItem(); }; m_TooltipTimer = new QTimer(this); m_TooltipTimer.SingleShot = true; m_TooltipTimer.Interval = 500; QObject.Connect(m_TooltipTimer, Qt.SIGNAL("timeout()"), HandleTooltipTimerTimeout); this.AcceptDrops = true; }
public IActionResult Submit(Qt NewQuote) { string query = $"INSERT INTO Quotes (Name, Text, Created_at) VALUES ('{NewQuote.Name}', '{NewQuote.Text}', '{NewQuote.Created_At}')"; DbConnector.Execute(query); return(RedirectToAction("Index")); }
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")); }
public void Can_build_qobject() { AssertQObject(_ => { var qObject = Qt.BuildQObject("TestQObject*"); qObject.Should().NotBeNull(); qObject.Dispose(); }); }
public void Invalid_type_names_return_null_when_building_qobjects() { AssertQObject(_ => { Qt.BuildQObject("sdfsdfsfsd").Should().BeNull(); Qt.BuildQObject("int").Should().BeNull(); Qt.BuildQObject("TestQObject").Should().BeNull(); // No * at end. }); }
public AvatarProviderTab(IAvatarProvider provider, QWidget parent) : base(parent) { m_Provider = provider; QObject.Connect(base.Page().MainFrame(), Qt.SIGNAL("javaScriptWindowObjectCleared()"), delegate { base.Page().MainFrame().AddToJavaScriptWindowObject("AvatarSelectDialog", parent.TopLevelWidget()); }); base.SetHtml(String.Empty); }
public void Can_put_and_get_env() { var envName = Guid.NewGuid().ToString().Replace("-", ""); Qt.GetEnv(envName).Should().BeNullOrEmpty(); Qt.PutEnv(envName, "TEST"); Qt.GetEnv(envName).Should().Be("TEST"); Qt.PutEnv(envName, null); Qt.GetEnv(envName).Should().BeNullOrEmpty(); }
public AddOctyDialog() { SetupUi(); QObject.Connect(webView.Page().MainFrame(), Qt.SIGNAL("javaScriptWindowObjectCleared()"), HandleJavaScriptWindowObjectCleared); webView.Page().linkDelegationPolicy = QWebPage.LinkDelegationPolicy.DelegateAllLinks; webView.Load("resource:/addocty.html"); Gui.CenterWidgetOnScreen(this); }
private double[] getbcol(int j) { double[] b = new double[n]; for (int i = 1; i <= n; i++) { b[i - 1] = Qt.gm(i, j); } return(b); }
protected void SetupUi() { base.ObjectName = "AboutDialog"; this.Geometry = new QRect(0, 0, 384, 492); this.MinimumSize = new QSize(384, 0); this.WindowTitle = "About Synapse"; this.StyleSheet = "#AboutDialog {\n\tmax-width: 384px;\n\tbackground: #010409 url(resource:/oceanbg.png) no-repeat top center;\n}\n\nQWidget {\n\tcolor: white;\n}\n\nQGraphicsView, QTextBrowser {\n\tbackground: transparent;\n}\n\nQPushButton[flat=\"false\"] {\n\tborder: 1px solid #2B2D31;\n\tborder-radius: 3px;\n\tbackground-color: #2B2D31;\n\tpadding: 3px;\n}\n\n#textLabel {\n\tmargin-bottom: 12px;\n}\n\nQScrollBar:vertical {\n\tborder: 0px;\n\tbackground: transparent;\n\twidth: 15px;\n\tmargin: 0px;\n}\n\nQScrollBar::handle:vertical {\n\tbackground: #4F4F4F;\n\tmin-height: 20px;\n\tborder: 1px solid #4F4F4F;\n\tborder-radius: 5px;\n}\n\nQScrollBar::add-line:vertical {\n\theight: 0px;\n\tborder: 0px;\n}\n\nQScrollBar::sub-line:vertical {\n\theight: 0px;\n}\n\nQScrollBar::add-page:vertical, \nQScrollBar::sub-page:vertical {\n\tbackground: none;\n}"; QVBoxLayout verticalLayout; verticalLayout = new QVBoxLayout(this); verticalLayout.Spacing = 6; verticalLayout.Margin = 6; this.widget = new QWidget(this); this.widget.ObjectName = "widget"; QHBoxLayout horizontalLayout; horizontalLayout = new QHBoxLayout(this.widget); horizontalLayout.Margin = 0; this.graphicsView = new QGraphicsView(this.widget); this.graphicsView.ObjectName = "graphicsView"; this.graphicsView.MinimumSize = new QSize(0, 250); this.graphicsView.FrameShape = QFrame.Shape.NoFrame; horizontalLayout.AddWidget(this.graphicsView); verticalLayout.AddWidget(this.widget); this.textLabel = new QLabel(this); this.textLabel.ObjectName = "textLabel"; this.textLabel.Text = ""; this.textLabel.Alignment = global::Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignCenter"); verticalLayout.AddWidget(this.textLabel); this.textBrowser = new QTextBrowser(this); this.textBrowser.ObjectName = "textBrowser"; this.textBrowser.MaximumSize = new QSize(16777215, 120); this.textBrowser.FrameShape = QFrame.Shape.NoFrame; this.textBrowser.FrameShadow = QFrame.Shadow.Plain; this.textBrowser.Html = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\np, li { white-space: pre-wrap; }\n</style></head><body style=\" font-family:'Bitstream Vera Sans'; font-size:9pt; font-weight:400; font-style:normal;\">\n<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-weight:600;\">Created By</span></p>\n<p align=\"center\" style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600;\"></p>\n<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600;\"><a href=\"#message-eric\"><span style=\" font-weight:400; text-decoration: underline; color:#ffffff;\">Eric Butler</span></a></p>\n<p align=\"center\" style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"></p>\n<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-weight:600;\">Special Thanks To</span></p>\n<p align=\"center\" style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600;\"></p>\n<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-weight:600;\"><span style=\" font-weight:400;\">Chris Hergert</span></p>\n<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Allison Hughes</p>\n<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Arno Rehn</p>\n<p align=\"center\" style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Darryl Ring</p></body></html>"; verticalLayout.AddWidget(this.textBrowser); QHBoxLayout horizontalLayout_2; horizontalLayout_2 = new QHBoxLayout(); verticalLayout.AddLayout(horizontalLayout_2); this.sendFeedbackButton = new QPushButton(this); this.sendFeedbackButton.ObjectName = "sendFeedbackButton"; this.sendFeedbackButton.Text = "Send Feedback"; horizontalLayout_2.AddWidget(this.sendFeedbackButton); this.buttonBox = new QDialogButtonBox(this); this.buttonBox.ObjectName = "buttonBox"; this.buttonBox.Orientation = Qt.Orientation.Horizontal; this.buttonBox.StandardButtons = global::Qyoto.Qyoto.GetCPPEnumValue("QDialogButtonBox", "Close"); horizontalLayout_2.AddWidget(this.buttonBox); QObject.Connect(buttonBox, Qt.SIGNAL("rejected()"), this, Qt.SLOT("reject()")); QObject.Connect(buttonBox,Qt.SIGNAL("accepted()"),this,Qt.SLOT("accept()")); QObject.Connect(buttonBox,Qt.SIGNAL("accepted()"),this,Qt.SLOT("accept()")); QMetaObject.ConnectSlotsByName(this); }
public void SetupUi(QWidget LifetimeConstraintWidget) { if (LifetimeConstraintWidget.ObjectName == "") { LifetimeConstraintWidget.ObjectName = "LifetimeConstraintWidget"; } QSize Size = new QSize(283, 48); Size = Size.ExpandedTo(LifetimeConstraintWidget.MinimumSizeHint); LifetimeConstraintWidget.Size = Size; horizontalLayout = new QHBoxLayout(LifetimeConstraintWidget); horizontalLayout.SetContentsMargins(0, 0, 0, 0); horizontalLayout.ObjectName = "horizontalLayout"; horizontalLayout.sizeConstraint = QLayout.SizeConstraint.SetNoConstraint; mCheckBox = new QCheckBox(LifetimeConstraintWidget); mCheckBox.ObjectName = "mCheckBox"; QSizePolicy sizePolicy = new QSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Fixed); sizePolicy.SetHorizontalStretch(0); sizePolicy.SetVerticalStretch(0); sizePolicy.SetHeightForWidth(mCheckBox.SizePolicy.HasHeightForWidth); mCheckBox.SizePolicy = sizePolicy; horizontalLayout.AddWidget(mCheckBox); mLineEdit = new QLineEdit(LifetimeConstraintWidget); mLineEdit.ObjectName = "mLineEdit"; mLineEdit.Enabled = false; sizePolicy.SetHeightForWidth(mLineEdit.SizePolicy.HasHeightForWidth); mLineEdit.SizePolicy = sizePolicy; mLineEdit.MaximumSize = new QSize(40, 16777215); mLineEdit.InputMethodHints = Qt.InputMethodHint.ImhPreferNumbers; horizontalLayout.AddWidget(mLineEdit); mSecondsLable = new QLabel(LifetimeConstraintWidget); mSecondsLable.ObjectName = "mSecondsLable"; mSecondsLable.Enabled = false; horizontalLayout.AddWidget(mSecondsLable); spacerItem = new QSpacerItem(90, 20, QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Minimum); horizontalLayout.AddItem(spacerItem); RetranslateUi(LifetimeConstraintWidget); QObject.Connect(mCheckBox, Qt.SIGNAL("toggled(bool)"), mLineEdit, Qt.SLOT("setEnabled(bool)")); QObject.Connect(mCheckBox,Qt.SIGNAL("toggled(bool)"),mSecondsLable,Qt.SLOT("setEnabled(bool)")); QObject.Connect(mCheckBox,Qt.SIGNAL("toggled(bool)"),mLineEdit,Qt.SLOT("setFocus()")); QMetaObject.ConnectSlotsByName(LifetimeConstraintWidget); } // SetupUi
private static int Main(string[] args) { RuntimeManager.DiscoverOrDownloadSuitableQtRuntime(); Qt.PutEnv("QT_QUICK_CONTROLS_CONF", System.IO.Directory.GetCurrentDirectory() + "/qml/qtquickcontrols2.conf"); QmlNetConfig.ShouldEnsureUIThread = false; // remove this line when fixed in qml.net: temporary workaround for https://github.com/qmlnet/qmlnet/issues/112 using QGuiApplication app = new QGuiApplication(args); using QQmlApplicationEngine engine = new QQmlApplicationEngine(); // Register our new type to be used in Qml QmlBridge.RegisterTypes(); engine.Load(System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "qml", "main.qml")); return(app.Exec()); }
public byte[] GetBytes() { return(Qt.Concat( MAGIC_NUMBER, SCHEMA_VERSION, Qt.Encode((uint)MessageType.HIGHLIGHT_CALLSIGN_MESSAGE_TYPE), Qt.Encode(Id), Qt.Encode(Callsign), Qt.Encode(BackgroundColour), Qt.Encode(ForegroundColour), Qt.Encode(HighlightLast))); }
public void GlobalSetup() { _guiApplication = new QGuiApplication(new[] { "-platform", "offscreen" }); _qmlApplicationEngine = new QQmlApplicationEngine(); NetTestHelper.RunQml( _qmlApplicationEngine, @" import QtQuick 2.0 import tests 1.0 Item {{ }}"); _qObject = Qt.BuildQObject("TestQObject*"); }
/// <summary> /// Build the sql for the query /// </summary> /// <param name="eqp"></param> /// <returns></returns> public override string BuildSql( ExecuteQueryParms eqp) { string sql = ""; Eqp = eqp; if (Eqp == null) { DebugMx.DataException("Eqp parameter is null"); } Qt = eqp.QueryTable; if (Qt == null) { DebugMx.DataException("Eqp.QueryTable is null"); } MetaTable mt = Qt.MetaTable; if (mt == null) { DebugMx.DataException("Metatable not defined for CalcField Query Table"); } Query q = eqp.Qe.Query; QueryTableData[] qtd = eqp.Qe.Qtd; // query table data QueryColumn qc; MetaColumn mc; KeyMc = mt.KeyMetaColumn; if (KeyMc == null) { throw new Exception("Key (compound number) column not found for MetaTable " + mt.Name); } KeyQci = Qt.GetQueryColumnIndexByName(KeyMc.Name); KeyQc = Qt.QueryColumns[KeyQci]; KeyQc.Selected = true; // be sure key is selected Qt.MetaTable.KeyMetaColumn.ColumnMap = ""; // reset key column mapping Query q2 = InitializeSubQuery(Qt); foreach (QueryTable qtx in q2.Tables) { // todo... } return(sql); }
static int Main(string[] args) { Qt.PutEnv("QT_OPENGL", "angle"); Qt.PutEnv("QT_ANGLE_PLATFORM", "warp"); Qt.PutEnv("QT_DISABLE_SHADER_DISK_CACHE", "1"); using (var app = new QGuiApplication(args)) { using (var engine = new QQmlApplicationEngine()) { Qml.Net.Qml.RegisterType <EditorModel>("Editor"); engine.Load("main.qml"); return(app.Exec()); } } }
public AvatarGridZoomAction(AvatarGrid <T> grid) : base(grid) { m_Grid = grid; m_SliderContainer = new QWidget(); m_SliderContainer.SetLayout(new QHBoxLayout()); m_SliderContainer.Layout().AddWidget(new QLabel("Zoom:", m_SliderContainer)); var zoomSlider = new QSlider(Orientation.Horizontal, m_SliderContainer); zoomSlider.Minimum = 16; zoomSlider.Maximum = 60; zoomSlider.Value = m_Grid.IconSize; QObject.Connect <int>(zoomSlider, Qt.SIGNAL("valueChanged(int)"), HandleZoomSliderValueChanged); m_SliderContainer.Layout().AddWidget(zoomSlider); base.SetDefaultWidget(m_SliderContainer); }
public AddAccountDialog() { SetupUi(); var forwardButton = new QPushButton(Gui.LoadIcon("forward"), "&Forward"); QObject.Connect(forwardButton, Qt.SIGNAL("clicked()"), HandleForwardButtonClicked); buttonBox.AddButton(forwardButton, QDialogButtonBox.ButtonRole.AcceptRole); buttonBox_2.StandardButtons = (uint)QDialogButtonBox.StandardButton.Ok | (uint)QDialogButtonBox.StandardButton.Cancel; var addAccountButton = buttonBox_2.Button(QDialogButtonBox.StandardButton.Ok); QObject.Connect(addAccountButton, Qt.SIGNAL("clicked()"), HandleAddAccountButtonClicked); addAccountButton.Text = "&Add Account"; Gui.CenterWidgetOnScreen(this); }
public ServiceBrowserWindow(Account account) { SetupUi(); m_Account = account; m_HomeUri = new Uri(String.Format("xmpp:{0}?disco", account.Jid.Server)); this.WindowTitle = String.Format("XMPP Browser - {0}", account.Jid); m_BackAction = new QAction(Gui.LoadIcon("go-previous", 16), "Back", this); m_ForwardAction = new QAction(Gui.LoadIcon("go-next", 16), "Forward", this); m_ReloadAction = new QAction(Gui.LoadIcon("view-refresh", 16), "Reload", this); m_StopAction = new QAction(Gui.LoadIcon("process-stop", 16), "Stop", this); m_HomeAction = new QAction(Gui.LoadIcon("go-home", 16), "Home", this); m_GoAction = new QAction("Go", this); m_BackAction.Enabled = false; m_ForwardAction.Enabled = false; m_StopAction.Visible = false; m_Toolbar = new QToolBar(this); m_Toolbar.AddAction(m_BackAction); m_Toolbar.AddAction(m_ForwardAction); m_Toolbar.AddAction(m_ReloadAction); m_Toolbar.AddAction(m_StopAction); m_Toolbar.AddAction(m_HomeAction); m_AddresCombo = new QComboBox(m_Toolbar); m_AddresCombo.SetSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed); m_AddresCombo.Editable = true; m_Toolbar.AddWidget(m_AddresCombo); m_Toolbar.AddAction(m_GoAction); QObject.Connect <QAction>(m_Toolbar, Qt.SIGNAL("actionTriggered(QAction*)"), HandleToolbarActionTriggered); ((QBoxLayout)this.Layout()).InsertWidget(0, m_Toolbar); webView.Page().linkDelegationPolicy = QWebPage.LinkDelegationPolicy.DelegateAllLinks; RequestUrl(m_HomeUri); Gui.CenterWidgetOnScreen(this); }
/// <summary> /// Build condformatting for activity bins /// </summary> void BuildActivityBinCondFormat() { QueryColumn qc; qc = Qt.GetQueryColumnByName(MultiDbAssayDataNames.ActivityBin); // assign default cond formatting for activity bin if (qc != null && qc.Selected && qc.CondFormat == null) { qc.CondFormat = UnpivotedAssayResult.BuildActivityBinCondFormat(); } qc = Qt.GetQueryColumnByName(MultiDbAssayDataNames.ActivityBinMostPotent); if (qc != null && qc.Selected && qc.CondFormat == null) { qc.CondFormat = UnpivotedAssayResult.BuildActivityBinCondFormat(); } return; }
static int Main(string[] args) { Qt.PutEnv("QV4_MM_AGGRESSIVE_GC", "1"); using (var app = new QGuiApplication(args)) { using (var engine = new QQmlApplicationEngine()) { engine.AddImportPath(Path.Combine(Directory.GetCurrentDirectory(), "Qml")); Qml.RegisterType <TestQmlImport>("test"); engine.Load("main.qml"); return(app.Exec()); } } }
public InsertSnippetDialog(QWidget parent) : base(parent) { SetupUi(); buttonBox.StandardButtons = (uint)QDialogButtonBox.StandardButton.Ok | (uint)QDialogButtonBox.StandardButton.Cancel; ChatWindow chatWindow = (ChatWindow)parent; toLabel.Text = (chatWindow.Handler is ChatHandler) ? ((ChatHandler)chatWindow.Handler).Jid.ToString() : ((MucHandler)chatWindow.Handler).Room.JID.ToString(); var service = ServiceManager.Get <CodeSnippetsService>(); foreach (var highlighter in service.Highlighters) { typeComboBox.AddItem(highlighter.FullName, highlighter.Name); } QObject.Connect(this, Qt.SIGNAL("accepted()"), HandleDialogAccepted); Gui.CenterWidgetOnScreen(this); }
public ErrorDialog(string errorTitle, string errorMessage, string errorDetail, QWidget parentWindow) : base(parentWindow) { SetupUi(); iconLabel.Pixmap = Gui.LoadIcon("dialog-error").Pixmap(32); titleLabel.Text = "<b>" + Qt.Escape(errorTitle) + "</b>"; messageLabel.Text = !String.IsNullOrEmpty(errorMessage) ? errorMessage : String.Empty; detailsTextEdit.Hide(); if (!String.IsNullOrEmpty(errorDetail)) { detailsTextEdit.PlainText = errorDetail; } else { showDetailsButtonContainer.Hide(); } Gui.CenterWidgetOnScreen(this); }
public void SetupUi(QDialog PassphraseDialog) { if (PassphraseDialog.ObjectName == "") { PassphraseDialog.ObjectName = "PassphraseDialog"; } QSize Size = new QSize(493, 118); Size = Size.ExpandedTo(PassphraseDialog.MinimumSizeHint); PassphraseDialog.Size = Size; verticalLayout = new QVBoxLayout(PassphraseDialog); verticalLayout.ObjectName = "verticalLayout"; mMessageLabel = new QLabel(PassphraseDialog); mMessageLabel.ObjectName = "mMessageLabel"; verticalLayout.AddWidget(mMessageLabel, 0, Qt.AlignmentFlag.AlignHCenter); mPassphraseLineEdit = new QLineEdit(PassphraseDialog); mPassphraseLineEdit.ObjectName = "mPassphraseLineEdit"; mPassphraseLineEdit.echoMode = QLineEdit.EchoMode.Password; verticalLayout.AddWidget(mPassphraseLineEdit); mButtonBox = new QDialogButtonBox(PassphraseDialog); mButtonBox.ObjectName = "mButtonBox"; mButtonBox.Orientation = Qt.Orientation.Horizontal; mButtonBox.StandardButtons = QDialogButtonBox.StandardButton.Cancel | QDialogButtonBox.StandardButton.Ok; verticalLayout.AddWidget(mButtonBox); RetranslateUi(PassphraseDialog); QObject.Connect(mButtonBox, Qt.SIGNAL("accepted()"), PassphraseDialog, Qt.SLOT("accept()")); QObject.Connect(mButtonBox,Qt.SIGNAL("rejected()"),PassphraseDialog,Qt.SLOT("reject()")); QMetaObject.ConnectSlotsByName(PassphraseDialog); } // SetupUi
public void EncodeColour() { /* * qint8 s = color.cspec; * quint16 a = color.ct.argb.alpha; * quint16 r = color.ct.argb.red; * quint16 g = color.ct.argb.green; * quint16 b = color.ct.argb.blue; * quint16 p = color.ct.argb.pad; */ var bytes = Qt.Encode(new Colour { Red = 0xff, Green = 0x00, Blue = 0x00 }); Assert.Equal(new byte[] { 0x01, // spec, RGB 0xff, 0xff, // alpha, 100% 0xff, 0x00, // red, 100% 0x00, 0x00, // green, 0% 0x00, 0x00, // blue, 0% 0x00, 0x00, // pad }, bytes); }
protected void SetupUi() { base.ObjectName = "InsertLinkDialog"; this.Geometry = new QRect(0, 0, 287, 110); this.WindowTitle = "Insert Link"; QVBoxLayout verticalLayout; verticalLayout = new QVBoxLayout(this); verticalLayout.Margin = 6; QFormLayout formLayout; formLayout = new QFormLayout(); verticalLayout.AddLayout(formLayout); this.label_2 = new QLabel(this); this.label_2.ObjectName = "label_2"; this.label_2.Text = "URL:"; formLayout.SetWidget(0, QFormLayout.ItemRole.LabelRole, this.label_2); this.urlLineEdit = new QLineEdit(this); this.urlLineEdit.ObjectName = "urlLineEdit"; formLayout.SetWidget(0, QFormLayout.ItemRole.FieldRole, this.urlLineEdit); this.label = new QLabel(this); this.label.ObjectName = "label"; this.label.Text = "Text:"; formLayout.SetWidget(1, QFormLayout.ItemRole.LabelRole, this.label); this.textLineEdit = new QLineEdit(this); this.textLineEdit.ObjectName = "textLineEdit"; formLayout.SetWidget(1, QFormLayout.ItemRole.FieldRole, this.textLineEdit); this.buttonBox = new QDialogButtonBox(this); this.buttonBox.ObjectName = "buttonBox"; this.buttonBox.Orientation = Qt.Orientation.Horizontal; this.buttonBox.StandardButtons = (global::Qyoto.Qyoto.GetCPPEnumValue("QDialogButtonBox", "Cancel") | global::Qyoto.Qyoto.GetCPPEnumValue("QDialogButtonBox", "Ok")); verticalLayout.AddWidget(this.buttonBox); QObject.Connect(buttonBox, Qt.SIGNAL("accepted()"), this, Qt.SLOT("accept()")); QObject.Connect(buttonBox,Qt.SIGNAL("rejected()"),this,Qt.SLOT("reject()")); QMetaObject.ConnectSlotsByName(this); }
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/>"); } }); }; }); }