diff --git a/doc/source/conf.py b/doc/source/conf.py index b502ab7..d4192a8 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -32,7 +32,7 @@ "sphinx.ext.autodoc", "sphinx.ext.intersphinx", "sphinx.ext.viewcode", - "sphinx_code_tabs", + "sphinx_tabs.tabs", "numpydoc", ] diff --git a/doc/source/explanation/optional-vs-default.rst b/doc/source/explanation/optional-vs-default.rst index c28c23e..09aa9c9 100644 --- a/doc/source/explanation/optional-vs-default.rst +++ b/doc/source/explanation/optional-vs-default.rst @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/doc/source/user-guide/highlight-widget.rst b/doc/source/user-guide/highlight-widget.rst index 30409f7..f1461dd 100644 --- a/doc/source/user-guide/highlight-widget.rst +++ b/doc/source/user-guide/highlight-widget.rst @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/doc/source/user-guide/model.rst b/doc/source/user-guide/model.rst index f00edaf..5fe6414 100644 --- a/doc/source/user-guide/model.rst +++ b/doc/source/user-guide/model.rst @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/doc/source/user-guide/multi-dcls.rst b/doc/source/user-guide/multi-dcls.rst index 0c5deb2..f5050fb 100644 --- a/doc/source/user-guide/multi-dcls.rst +++ b/doc/source/user-guide/multi-dcls.rst @@ -45,8 +45,7 @@ Then we construct the widget with basic API, and add the dataclass types. .. tabs:: - .. code-tab:: python - :caption: PySide6 + .. code-tab:: python PySide6 from PySide6.QtWidgets import QApplication, QWidget, QVBoxLayout, QPushButton from PySide6.QtCore import Signal @@ -84,8 +83,7 @@ Then we construct the widget with basic API, and add the dataclass types. for dcls in [DataClass1, DataClass2]: myWidget.addDataclass(dcls) - .. code-tab:: python - :caption: PyQt6 + .. code-tab:: python PyQt6 from PyQt6.QtWidgets import QApplication, QWidget, QVBoxLayout, QPushButton from PyQt6.QtCore import pyqtSignal @@ -123,8 +121,7 @@ Then we construct the widget with basic API, and add the dataclass types. for dcls in [DataClass1, DataClass2]: myWidget.addDataclass(dcls) - .. code-tab:: python - :caption: PySide2 + .. code-tab:: python PySide2 from PySide2.QtWidgets import QApplication, QWidget, QVBoxLayout, QPushButton from PySide2.QtCore import Signal @@ -162,8 +159,7 @@ Then we construct the widget with basic API, and add the dataclass types. for dcls in [DataClass1, DataClass2]: myWidget.addDataclass(dcls) - .. code-tab:: python - :caption: PyQt5 + .. code-tab:: python PyQt5 from PyQt5.QtWidgets import QApplication, QWidget, QVBoxLayout, QPushButton from PyQt5.QtCore import pyqtSignal @@ -206,8 +202,7 @@ Now we construct a model with two items, each having different data types. .. tabs:: - .. code-tab:: python - :caption: PySide6 + .. code-tab:: python PySide6 from PySide6.QtGui import QStandardItemModel, QStandardItem from dawiq import DataclassDelegate @@ -218,8 +213,7 @@ Now we construct a model with two items, each having different data types. item.setData(dcls, 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 @@ -230,8 +224,7 @@ Now we construct a model with two items, each having different data types. item.setData(dcls, 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 @@ -242,8 +235,7 @@ Now we construct a model with two items, each having different data types. item.setData(dcls, 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 @@ -274,8 +266,7 @@ Now let's set the data and display the widget. .. tabs:: - .. code-tab:: python - :caption: PySide6 + .. code-tab:: python PySide6 model.setData(model.index(0, 0), dict(x=1.0), delegate.DataRole) model.setData(model.index(1, 0), dict(y=2), delegate.DataRole) @@ -284,8 +275,7 @@ Now let's set the data and display the widget. app.exec() app.quit() - .. code-tab:: python - :caption: PyQt6 + .. code-tab:: python PyQt6 model.setData(model.index(0, 0), dict(x=1.0), delegate.DataRole) model.setData(model.index(1, 0), dict(y=2), delegate.DataRole) @@ -294,8 +284,7 @@ Now let's set the data and display the widget. app.exec() app.quit() - .. code-tab:: python - :caption: PySide2 + .. code-tab:: python PySide2 model.setData(model.index(0, 0), dict(x=1.0), delegate.DataRole) model.setData(model.index(1, 0), dict(y=2), delegate.DataRole) @@ -304,8 +293,7 @@ Now let's set the data and display the widget. app.exec_() app.quit() - .. code-tab:: python - :caption: PyQt5 + .. code-tab:: python PyQt5 model.setData(model.index(0, 0), dict(x=1.0), delegate.DataRole) model.setData(model.index(1, 0), dict(y=2), delegate.DataRole) @@ -335,8 +323,7 @@ Dataclasses are same to :ref:`multi-dcls-basic`, so we go directly to widget con .. tabs:: - .. code-tab:: python - :caption: PySide6 + .. code-tab:: python PySide6 from PySide6.QtWidgets import QApplication, QWidget, QVBoxLayout, QComboBox, QPushButton from PySide6.QtCore import Signal @@ -379,8 +366,7 @@ Dataclasses are same to :ref:`multi-dcls-basic`, so we go directly to widget con for dcls in [DataClass1, DataClass2]: myWidget.addDataclass(dcls) - .. code-tab:: python - :caption: PyQt6 + .. code-tab:: python PyQt6 from PyQt6.QtWidgets import QApplication, QWidget, QVBoxLayout, QComboBox, QPushButton from PyQt6.QtCore import pyqtSignal @@ -423,8 +409,7 @@ Dataclasses are same to :ref:`multi-dcls-basic`, so we go directly to widget con for dcls in [DataClass1, DataClass2]: myWidget.addDataclass(dcls) - .. code-tab:: python - :caption: PySide2 + .. code-tab:: python PySide2 from PySide2.QtWidgets import QApplication, QWidget, QVBoxLayout, QComboBox, QPushButton from PySide2.QtCore import Signal @@ -467,8 +452,7 @@ Dataclasses are same to :ref:`multi-dcls-basic`, so we go directly to widget con for dcls in [DataClass1, DataClass2]: myWidget.addDataclass(dcls) - .. code-tab:: python - :caption: PyQt5 + .. code-tab:: python PyQt5 from PyQt5.QtWidgets import QApplication, QWidget, QVBoxLayout, QComboBox, QPushButton from PyQt5.QtCore import pyqtSignal @@ -539,8 +523,7 @@ Now we construct a model with two items, each having different data types. .. tabs:: - .. code-tab:: python - :caption: PySide6 + .. code-tab:: python PySide6 from PySide6.QtGui import QStandardItemModel, QStandardItem @@ -550,8 +533,7 @@ Now we construct a model with two items, each having different data types. item.setData(dcls, role=delegate.TypeRole) model.appendRow(item) - .. code-tab:: python - :caption: PyQt6 + .. code-tab:: python PyQt6 from PyQt6.QtGui import QStandardItemModel, QStandardItem @@ -561,8 +543,7 @@ Now we construct a model with two items, each having different data types. item.setData(dcls, role=delegate.TypeRole) model.appendRow(item) - .. code-tab:: python - :caption: PySide2 + .. code-tab:: python PySide2 from PySide2.QtGui import QStandardItemModel, QStandardItem @@ -572,8 +553,7 @@ Now we construct a model with two items, each having different data types. item.setData(dcls, role=delegate.TypeRole) model.appendRow(item) - .. code-tab:: python - :caption: PyQt5 + .. code-tab:: python PyQt5 from PyQt5.QtGui import QStandardItemModel, QStandardItem @@ -614,8 +594,7 @@ Now let's set the data and display the widget. .. tabs:: - .. code-tab:: python - :caption: PySide6 + .. code-tab:: python PySide6 model.setData(model.index(0, 0), dict(x=1.0), delegate.DataRole) model.setData(model.index(1, 0), dict(y=2), delegate.DataRole) @@ -624,8 +603,7 @@ Now let's set the data and display the widget. app.exec() app.quit() - .. code-tab:: python - :caption: PyQt6 + .. code-tab:: python PyQt6 model.setData(model.index(0, 0), dict(x=1.0), delegate.DataRole) model.setData(model.index(1, 0), dict(y=2), delegate.DataRole) @@ -634,8 +612,7 @@ Now let's set the data and display the widget. app.exec() app.quit() - .. code-tab:: python - :caption: PySide2 + .. code-tab:: python PySide2 model.setData(model.index(0, 0), dict(x=1.0), delegate.DataRole) model.setData(model.index(1, 0), dict(y=2), delegate.DataRole) @@ -644,8 +621,7 @@ Now let's set the data and display the widget. app.exec_() app.quit() - .. code-tab:: python - :caption: PyQt5 + .. code-tab:: python PyQt5 model.setData(model.index(0, 0), dict(x=1.0), delegate.DataRole) model.setData(model.index(1, 0), dict(y=2), delegate.DataRole) diff --git a/doc/source/user-guide/widget.rst b/doc/source/user-guide/widget.rst index d246838..0c9a938 100644 --- a/doc/source/user-guide/widget.rst +++ b/doc/source/user-guide/widget.rst @@ -30,8 +30,7 @@ We then create a widget and display it. .. tabs:: - .. code-tab:: python - :caption: PySide6 + .. code-tab:: python PySide6 from PySide6.QtWidgets import QApplication from dawiq import dataclass2Widget @@ -43,8 +42,7 @@ We then create a widget and display it. app.exec() app.quit() - .. code-tab:: python - :caption: PyQt6 + .. code-tab:: python PyQt6 from PyQt6.QtWidgets import QApplication from dawiq import dataclass2Widget @@ -56,8 +54,7 @@ We then create a widget and display it. app.exec() app.quit() - .. code-tab:: python - :caption: PySide2 + .. code-tab:: python PySide2 from PySide2.QtWidgets import QApplication from dawiq import dataclass2Widget @@ -69,8 +66,7 @@ We then create a widget and display it. app.exec_() app.quit() - .. code-tab:: python - :caption: PyQt5 + .. code-tab:: python PyQt5 from PyQt5.QtWidgets import QApplication from dawiq import dataclass2Widget diff --git a/pyproject.toml b/pyproject.toml index 973176d..8ec0132 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,8 +48,8 @@ test-ci = [ ] doc = [ "numpydoc", - "sphinx < 5.2", - "sphinx_code_tabs", + "sphinx", + "sphinx-tabs", "sphinx_rtd_theme", ] full = ["dawiq[test,doc]"]