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

Sphinx tabs #65

Merged
merged 3 commits into from
Sep 10, 2023
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
2 changes: 1 addition & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.viewcode",
"sphinx_code_tabs",
"sphinx_tabs.tabs",
"numpydoc",
]

Expand Down
12 changes: 4 additions & 8 deletions doc/source/explanation/optional-vs-default.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ How will the data widget from ``DataClass`` be?

.. tabs::

.. code-tab:: python
:caption: PySide6
.. code-tab:: python PySide6

from PySide6.QtGui import QStandardItemModel, QStandardItem
from PySide6.QtWidgets import QApplication
Expand Down Expand Up @@ -91,8 +90,7 @@ How will the data widget from ``DataClass`` be?
app.exec()
app.quit()

.. code-tab:: python
:caption: PyQt6
.. code-tab:: python PyQt6

from PyQt6.QtGui import QStandardItemModel, QStandardItem
from PyQt6.QtWidgets import QApplication
Expand Down Expand Up @@ -120,8 +118,7 @@ How will the data widget from ``DataClass`` be?
app.exec()
app.quit()

.. code-tab:: python
:caption: PySide2
.. code-tab:: python PySide2

from PySide2.QtGui import QStandardItemModel, QStandardItem
from PySide2.QtWidgets import QApplication
Expand Down Expand Up @@ -149,8 +146,7 @@ How will the data widget from ``DataClass`` be?
app.exec_()
app.quit()

.. code-tab:: python
:caption: PyQt5
.. code-tab:: python PyQt5

from PyQt5.QtGui import QStandardItemModel, QStandardItem
from PyQt5.QtWidgets import QApplication
Expand Down
24 changes: 8 additions & 16 deletions doc/source/user-guide/highlight-widget.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ We construct a simple model with one item.

.. tabs::

.. code-tab:: python
:caption: PySide6
.. code-tab:: python PySide6

from PySide6.QtGui import QStandardItemModel, QStandardItem
from dawiq import DataclassDelegate
Expand All @@ -39,8 +38,7 @@ We construct a simple model with one item.
item.setData(DataClass, role=DataclassDelegate.TypeRole)
model.appendRow(item)

.. code-tab:: python
:caption: PyQt6
.. code-tab:: python PyQt6

from PyQt6.QtGui import QStandardItemModel, QStandardItem
from dawiq import DataclassDelegate
Expand All @@ -50,8 +48,7 @@ We construct a simple model with one item.
item.setData(DataClass, role=DataclassDelegate.TypeRole)
model.appendRow(item)

.. code-tab:: python
:caption: PySide2
.. code-tab:: python PySide2

from PySide2.QtGui import QStandardItemModel, QStandardItem
from dawiq import DataclassDelegate
Expand All @@ -61,8 +58,7 @@ We construct a simple model with one item.
item.setData(DataClass, role=DataclassDelegate.TypeRole)
model.appendRow(item)

.. code-tab:: python
:caption: PyQt5
.. code-tab:: python PyQt5

from PyQt5.QtGui import QStandardItemModel, QStandardItem
from dawiq import DataclassDelegate
Expand All @@ -88,8 +84,7 @@ Before running the application, we set the style sheet to :class:`QApplication`.

.. tabs::

.. code-tab:: python
:caption: PySide6
.. code-tab:: python PySide6

from PySide6.QtWidgets import QApplication
from dawiq import dataclass2Widget
Expand All @@ -106,8 +101,7 @@ Before running the application, we set the style sheet to :class:`QApplication`.
app.exec()
app.quit()

.. code-tab:: python
:caption: PyQt6
.. code-tab:: python PyQt6

from PyQt6.QtWidgets import QApplication
from dawiq import dataclass2Widget
Expand All @@ -124,8 +118,7 @@ Before running the application, we set the style sheet to :class:`QApplication`.
app.exec()
app.quit()

.. code-tab:: python
:caption: PySide2
.. code-tab:: python PySide2

from PySide2.QtWidgets import QApplication
from dawiq import dataclass2Widget
Expand All @@ -142,8 +135,7 @@ Before running the application, we set the style sheet to :class:`QApplication`.
app.exec_()
app.quit()

.. code-tab:: python
:caption: PyQt5
.. code-tab:: python PyQt5

from PyQt5.QtWidgets import QApplication
from dawiq import dataclass2Widget
Expand Down
24 changes: 8 additions & 16 deletions doc/source/user-guide/model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ Then we construct a model with two items, each storing the dataclass type which

.. tabs::

.. code-tab:: python
:caption: PySide6
.. code-tab:: python PySide6

from PySide6.QtGui import QStandardItemModel, QStandardItem
from dawiq import DataclassDelegate
Expand All @@ -53,8 +52,7 @@ Then we construct a model with two items, each storing the dataclass type which
item.setData(DataClass, role=DataclassDelegate.TypeRole)
model.appendRow(item)

.. code-tab:: python
:caption: PyQt6
.. code-tab:: python PyQt6

from PyQt6.QtGui import QStandardItemModel, QStandardItem
from dawiq import DataclassDelegate
Expand All @@ -65,8 +63,7 @@ Then we construct a model with two items, each storing the dataclass type which
item.setData(DataClass, role=DataclassDelegate.TypeRole)
model.appendRow(item)

.. code-tab:: python
:caption: PySide2
.. code-tab:: python PySide2

from PySide2.QtGui import QStandardItemModel, QStandardItem
from dawiq import DataclassDelegate
Expand All @@ -77,8 +74,7 @@ Then we construct a model with two items, each storing the dataclass type which
item.setData(DataClass, role=DataclassDelegate.TypeRole)
model.appendRow(item)

.. code-tab:: python
:caption: PyQt5
.. code-tab:: python PyQt5

from PyQt5.QtGui import QStandardItemModel, QStandardItem
from dawiq import DataclassDelegate
Expand Down Expand Up @@ -108,8 +104,7 @@ The widget consists of:

.. tabs::

.. code-tab:: python
:caption: PySide6
.. code-tab:: python PySide6

from PySide6.QtWidgets import QApplication, QWidget, QVBoxLayout, QPushButton
from dawiq import dataclass2Widget
Expand All @@ -136,8 +131,7 @@ The widget consists of:
app.exec()
app.quit()

.. code-tab:: python
:caption: PyQt6
.. code-tab:: python PyQt6

from PyQt6.QtWidgets import QApplication, QWidget, QVBoxLayout, QPushButton
from dawiq import dataclass2Widget
Expand All @@ -164,8 +158,7 @@ The widget consists of:
app.exec()
app.quit()

.. code-tab:: python
:caption: PySide2
.. code-tab:: python PySide2

from PySide2.QtWidgets import QApplication, QWidget, QVBoxLayout, QPushButton
from dawiq import dataclass2Widget
Expand All @@ -192,8 +185,7 @@ The widget consists of:
app.exec_()
app.quit()

.. code-tab:: python
:caption: PyQt5
.. code-tab:: python PyQt5

from PyQt5.QtWidgets import QApplication, QWidget, QVBoxLayout, QPushButton
from dawiq import dataclass2Widget
Expand Down
Loading
Loading