Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. Button {
  2. text: "555-555-5555" //just a sample number - I don't actually use this number
  3. onClicked: Foo.phone(text) //I don't actually use the class name Foo
  4. }
  5.  
  6. class Foo : public QObject {
  7. Q_OBJECT
  8. public:
  9. ...
  10. Q_INVOKABLE void phone(QString number);
  11. }
  12. ...
  13.  
  14. void Foo::phone(QString number) {
  15. bb::system::phone::Phone phone;
  16. phone.requestDialpad(number, bb::system::phone::LineType::Cellular);
  17. }
  18.  
  19. Button {
  20. onClicked: {
  21. _foo.callNumber("555-555-5555")
  22. }
  23. }
  24.  
  25. import bb.cascades 1.0
  26. import bb.system.phone 1.0
  27.  
  28. // Creates one page with a button. When you tap the button,
  29. // a dial pad with a specific phone number is displayed.
  30.  
  31. Page {
  32. Container {
  33. layout: DockLayout {
  34. }
  35. verticalAlignment: VerticalAlignment.Center
  36. horizontalAlignment: HorizontalAlignment.Center
  37.  
  38. Button {
  39. id: callButton
  40. text: "Call me, maybe"
  41.  
  42. onClicked: {
  43. phone.requestDialpad("(519) 555-0100")
  44. }
  45. }
  46. }
  47. attachedObjects: [
  48. Phone {
  49. id: phone
  50. }
  51. ]
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement