Skip to content

Commit

Permalink
qtcollider: implement QtGUI:*cursorPosition
Browse files Browse the repository at this point in the history
  • Loading branch information
jleben committed Feb 14, 2013
1 parent 1f42acc commit b3a2f64
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions QtCollider/primitives/prim_misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include <QDesktopWidget>
#include <QStyleFactory>
#include <QWebSettings>
#include <QCursor>

namespace QtCollider {

Expand Down Expand Up @@ -266,6 +267,14 @@ QC_LANG_PRIMITIVE( Qt_IsMethodOverridden, 2, PyrSlot *r, PyrSlot *a, VMGlobals *
return errNone;
}

QC_LANG_PRIMITIVE( Qt_CursorPosition, 0, PyrSlot *r, PyrSlot *a, VMGlobals *g )
{
if( !QcApplication::compareThread() ) return QtCollider::wrongThreadError();

Slot::setPoint(r, QCursor::pos());
return errNone;
}

void defineMiscPrimitives()
{
LangPrimitiveDefiner definer;
Expand All @@ -284,6 +293,7 @@ void defineMiscPrimitives()
definer.define<Qt_AvailableStyles>();
definer.define<Qt_IsMethodOverridden>();
definer.define<QWebView_ClearMemoryCaches>();
definer.define<Qt_CursorPosition>();
}

} // namespace QtCollider
2 changes: 2 additions & 0 deletions SCClassLibrary/QtCollider/QtGUI.sc
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ QtGUI {

//////////////////////////////////////////////////////////////////////

*cursorPosition { _Qt_CursorPosition }

*availableStyles {
_Qt_AvailableStyles
^this.primitiveFailed;
Expand Down

0 comments on commit b3a2f64

Please sign in to comment.