本文整理汇总了C#中Qyoto.QWidget.SetSizePolicy方法的典型用法代码示例。如果您正苦于以下问题:C# QWidget.SetSizePolicy方法的具体用法?C# QWidget.SetSizePolicy怎么用?C# QWidget.SetSizePolicy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Qyoto.QWidget
的用法示例。
在下文中一共展示了QWidget.SetSizePolicy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ChatWindow
//.........这里部分代码省略.........
m_InsertPhotoAction = new QAction(Gui.LoadIcon("insert-image", 16), "Photo...", this);
QObject.Connect(m_InsertPhotoAction, Qt.SIGNAL("triggered()"), HandleInsertImageActionTriggered);
insertMenu.AddAction(m_InsertPhotoAction);
m_InsertLinkAction = new QAction(Gui.LoadIcon("insert-link", 16), "Link...", this);
QObject.Connect(m_InsertLinkAction, Qt.SIGNAL("triggered()"), HandleInsertLinkActionTriggered);
insertMenu.AddAction(m_InsertLinkAction);
foreach (IActionCodon node in AddinManager.GetExtensionNodes("/Synapse/QtClient/ChatWindow/InsertActions")) {
insertMenu.AddAction((QAction)node.CreateInstance(this));
}
toolbar.AddSeparator();
var activitiesMenu = new QMenu(this);
var activitiesMenuButton = new QToolButton(this);
activitiesMenuButton.ToolButtonStyle = ToolButtonStyle.ToolButtonTextBesideIcon;
activitiesMenuButton.Text = "Activities";
activitiesMenuButton.icon = Gui.LoadIcon("applications-games", 16); // FIXME: Not a good icon.
activitiesMenuButton.PopupMode = QToolButton.ToolButtonPopupMode.InstantPopup;
activitiesMenuButton.SetMenu(activitiesMenu);
toolbar.AddWidget(activitiesMenuButton);
m_InviteToMucAction = new QAction(Gui.LoadIcon("internet-group-chat", 16), "Invite to Conference...", this);
QObject.Connect(m_InviteToMucAction, Qt.SIGNAL("triggered()"), HandleInviteToMucActionTriggered);
activitiesMenu.AddAction(m_InviteToMucAction);
activitiesMenu.AddSeparator();
activitiesMenu.AddAction(Gui.LoadIcon("applications-graphics", 16), "Launch Whiteboard...");
activitiesMenu.AddAction(Gui.LoadIcon("desktop", 16), "Share Desktop...");
var spacerWidget = new QWidget(toolbar);
spacerWidget.SetSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed);
toolbar.AddWidget(spacerWidget);
var toContainer = new QWidget(toolbar);
var layout = new QHBoxLayout(toContainer);
layout.SetContentsMargins(0, 0, 4, 0);
m_ToComboBox = new QComboBox(toContainer);
layout.AddWidget(new QLabel("To:", toContainer));
layout.AddWidget(m_ToComboBox);
QAction toWidgetAction = (QWidgetAction)toolbar.AddWidget(toContainer);
m_ToComboBox.AddItem("Automatic", "auto");
m_ToComboBox.InsertSeparator(1);
((QVBoxLayout)bottomContainer.Layout()).InsertWidget(0, toolbar);
if (handler is ChatHandler) {
var chatHandler = (ChatHandler)handler;
handler.Account.Client.OnPresence += delegate(object sender, Presence pres) {
if (pres.From.Bare != chatHandler.Jid.Bare || pres.Priority == "-1") {
return;
}
QApplication.Invoke(delegate {
if (!String.IsNullOrEmpty(pres.From.Resource)) {
if (pres.Type == PresenceType.available) {
string text = String.Format("{0} ({1})", Helper.GetResourceDisplay(pres), Helper.GetPresenceDisplay(pres));
int i = m_ToComboBox.FindData(pres.From.Resource);
if (i == -1) {
m_ToComboBox.AddItem(text, pres.From.Resource);
} else {