-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve docstring and add example file
- Loading branch information
1 parent
210c665
commit 2186ddc
Showing
2 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import sys | ||
|
||
from PySide2 import QtWidgets | ||
from PySide2.QtWidgets import QPushButton | ||
|
||
from eqt.ui.NoBorderScrollArea import NoBorderScrollArea | ||
|
||
|
||
class MainUI(QtWidgets.QMainWindow): | ||
def __init__(self, parent=None): | ||
"""Any button added after the `NoBorderScrollArea` is instanced will not be styled as | ||
expected, due to the bug in `qdarkstyle`. The method `apply_qdarkstyle_to_buttons` needs | ||
to be invoked.""" | ||
QtWidgets.QMainWindow.__init__(self, parent) | ||
|
||
layout = QtWidgets.QVBoxLayout() | ||
widg = QtWidgets.QWidget() | ||
widg.setLayout(layout) | ||
|
||
layout.addWidget(QPushButton("Test")) | ||
layout.addWidget(QPushButton("Test2")) | ||
|
||
self.scroll_area_widget = NoBorderScrollArea(widg) | ||
|
||
layout.addWidget(QPushButton("Test3")) | ||
self.scroll_area_widget.apply_qdarkstyle_to_buttons(widg) | ||
layout.addWidget(QPushButton("Test4")) | ||
|
||
self.setCentralWidget(self.scroll_area_widget) | ||
|
||
self.show() | ||
|
||
|
||
if __name__ == "__main__": | ||
app = QtWidgets.QApplication(sys.argv) | ||
|
||
window = MainUI() | ||
|
||
sys.exit(app.exec_()) |