mirror of
https://github.com/bytedream/PyQt5-expansion.git
synced 2025-05-09 12:15:11 +02:00
Name changes
This commit is contained in:
parent
1e78728291
commit
7cae8d2ae5
42
README.md
42
README.md
@ -19,13 +19,13 @@ NOTE: Not every emoji looks "nice" in PyQt5 so you may have to install a custom
|
|||||||
</details>
|
</details>
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from PyQt5 import QtWidgets # import pyqt5
|
from PyQt5 import QtWidgets # import pyqt5
|
||||||
from QOptionObjects import QEmojiPicker # import the emoji picker
|
from QCustomObjects import QEmojiPicker # import the emoji picker
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
# create a new app
|
# create a new app
|
||||||
app = QtWidgets.QApplication([])
|
app = QtWidgets.QApplication([])
|
||||||
|
|
||||||
# initializes the emoji picker
|
# initializes the emoji picker
|
||||||
emoji_picker = QEmojiPicker(
|
emoji_picker = QEmojiPicker(
|
||||||
# this option can say how many emojis are in a row
|
# this option can say how many emojis are in a row
|
||||||
@ -49,21 +49,21 @@ A hydrodynamic layout which rearranges the items in it dynamically if its resize
|
|||||||
</details>
|
</details>
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from PyQt5 import QtWidgets # import pyqt5
|
from PyQt5 import QtWidgets # import pyqt5
|
||||||
from QOptionObjects import QFlowLayout # import the flow layout
|
from QCustomObjects import QFlowLayout # import the flow layout
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
# create a new app
|
# create a new app
|
||||||
app = QtWidgets.QApplication([])
|
app = QtWidgets.QApplication([])
|
||||||
widget = QtWidgets.QWidget()
|
widget = QtWidgets.QWidget()
|
||||||
|
|
||||||
# initializes the layout
|
# initializes the layout
|
||||||
layout = QFlowLayout()
|
layout = QFlowLayout()
|
||||||
|
|
||||||
# add 100 labels to see its resize function
|
# add 100 labels to see its resize function
|
||||||
for i in range(100):
|
for i in range(100):
|
||||||
layout.addWidget(QtWidgets.QLabel(f'Text {i}'))
|
layout.addWidget(QtWidgets.QLabel(f'Text {i}'))
|
||||||
|
|
||||||
# set the layout to the widget and show it
|
# set the layout to the widget and show it
|
||||||
widget.setLayout(layout)
|
widget.setLayout(layout)
|
||||||
widget.show()
|
widget.show()
|
||||||
@ -82,21 +82,21 @@ A simple toggle switch
|
|||||||
</details>
|
</details>
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from PyQt5 import QtWidgets # import pyqt5
|
from PyQt5 import QtWidgets # import pyqt5
|
||||||
from QOptionObjects import QSwitch # import the switch
|
from QCustomObjects import QSwitch # import the switch
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
# create a new app
|
# create a new app
|
||||||
app = QtWidgets.QApplication([])
|
app = QtWidgets.QApplication([])
|
||||||
widget = QtWidgets.QWidget()
|
widget = QtWidgets.QWidget()
|
||||||
layout = QtWidgets.QHBoxLayout()
|
layout = QtWidgets.QHBoxLayout()
|
||||||
|
|
||||||
# initializes the switch
|
# initializes the switch
|
||||||
switch = QSwitch()
|
switch = QSwitch()
|
||||||
|
|
||||||
# add the switch to the layout
|
# add the switch to the layout
|
||||||
layout.addWidget(switch)
|
layout.addWidget(switch)
|
||||||
|
|
||||||
# set the layout to the widget and show it
|
# set the layout to the widget and show it
|
||||||
widget.setLayout(layout)
|
widget.setLayout(layout)
|
||||||
widget.show()
|
widget.show()
|
||||||
@ -114,8 +114,8 @@ A widget where you can create, delete and edit tags
|
|||||||
</details>
|
</details>
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from PyQt5 import QtWidgets # import pyqt5
|
from PyQt5 import QtWidgets # import pyqt5
|
||||||
from QOptionObjects import QTagEdit # import the tag edit
|
from QCustomObjects import QTagEdit # import the tag edit
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
# create a new app
|
# create a new app
|
||||||
@ -130,26 +130,26 @@ if __name__ == '__main__':
|
|||||||
tag_edit.addTag('a tag')
|
tag_edit.addTag('a tag')
|
||||||
# manually remove a tag
|
# manually remove a tag
|
||||||
tag_edit.removeTag('a tag')
|
tag_edit.removeTag('a tag')
|
||||||
|
|
||||||
# clear all tags
|
# clear all tags
|
||||||
tag_edit.clear()
|
tag_edit.clear()
|
||||||
# clear all tags and add the given tag after this operation
|
# clear all tags and add the given tag after this operation
|
||||||
tag_edit.setTags(['a tag', 'another tag'])
|
tag_edit.setTags(['a tag', 'another tag'])
|
||||||
|
|
||||||
# sets the tag suggestions you can also define when initializing the class
|
# sets the tag suggestions you can also define when initializing the class
|
||||||
tag_edit.setTagSuggestions(['1 tag', '2 tag', '3 tag'])
|
tag_edit.setTagSuggestions(['1 tag', '2 tag', '3 tag'])
|
||||||
|
|
||||||
# if True, the user will be unable to define a tag with the same name twice
|
# if True, the user will be unable to define a tag with the same name twice
|
||||||
tag_edit.enableCheckForDoubles(True)
|
tag_edit.enableCheckForDoubles(True)
|
||||||
# if True, the tag suggestions will e shown
|
# if True, the tag suggestions will e shown
|
||||||
tag_edit.enableTagSuggestions(True)
|
tag_edit.enableTagSuggestions(True)
|
||||||
|
|
||||||
# print all tags
|
# print all tags
|
||||||
print(tag_edit.tags())
|
print(tag_edit.tags())
|
||||||
|
|
||||||
# show the tag edit
|
# show the tag edit
|
||||||
tag_edit.show()
|
tag_edit.show()
|
||||||
|
|
||||||
app.exec()
|
app.exec()
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user