Skip to content

Commit 30853bb

Browse files
committed
Doc: reorganized API reference (splitted in multiple pages)
1 parent 7fedcfd commit 30853bb

File tree

6 files changed

+55
-7
lines changed

6 files changed

+55
-7
lines changed

doc/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@
9393
# A list of ignored prefixes for module index sorting.
9494
modindex_common_prefix = ['qwt.']
9595

96+
autodoc_member_order = 'bysource'
97+
9698

9799
# -- Options for HTML output ---------------------------------------------------
98100

doc/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Contents:
88

99
overview
1010
installation
11-
reference
11+
reference/index
1212

1313

1414
Indices and tables:

doc/reference.rst

Lines changed: 0 additions & 6 deletions
This file was deleted.

doc/reference/color_map.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.. automodule:: qwt.color_map
2+
:members:

doc/reference/index.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Reference
2+
=========
3+
4+
python-qwt API:
5+
6+
.. toctree::
7+
:maxdepth: 2
8+
9+
color_map

qwt/color_map.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,23 @@
55
# Copyright (c) 2015 Pierre Raybaut, for the Python translation/optimization
66
# (see LICENSE file for more details)
77

8+
"""
9+
qwt.color_map
10+
-------------
11+
12+
The `color_map` module provides the `QwtColorMap` base class and derived
13+
classes.
14+
15+
.. autoclass:: QwtColorMap
16+
:members:
17+
18+
.. autoclass:: QwtLinearColorMap
19+
:members:
20+
21+
.. autoclass:: QwtAlphaColorMap
22+
:members:
23+
"""
24+
825
from qwt.qt.QtGui import QColor, qRed, qGreen, qBlue, qRgb, qRgba, qAlpha
926
from qwt.qt.QtCore import Qt, qIsNaN
1027

@@ -306,17 +323,41 @@ def __init__(self):
306323
self.rgbMax = None
307324

308325
class QwtAlphaColorMap(QwtColorMap):
326+
"""
327+
QwtAlphaColorMap varies the alpha value of a color
328+
329+
.. py:class:: QwtAlphaColorMap(color)
330+
331+
Build a color map varying the alpha value of a color.
332+
333+
:param QColor color: color of the map
334+
"""
335+
309336
def __init__(self, color):
310337
super(QwtAlphaColorMap, self).__init__(QwtColorMap.RGB)
311338
self.__data = QwtAlphaColorMap_PrivateData()
312339
self.setColor(color)
313340

314341
def setColor(self, color):
342+
"""
343+
.. py:method:: setColor(color)
344+
345+
Set the color of the map
346+
347+
:param QColor color: color of the map
348+
"""
315349
self.__data.color = color
316350
self.__data.rgb = color.rgb() & qRgba(255, 255, 255, 0)
317351
self.__data.rgbMax = self.__data.rgb | ( 255 << 24 )
318352

319353
def color(self):
354+
"""
355+
Return the color of the map
356+
357+
.. seealso ::
358+
359+
:py:meth:`QwtAlphaColorMap.setColor`
360+
"""
320361
return self.__data.color()
321362

322363
def rgb(self, interval, value):

0 commit comments

Comments
 (0)