Skip to content

Commit

Permalink
Update documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
YeisonCardona committed May 15, 2022
1 parent 3be8ad8 commit e28e801
Show file tree
Hide file tree
Showing 7 changed files with 193 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Expand Up @@ -377,3 +377,17 @@ apply_stylesheet(app, 'default', invert_secondary=False, extra=extra)
```

![dock](https://github.com/UN-GCPDS/qt-material/raw/master/docs/source/notebooks/_images/density/density.gif)

## Troubleshoots

### QMenu

`QMenu` has multiple rendering for each Qt backend, and for each operating system. Even can be related with the style, like [fusion](https://doc.qt.io/qt-5/qtquickcontrols2-fusion.html). Then, the `extra` argument also supports`QMenu` parameters to configure this widgest for specific combinations.


```python
extra['QMenu'] = {
'height': 50,
'padding': '50px 50px 50px 50px', # top, right, bottom, left
}
```
28 changes: 28 additions & 0 deletions docs/source/notebooks/readme.ipynb
Expand Up @@ -618,6 +618,34 @@
"source": [
"![dock](_images/density/density.gif)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Troubleshoots"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### QMenu\n",
"\n",
"`QMenu` has multiple rendering for each Qt backend, and for each operating system. Even can be related with the style, like [fusion](https://doc.qt.io/qt-5/qtquickcontrols2-fusion.html). Then, the `extra` argument also supports`QMenu` parameters to configure this widgest for specific combinations. "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"extra['QMenu'] = {\n",
" 'height': 50,\n",
" 'padding': '50px 50px 50px 50px', # top, right, bottom, left\n",
"}"
]
}
],
"metadata": {
Expand Down
19 changes: 19 additions & 0 deletions docs/source/notebooks/readme.rst
Expand Up @@ -445,3 +445,22 @@ scale**, by default is ``0``.
:alt: dock

dock

Troubleshoots
-------------

QMenu
~~~~~

``QMenu`` has multiple rendering for each Qt backend, and for each
operating system. Even can be related with the style, like
`fusion <https://doc.qt.io/qt-5/qtquickcontrols2-fusion.html>`__. Then,
the ``extra`` argument also supports\ ``QMenu`` parameters to configure
this widgest for specific combinations.

.. code:: ipython3
extra['QMenu'] = {
'height': 50,
'padding': '50px 50px 50px 50px', # top, right, bottom, left
}
4 changes: 4 additions & 0 deletions examples/full_features/main.py
Expand Up @@ -64,6 +64,10 @@
'button_shape': 'default',
}

extra['QMenu'] = {
'height': 50,
'padding': '50px 50px 50px 50px', # top, right, bottom, left
}

########################################################################
class RuntimeStylesheets(QMainWindow, QtStyleTools):
Expand Down
Binary file added examples/ui/example.zip
Binary file not shown.
23 changes: 23 additions & 0 deletions examples/ui/show_ui.py
@@ -0,0 +1,23 @@
from PySide6.QtWidgets import QApplication, QMainWindow
from PySide6.QtUiTools import QUiLoader
from qt_material import apply_stylesheet


########################################################################
class ShowUI(QMainWindow):
# ----------------------------------------------------------------------
def __init__(self):
""""""
super().__init__()
self.main = QUiLoader().load('window.ui', self)


if __name__ == "__main__":
app = QApplication()

apply_stylesheet(app, theme='dark_cyan.xml')

frame = ShowUI()
frame.main.show()

app.exec_()
105 changes: 105 additions & 0 deletions examples/ui/window.ui
@@ -0,0 +1,105 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>532</width>
<height>544</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QGridLayout" name="gridLayout">
<item row="3" column="0">
<widget class="QLineEdit" name="lineEdit"/>
</item>
<item row="3" column="1">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="0" colspan="2">
<widget class="QTextEdit" name="textEdit"/>
</item>
<item row="0" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="pushButton">
<property name="text">
<string>PushButton</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_2">
<property name="text">
<string>PushButton</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="1" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QCheckBox" name="checkBox">
<property name="text">
<string>CheckBox</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_2">
<property name="text">
<string>CheckBox</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QStatusBar" name="statusbar"/>
</widget>
<resources/>
<connections/>
</ui>

0 comments on commit e28e801

Please sign in to comment.