Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for QtSignals #401

Merged
merged 2 commits into from
Oct 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions breathe/renderer/sphinxrenderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class DomainDirectiveFactory(object):
'interface': (DoxyCPPClassObject, 'interface'),
'function': (cpp.CPPFunctionObject, 'function'),
'friend': (cpp.CPPFunctionObject, 'function'),
'signal': (cpp.CPPFunctionObject, 'function'),
'slot': (cpp.CPPFunctionObject, 'function'),
'enum': (cpp.CPPTypeObject, 'type'),
'typedef': (cpp.CPPTypeObject, 'type'),
Expand Down Expand Up @@ -547,7 +548,7 @@ def render_signature(file_data, doxygen_target, name, kind):
("public-func", "Public Functions"),
("public-attrib", "Public Members"),
("public-slot", "Public Slots"),
("signal", "Signal"),
("signal", "Signals"),
("dcop-func", "DCOP Function"),
("property", "Property"),
("event", "Event"),
Expand Down Expand Up @@ -798,7 +799,7 @@ def visit_docformula(self, node):
rst_node = self.node_factory.displaymath()

# Or multiline
if latex.startswith("\[") and latex.endswith("\]"):
if latex.startswith("\\[") and latex.endswith("\\]"):
latex = latex[2:-2:]

# Here we steal the core of the mathbase "math" directive handling code from:
Expand Down Expand Up @@ -1236,7 +1237,7 @@ def dispatch_compound(self, node):

def dispatch_memberdef(self, node):
"""Dispatch handling of a memberdef node to a suitable visit method."""
if node.kind in ("function", "slot") or \
if node.kind in ("function", "signal", "slot") or \
(node.kind == 'friend' and node.argsstring):
return self.visit_function(node)
if node.kind == "enum":
Expand Down
18 changes: 9 additions & 9 deletions documentation/source/class.rst
Original file line number Diff line number Diff line change
Expand Up @@ -221,23 +221,23 @@ It produces this output:
:no-link:


Qt Slots Example
----------------
Qt Signals & Slots Example
--------------------------

Doxygen is aware of Qt Slots and so Breathe can pick them up and display them in
the output. They are displayed in appropriate ``Public Slots``, ``Protected
Slots`` and ``Private Slots`` sections.
Doxygen is aware of Qt Signals and Slots and so Breathe can pick them up and
display them in the output. They are displayed in appropriate ``Signals``,
``Public Slots``, ``Protected Slots`` and ``Private Slots`` sections.

.. code-block:: rst

.. doxygenclass:: QtSlotExample
:project: qtslots
.. doxygenclass:: QtSignalSlotExample
:project: qtsignalsandslots
:members:

Produces the following output:

.. doxygenclass:: QtSlotExample
:project: qtslots
.. doxygenclass:: QtSignalSlotExample
:project: qtsignalsandslots
:members:
:no-link:

Expand Down
2 changes: 1 addition & 1 deletion documentation/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
"lists":"../../examples/specific/lists/xml/",
"group":"../../examples/specific/group/xml/",
"union":"../../examples/specific/union/xml/",
"qtslots":"../../examples/specific/qtslots/xml/",
"qtsignalsandslots":"../../examples/specific/qtsignalsandslots/xml/",
"array":"../../examples/specific/array/xml/",
"c_enum":"../../examples/specific/c_enum/xml/",
"c_typedef":"../../examples/specific/c_typedef/xml/",
Expand Down
2 changes: 1 addition & 1 deletion examples/specific/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ HAVE_DOT = /usr/bin/dot

projects = nutshell alias rst inline namespacefile c_file array c_enum inheritance \
members userdefined fixedwidthfont latexmath functionOverload \
image name union group struct struct_function qtslots lists \
image name union group struct struct_function qtsignalsandslots lists \
headings links parameters template_class template_class_non_type \
template_function template_specialisation enum c_typedef define interface

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
PROJECT_NAME = "Qt Slots"
OUTPUT_DIRECTORY = qtslots
PROJECT_NAME = "Qt Signals & Slots"
OUTPUT_DIRECTORY = qtsignalsandslots
GENERATE_LATEX = NO
GENERATE_MAN = NO
GENERATE_RTF = NO
CASE_SENSE_NAMES = NO
INPUT = qtslots.h
INPUT = qtsignalsandslots.h
QUIET = YES
JAVADOC_AUTOBRIEF = YES
GENERATE_HTML = NO
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include

class QtSlotExample: public QObject
class QtSignalSlotExample: public QObject
{
Q_OBJECT

Expand All @@ -15,6 +15,14 @@ class QtSlotExample: public QObject
*/
void workingFunction( int iShownParameter ) { Q_UNUSED( iShownParameter ; ) }

signals:

/*!
*\param iShown
This is in function declaration
*/
void workingSignal( int iShown );

public slots:

/*!
Expand Down