本文整理汇总了C#中Qyoto.QObject类的典型用法代码示例。如果您正苦于以下问题:C# QObject类的具体用法?C# QObject怎么用?C# QObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
QObject类属于Qyoto命名空间,在下文中一共展示了QObject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Connect
public static bool Connect(QObject sender, int signal_index, QObject receiver, int method_index, int type, ref int types)
{
StackItem[] stack = new StackItem[7];
#if DEBUG
stack[1].s_class = (IntPtr) DebugGCHandle.Alloc(sender);
#else
stack[1].s_class = (IntPtr) GCHandle.Alloc(sender);
#endif
stack[2].s_int = signal_index;
#if DEBUG
stack[3].s_class = (IntPtr) DebugGCHandle.Alloc(receiver);
#else
stack[3].s_class = (IntPtr) GCHandle.Alloc(receiver);
#endif
stack[4].s_int = method_index;
stack[5].s_int = type;
stack[6].s_int = types;
staticInterceptor.Invoke("connect#$#$$$", "connect(const QObject*, int, const QObject*, int, int, int*)", stack);
#if DEBUG
DebugGCHandle.Free((GCHandle) stack[1].s_class);
#else
((GCHandle) stack[1].s_class).Free();
#endif
#if DEBUG
DebugGCHandle.Free((GCHandle) stack[3].s_class);
#else
((GCHandle) stack[3].s_class).Free();
#endif
types = stack[6].s_int;
return stack[0].s_bool;
}
示例2: EventFilter
public new bool EventFilter(QObject obj, QEvent evnt)
{
var type = evnt.type();
if (type == QEvent.TypeOf.MouseButtonPress) {
var mouseEvent = (QMouseEvent)evnt;
if (mouseEvent.Button() == Qt.MouseButton.LeftButton) {
m_Moving = true;
m_OrigX = mouseEvent.X();
m_OrigY = mouseEvent.Y();
m_ParentWidget.Cursor = new QCursor(Qt.CursorShape.SizeAllCursor);
}
} else if (type == QEvent.TypeOf.MouseMove) {
var mouseEvent = (QMouseEvent)evnt;
if (m_Moving) {
var pos = mouseEvent.GlobalPos();
m_ParentWidget.Move(pos.X() - m_OrigX, pos.Y() - m_OrigY);
}
} else if (type == QEvent.TypeOf.MouseButtonRelease) {
var mouseEvent = (QMouseEvent)evnt;
if (m_Moving && mouseEvent.Button() == Qt.MouseButton.LeftButton) {
m_Moving = false;
m_ParentWidget.Cursor = new QCursor(Qt.CursorShape.ArrowCursor);
}
}
return obj.EventFilter(obj, evnt);
}
示例3: EventFilter
public new bool EventFilter(QObject obj, QEvent evnt)
{
if (evnt.type() == QEvent.TypeOf.KeyPress) {
if (KeyEvent != null) {
if (KeyEvent((QKeyEvent)evnt)) {
return true;
}
}
}
return obj.EventFilter(obj, evnt);
}
示例4: TrayIcon
public TrayIcon(QObject parent)
: base(parent)
{
m_ShowMainWindowAction = new QAction("Show Synapse", this);
m_ShowMainWindowAction.Checkable = true;
QObject.Connect(m_ShowMainWindowAction, Qt.SIGNAL("triggered()"), HandleShowMainWindowActionTriggered);
m_ShowDebugWindowAction = new QAction("Debug Window", this);
m_ShowDebugWindowAction.Checkable = true;
QObject.Connect(m_ShowDebugWindowAction, Qt.SIGNAL("triggered()"), HandleShowDebugWindowActionTriggered);
m_Menu = new QMenu();
m_Menu.AddAction(m_ShowMainWindowAction);
m_Menu.AddAction(m_ShowDebugWindowAction);
m_Menu.AddSeparator();
m_Menu.AddAction(Gui.GlobalActions.NewMessageAction);
m_Menu.AddAction(Gui.GlobalActions.JoinConferenceAction);
m_Menu.AddAction(Gui.GlobalActions.ShowBrowserAction);
m_Menu.AddAction(Gui.GlobalActions.EditProfileAction);
m_Menu.AddAction(Gui.GlobalActions.ChangeStatusAction);
m_Menu.AddSeparator();
m_Menu.AddAction(Gui.GlobalActions.ShowPreferencesAction);
m_Menu.AddSeparator();
m_Menu.AddAction(Gui.GlobalActions.AboutAction);
m_Menu.AddAction(Gui.GlobalActions.SendFeedbackAction);
m_Menu.AddSeparator();
m_Menu.AddAction(Gui.GlobalActions.QuitAction);
QObject.Connect(m_Menu, Qt.SIGNAL("aboutToShow()"), HandleMenuAboutToShow);
QPixmap pixmap = new QPixmap("resource:/octy-22.png");
QIcon icon = new QIcon(pixmap);
m_Icon = new QSystemTrayIcon(icon);
m_Icon.SetContextMenu(m_Menu);
QObject.Connect<QSystemTrayIcon.ActivationReason>(m_Icon, Qt.SIGNAL("activated(QSystemTrayIcon::ActivationReason)"), HandleTrayActivated);
}
示例5: Open
public void Open(QObject receiver, string member)
{
interceptor.Invoke("open#$", "open(QObject*, const char*)", typeof(void), typeof(QObject), receiver, typeof(string), member);
}
示例6: RegisterComponent
/// <remarks>
/// Register a slot to be called when the configuration for the componentData
/// has changed. <code>componentData</code> is the KComponentData object
/// that is passed to KGenericFactory (if it is used). You can query
/// it with KGenericFactory<YourClassName>.ComponentData().
/// componentData.componentName() is also the same name that is put into the
/// .desktop file of the KCMs for the X-KDE-ParentComponents.
/// <param> name="componentData" The KComponentData object
/// </param><param> name="recv" The object that should receive the signal
/// </param><param> name="slot" The slot to be called: "slotName"
/// </param></remarks> <short> Register a slot to be called when the configuration for the componentData has changed.</short>
public static void RegisterComponent(KComponentData componentData, QObject recv, string slot)
{
staticInterceptor.Invoke("registerComponent##$", "registerComponent(const KComponentData&, QObject*, const char*)", typeof(void), typeof(KComponentData), componentData, typeof(QObject), recv, typeof(string), slot);
}
示例7: OrgKdeKLauncherInterface
// QDBusReply<void> autoStart(); >>>> NOT CONVERTED
// QDBusReply<void> autoStart(int arg1); >>>> NOT CONVERTED
// QDBusReply<void> exec_blind(const QString& arg1,const QStringList& arg2,const QStringList& arg3,const QString& arg4); >>>> NOT CONVERTED
// QDBusReply<void> exec_blind(const QString& arg1,const QStringList& arg2); >>>> NOT CONVERTED
// QDBusReply<int> kdeinit_exec(const QString& arg1,const QStringList& arg2,const QStringList& arg3,const QString& arg4,QString& arg5,QString& arg6,int& arg7); >>>> NOT CONVERTED
// QDBusReply<int> kdeinit_exec_wait(const QString& arg1,const QStringList& arg2,const QStringList& arg3,const QString& arg4,QString& arg5,QString& arg6,int& arg7); >>>> NOT CONVERTED
// QDBusReply<void> reparseConfiguration(); >>>> NOT CONVERTED
// QDBusReply<int> requestHoldSlave(const QString& arg1,const QString& arg2); >>>> NOT CONVERTED
// QDBusReply<int> requestSlave(const QString& arg1,const QString& arg2,const QString& arg3,QString& arg4); >>>> NOT CONVERTED
// QDBusReply<void> setLaunchEnv(const QString& arg1,const QString& arg2); >>>> NOT CONVERTED
// QDBusReply<int> start_service_by_desktop_name(const QString& arg1,const QStringList& arg2,const QStringList& arg3,const QString& arg4,bool arg5,QString& arg6,QString& arg7,int& arg8); >>>> NOT CONVERTED
// QDBusReply<int> start_service_by_desktop_path(const QString& arg1,const QStringList& arg2,const QStringList& arg3,const QString& arg4,bool arg5,QString& arg6,QString& arg7,int& arg8); >>>> NOT CONVERTED
// QDBusReply<int> start_service_by_name(const QString& arg1,const QStringList& arg2,const QStringList& arg3,const QString& arg4,bool arg5,QString& arg6,QString& arg7,int& arg8); >>>> NOT CONVERTED
// QDBusReply<void> waitForSlave(int arg1); >>>> NOT CONVERTED
public OrgKdeKLauncherInterface(string service, string path, QDBusConnection connection, QObject parent)
: this((Type) null)
{
CreateProxy();
interceptor.Invoke("OrgKdeKLauncherInterface$$##", "OrgKdeKLauncherInterface(const QString&, const QString&, const QDBusConnection&, QObject*)", typeof(void), typeof(string), service, typeof(string), path, typeof(QDBusConnection), connection, typeof(QObject), parent);
}
示例8: VisualizationIsConnected
/// <remarks>
/// </remarks> <return> true if the visualization is currently connected
/// </return>
/// <short> </short>
public bool VisualizationIsConnected(QObject visualization)
{
return (bool) interceptor.Invoke("visualizationIsConnected#", "visualizationIsConnected(QObject*) const", typeof(bool), typeof(QObject), visualization);
}
示例9: ConnectVisualization
/// <remarks>
/// Connects an object to this DataContainer.
/// May be called repeatedly for the same visualization without
/// side effects
/// <param> name="visualization" the object to connect to this DataContainer
/// </param><param> name="pollingInterval" the time in milliseconds between updates
/// </param><param> name="alignment" the clock position to align updates to
/// </param></remarks> <short> Connects an object to this DataContainer.</short>
public void ConnectVisualization(QObject visualization, uint pollingInterval, Plasma.IntervalAlignment alignment)
{
interceptor.Invoke("connectVisualization#$$", "connectVisualization(QObject*, uint, Plasma::IntervalAlignment)", typeof(void), typeof(QObject), visualization, typeof(uint), pollingInterval, typeof(Plasma.IntervalAlignment), alignment);
}
示例10: Service
/// <remarks>
/// Default constructor
/// @arg parent the parent object for this service
/// </remarks> <short> Default constructor </short>
public Service(QObject parent)
: this((Type) null)
{
CreateProxy();
interceptor.Invoke("Service#", "Service(QObject*)", typeof(void), typeof(QObject), parent);
}
示例11: QsciLexerCSS
public QsciLexerCSS(QObject parent)
: this((Type) null)
{
CreateProxy();
interceptor.Invoke("QsciLexerCSS#", "QsciLexerCSS(QObject*)", typeof(void), typeof(QObject), parent);
}
示例12: DataEngine
/// <remarks>
/// Constructor.
/// <param> name="parent" The parent object.
/// </param><param> name="service" pointer to the service that describes the engine
/// </param></remarks> <short> Constructor.</short>
public DataEngine(QObject parent, KService service)
: this((Type) null)
{
CreateProxy();
interceptor.Invoke("DataEngine#?", "DataEngine(QObject*, KSharedPtr<KService>)", typeof(void), typeof(QObject), parent, typeof(KService), service);
}
示例13: DisconnectSource
/// <remarks>
/// Disconnects a source to an object that was receiving data updates.
/// <param> name="source" the name of the data source
/// </param><param> name="visualization" the object to connect the data source to
/// </param></remarks> <short> Disconnects a source to an object that was receiving data updates.</short>
public void DisconnectSource(string source, QObject visualization)
{
interceptor.Invoke("disconnectSource$#", "disconnectSource(const QString&, QObject*) const", typeof(void), typeof(string), source, typeof(QObject), visualization);
}
示例14: ConnectSource
public void ConnectSource(string source, QObject visualization, uint pollingInterval)
{
interceptor.Invoke("connectSource$#$", "connectSource(const QString&, QObject*, uint) const", typeof(void), typeof(string), source, typeof(QObject), visualization, typeof(uint), pollingInterval);
}
示例15: Load
/// <remarks>
/// Used to load a given service from a plugin.
/// <param> name="name" the plugin name of the service to load
/// </param><param> name="parent" the parent object, if any, for the service
/// </param></remarks> <return> a Service object, guaranteed to be not null.
/// </return>
/// <short> Used to load a given service from a plugin.</short>
public static Plasma.Service Load(string name, QObject parent)
{
return (Plasma.Service) staticInterceptor.Invoke("load$#", "load(const QString&, QObject*)", typeof(Plasma.Service), typeof(string), name, typeof(QObject), parent);
}