From a092a615f5243a68c01e9a9233283f6cccb3b03e Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 9 Jan 2015 15:58:41 +0100 Subject: asyncio doc: fix section of event loop examples --- Doc/library/asyncio-eventloop.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst index 748d4e3..12e60c4 100644 --- a/Doc/library/asyncio-eventloop.rst +++ b/Doc/library/asyncio-eventloop.rst @@ -681,12 +681,12 @@ Handle Event loop examples -=================== +------------------- .. _asyncio-hello-world-callback: Hello World with call_soon() ----------------------------- +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Example using the :meth:`BaseEventLoop.call_soon` method to schedule a callback. The callback displays ``"Hello World"`` and then stops the event @@ -716,7 +716,7 @@ loop:: .. _asyncio-date-callback: Display the current date with call_later() ------------------------------------------- +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Example of callback displaying the current date every second. The callback uses the :meth:`BaseEventLoop.call_later` method to reschedule itself during 5 @@ -752,7 +752,7 @@ seconds, and then stops the event loop:: .. _asyncio-watch-read-event: Watch a file descriptor for read events ---------------------------------------- +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Wait until a file descriptor received some data using the :meth:`BaseEventLoop.add_reader` method and then close the event loop:: @@ -801,7 +801,7 @@ Wait until a file descriptor received some data using the Set signal handlers for SIGINT and SIGTERM ------------------------------------------- +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Register handlers for signals :py:data:`SIGINT` and :py:data:`SIGTERM` using the :meth:`BaseEventLoop.add_signal_handler` method:: -- cgit v0.12 class='tabs'> summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/code/tools_shared_qtpropertybrowser_qtpropertybrowser.cpp
blob: 62f43190016f1452fac227916b970dd935673789 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//! [0]
        QtSpinBoxFactory *factory;
        QSet<QtIntPropertyManager *> managers = factory->propertyManagers();
//! [0]


//! [1]
        QtBrowserItem *item;
        QList<QtBrowserItem *> childrenItems = item->children();

        QList<QtProperty *> childrenProperties = item->property()->subProperties();
//! [1]


//! [2]
        QtProperty *property1, *property2, *property3;

        property2->addSubProperty(property1);
        property3->addSubProperty(property2);

        QtAbstractPropertyBrowser *editor;

        editor->addProperty(property1);
        editor->addProperty(property2);
        editor->addProperty(property3);
//! [2]


//! [3]
        QtIntPropertyManager *intManager;
        QtDoublePropertyManager *doubleManager;

        QtProperty *myInteger = intManager->addProperty();
        QtProperty *myDouble = doubleManager->addProperty();

        QtSpinBoxFactory  *spinBoxFactory;
        QtDoubleSpinBoxFactory *doubleSpinBoxFactory;

        QtAbstractPropertyBrowser *editor;
        editor->setFactoryForManager(intManager, spinBoxFactory);
        editor->setFactoryForManager(doubleManager, doubleSpinBoxFactory);

        editor->addProperty(myInteger);
        editor->addProperty(myDouble);
//! [3]