diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/charts/chartthemes/main.py | 81 | ||||
-rw-r--r-- | examples/examples.pyproject | 105 | ||||
-rw-r--r-- | examples/examples.pyqtc | 103 | ||||
-rw-r--r-- | examples/webenginewidgets/tabbedbrowser/tabbedbrowser.pyproject | 5 | ||||
-rw-r--r-- | examples/webenginewidgets/tabbedbrowser/tabbedbrowser.pyqtc | 7 | ||||
-rw-r--r-- | examples/widgets/tutorials/addressbook/part2.py | 1 | ||||
-rw-r--r-- | examples/widgets/tutorials/addressbook/part3.py | 1 | ||||
-rw-r--r-- | examples/widgets/tutorials/addressbook/part4.py | 1 | ||||
-rw-r--r-- | examples/widgets/tutorials/addressbook/part5.py | 1 | ||||
-rw-r--r-- | examples/widgets/tutorials/addressbook/part6.py | 1 | ||||
-rw-r--r-- | examples/widgets/tutorials/addressbook/part7.py | 1 |
11 files changed, 158 insertions, 149 deletions
diff --git a/examples/charts/chartthemes/main.py b/examples/charts/chartthemes/main.py index 263259716..1ba725b7d 100644 --- a/examples/charts/chartthemes/main.py +++ b/examples/charts/chartthemes/main.py @@ -130,25 +130,23 @@ class ThemeWidget(QWidget): def populate_themebox(self): theme = self.ui.themeComboBox - qchart = QtCharts.QChart - theme.addItem("Light", qchart.ChartThemeLight) - theme.addItem("Blue Cerulean", qchart.ChartThemeBlueCerulean) - theme.addItem("Dark", qchart.ChartThemeDark) - theme.addItem("Brown Sand", qchart.ChartThemeBrownSand) - theme.addItem("Blue NCS", qchart.ChartThemeBlueNcs) - theme.addItem("High Contrast", qchart.ChartThemeHighContrast) - theme.addItem("Blue Icy", qchart.ChartThemeBlueIcy) - theme.addItem("Qt", qchart.ChartThemeQt) + theme.addItem("Light", QtCharts.QChart.ChartThemeLight) + theme.addItem("Blue Cerulean", QtCharts.QChart.ChartThemeBlueCerulean) + theme.addItem("Dark", QtCharts.QChart.ChartThemeDark) + theme.addItem("Brown Sand", QtCharts.QChart.ChartThemeBrownSand) + theme.addItem("Blue NCS", QtCharts.QChart.ChartThemeBlueNcs) + theme.addItem("High Contrast", QtCharts.QChart.ChartThemeHighContrast) + theme.addItem("Blue Icy", QtCharts.QChart.ChartThemeBlueIcy) + theme.addItem("Qt", QtCharts.QChart.ChartThemeQt) def populate_animationbox(self): animated = self.ui.animatedComboBox - qchart = QtCharts.QChart - animated.addItem("No Animations", qchart.NoAnimation) - animated.addItem("GridAxis Animations", qchart.GridAxisAnimations) - animated.addItem("Series Animations", qchart.SeriesAnimations) - animated.addItem("All Animations", qchart.AllAnimations) + animated.addItem("No Animations", QtCharts.QChart.NoAnimation) + animated.addItem("GridAxis Animations", QtCharts.QChart.GridAxisAnimations) + animated.addItem("Series Animations", QtCharts.QChart.SeriesAnimations) + animated.addItem("All Animations", QtCharts.QChart.AllAnimations) def populate_legendbox(self): legend = self.ui.legendComboBox @@ -294,47 +292,46 @@ class ThemeWidget(QWidget): idx = self.ui.themeComboBox.currentIndex() theme = self.ui.themeComboBox.itemData(idx) - qchart = QtCharts.QChart if len(self.charts): chart_theme = self.charts[0].chart().theme() if chart_theme != theme: for chart_view in self.charts: if theme == 0: - theme_name = qchart.ChartThemeLight + theme_name = QtCharts.QChart.ChartThemeLight elif theme == 1: - theme_name = qchart.ChartThemeBlueCerulean + theme_name = QtCharts.QChart.ChartThemeBlueCerulean elif theme == 2: - theme_name = qchart.ChartThemeDark + theme_name = QtCharts.QChart.ChartThemeDark elif theme == 3: - theme_name = qchart.ChartThemeBrownSand + theme_name = QtCharts.QChart.ChartThemeBrownSand elif theme == 4: - theme_name = qchart.ChartThemeBlueNcs + theme_name = QtCharts.QChart.ChartThemeBlueNcs elif theme == 5: - theme_name = qchart.ChartThemeHighContrast + theme_name = QtCharts.QChart.ChartThemeHighContrast elif theme == 6: - theme_name = qchart.ChartThemeBlueIcy + theme_name = QtCharts.QChart.ChartThemeBlueIcy elif theme == 7: - theme_name = qchart.ChartThemeQt + theme_name = QtCharts.QChart.ChartThemeQt else: - theme_name = qchart.ChartThemeLight + theme_name = QtCharts.QChart.ChartThemeLight chart_view.chart().setTheme(theme_name) # Set palette colors based on selected theme - if theme == qchart.ChartThemeLight: + if theme == QtCharts.QChart.ChartThemeLight: set_colors(QColor(0xf0f0f0), QColor(0x404044)) - elif theme == qchart.ChartThemeDark: + elif theme == QtCharts.QChart.ChartThemeDark: set_colors(QColor(0x121218), QColor(0xd6d6d6)) - elif theme == qchart.ChartThemeBlueCerulean: + elif theme == QtCharts.QChart.ChartThemeBlueCerulean: set_colors(QColor(0x40434a), QColor(0xd6d6d6)) - elif theme == qchart.ChartThemeBrownSand: + elif theme == QtCharts.QChart.ChartThemeBrownSand: set_colors(QColor(0x9e8965), QColor(0x404044)) - elif theme == qchart.ChartThemeBlueNcs: + elif theme == QtCharts.QChart.ChartThemeBlueNcs: set_colors(QColor(0x018bba), QColor(0x404044)) - elif theme == qchart.ChartThemeHighContrast: + elif theme == QtCharts.QChart.ChartThemeHighContrast: set_colors(QColor(0xffab03), QColor(0x181818)) - elif theme == qchart.ChartThemeBlueIcy: + elif theme == QtCharts.QChart.ChartThemeBlueIcy: set_colors(QColor(0xcee7f0), QColor(0x404044)) else: set_colors(QColor(0xf0f0f0), QColor(0x404044)) @@ -354,7 +351,16 @@ class ThemeWidget(QWidget): animation_options = chart.animationOptions() if animation_options != options: for chart_view in self.charts: - chart_view.chart().setAnimationOptions(options) + options_name = QtCharts.QChart.NoAnimation + if options == 0: + options_name = QtCharts.QChart.NoAnimation + elif options == 1: + options_name = QtCharts.QChart.GridAxisAnimations + elif options == 2: + options_name = QtCharts.QChart.SeriesAnimations + elif options == 3: + options_name = QtCharts.QChart.AllAnimations + chart_view.chart().setAnimationOptions(options_name) # Update legend alignment idx = self.ui.legendComboBox.currentIndex() @@ -365,7 +371,16 @@ class ThemeWidget(QWidget): chart_view.chart().legend().hide() else: for chart_view in self.charts: - chart_view.chart().legend().setAlignment(alignment) + alignment_name = Qt.AlignTop + if alignment == 32: + alignment_name = Qt.AlignTop + elif alignment == 64: + alignment_name = Qt.AlignBottom + elif alignment == 1: + alignment_name = Qt.AlignLeft + elif alignment == 2: + alignment_name = Qt.AlignRight + chart_view.chart().legend().setAlignment(alignment_name) chart_view.chart().legend().show() diff --git a/examples/examples.pyproject b/examples/examples.pyproject new file mode 100644 index 000000000..5c96e9978 --- /dev/null +++ b/examples/examples.pyproject @@ -0,0 +1,105 @@ +{ + "files": ["charts/memoryusage.py", + "corelib/threads/mandelbrot.py", + "corelib/tools/codecs/codecs.py", + "corelib/tools/regexp.py", + "corelib/tools/settingseditor/settingseditor.py", + "declarative/extending/chapter1-basics/basics.py", + "declarative/extending/chapter2-methods/methods.py", + "declarative/extending/chapter3-bindings/bindings.py", + "declarative/extending/chapter4-customPropertyTypes/customPropertyTypes.py", + "declarative/extending/chapter5-listproperties/listproperties.py", + "declarative/scrolling.py", + "declarative/signals/pytoqml1/main.py", + "declarative/signals/qmltopy1/main.py", + "declarative/signals/qmltopy2/main.py", + "declarative/signals/qmltopy3/main.py", + "declarative/signals/qmltopy4/main.py", + "declarative/usingmodel.py", + "macextras/macpasteboardmime.py", + "multimedia/audiooutput.py", + "multimedia/camera.py", + "multimedia/player.py", + "network/blockingfortuneclient.py", + "network/fortuneclient.py", + "network/fortuneserver.py", + "network/threadedfortuneserver.py", + "opengl/2dpainting.py", + "opengl/grabber.py", + "opengl/hellogl.py", + "opengl/overpainting.py", + "opengl/samplebuffers.py", + "opengl/textures/textures.py", + "script/helloscript.py", + "texttospeech/texttospeech.py", + "tutorial/t1.py", + "tutorial/t10.py", + "tutorial/t11.py", + "tutorial/t12.py", + "tutorial/t13.py", + "tutorial/t14.py", + "tutorial/t2.py", + "tutorial/t3.py", + "tutorial/t4.py", + "tutorial/t5.py", + "tutorial/t6.py", + "tutorial/t7.py", + "tutorial/t8.py", + "tutorial/t9.py", + "webenginewidgets/simplebrowser.py", + "widgets/animation/animatedtiles/animatedtiles.py", + "widgets/animation/appchooser/appchooser.py", + "widgets/animation/easing/easing.py", + "widgets/animation/states/states.py", + "widgets/dialogs/classwizard/classwizard.py", + "widgets/dialogs/extension.py", + "widgets/dialogs/findfiles.py", + "widgets/dialogs/standarddialogs.py", + "widgets/dialogs/trivialwizard.py", + "widgets/draganddrop/draggabletext/draggabletext.py", + "widgets/effects/lighting.py", + "widgets/graphicsview/anchorlayout.py", + "widgets/graphicsview/collidingmice/collidingmice.py", + "widgets/graphicsview/diagramscene/diagramscene.py", + "widgets/graphicsview/dragdroprobot/dragdroprobot.py", + "widgets/graphicsview/elasticnodes.py", + "widgets/itemviews/addressbook/adddialogwidget.py", + "widgets/itemviews/addressbook/addressbook.py", + "widgets/itemviews/addressbook/addresswidget.py", + "widgets/itemviews/addressbook/newaddresstab.py", + "widgets/itemviews/addressbook/tablemodel.py", + "widgets/itemviews/basicsortfiltermodel.py", + "widgets/itemviews/fetchmore.py", + "widgets/itemviews/stardelegate/stardelegate.py", + "widgets/itemviews/stardelegate/stareditor.py", + "widgets/itemviews/stardelegate/starrating.py", + "widgets/layouts/basiclayouts.py", + "widgets/layouts/dynamiclayouts.py", + "widgets/layouts/flowlayout.py", + "widgets/mainwindows/application/application.py", + "widgets/mainwindows/dockwidgets/dockwidgets.py", + "widgets/mainwindows/mdi/mdi.py", + "widgets/painting/basicdrawing/basicdrawing.py", + "widgets/painting/concentriccircles.py", + "widgets/richtext/orderform.py", + "widgets/richtext/syntaxhighlighter.py", + "widgets/richtext/syntaxhighlighter/syntaxhighlighter.py", + "widgets/richtext/textobject/textobject.py", + "widgets/state-machine/eventtrans.py", + "widgets/state-machine/factstates.py", + "widgets/state-machine/pingpong.py", + "widgets/state-machine/rogue.py", + "widgets/state-machine/trafficlight.py", + "widgets/state-machine/twowaybutton.py", + "widgets/tutorials/addressbook/part1.py", + "widgets/tutorials/addressbook/part2.py", + "widgets/tutorials/addressbook/part3.py", + "widgets/tutorials/addressbook/part4.py", + "widgets/tutorials/addressbook/part5.py", + "widgets/tutorials/addressbook/part6.py", + "widgets/tutorials/addressbook/part7.py", + "widgets/widgets/hellogl_openglwidget_legacy.py", + "widgets/widgets/tetrix.py", + "xml/dombookmarks/dombookmarks.py", + "xmlpatterns/schema/schema.py"] +} diff --git a/examples/examples.pyqtc b/examples/examples.pyqtc deleted file mode 100644 index eb0e35933..000000000 --- a/examples/examples.pyqtc +++ /dev/null @@ -1,103 +0,0 @@ -charts/memoryusage.py -corelib/threads/mandelbrot.py -corelib/tools/codecs/codecs.py -corelib/tools/regexp.py -corelib/tools/settingseditor/settingseditor.py -declarative/extending/chapter1-basics/basics.py -declarative/extending/chapter2-methods/methods.py -declarative/extending/chapter3-bindings/bindings.py -declarative/extending/chapter4-customPropertyTypes/customPropertyTypes.py -declarative/extending/chapter5-listproperties/listproperties.py -declarative/scrolling.py -declarative/signals/pytoqml1/main.py -declarative/signals/qmltopy1/main.py -declarative/signals/qmltopy2/main.py -declarative/signals/qmltopy3/main.py -declarative/signals/qmltopy4/main.py -declarative/usingmodel.py -macextras/macpasteboardmime.py -multimedia/audiooutput.py -multimedia/camera.py -multimedia/player.py -network/blockingfortuneclient.py -network/fortuneclient.py -network/fortuneserver.py -network/threadedfortuneserver.py -opengl/2dpainting.py -opengl/grabber.py -opengl/hellogl.py -opengl/overpainting.py -opengl/samplebuffers.py -opengl/textures/textures.py -script/helloscript.py -texttospeech/texttospeech.py -tutorial/t1.py -tutorial/t10.py -tutorial/t11.py -tutorial/t12.py -tutorial/t13.py -tutorial/t14.py -tutorial/t2.py -tutorial/t3.py -tutorial/t4.py -tutorial/t5.py -tutorial/t6.py -tutorial/t7.py -tutorial/t8.py -tutorial/t9.py -webenginewidgets/simplebrowser.py -widgets/animation/animatedtiles/animatedtiles.py -widgets/animation/appchooser/appchooser.py -widgets/animation/easing/easing.py -widgets/animation/states/states.py -widgets/dialogs/classwizard/classwizard.py -widgets/dialogs/extension.py -widgets/dialogs/findfiles.py -widgets/dialogs/standarddialogs.py -widgets/dialogs/trivialwizard.py -widgets/draganddrop/draggabletext/draggabletext.py -widgets/effects/lighting.py -widgets/graphicsview/anchorlayout.py -widgets/graphicsview/collidingmice/collidingmice.py -widgets/graphicsview/diagramscene/diagramscene.py -widgets/graphicsview/dragdroprobot/dragdroprobot.py -widgets/graphicsview/elasticnodes.py -widgets/itemviews/addressbook/adddialogwidget.py -widgets/itemviews/addressbook/addressbook.py -widgets/itemviews/addressbook/addresswidget.py -widgets/itemviews/addressbook/newaddresstab.py -widgets/itemviews/addressbook/tablemodel.py -widgets/itemviews/basicsortfiltermodel.py -widgets/itemviews/fetchmore.py -widgets/itemviews/stardelegate/stardelegate.py -widgets/itemviews/stardelegate/stareditor.py -widgets/itemviews/stardelegate/starrating.py -widgets/layouts/basiclayouts.py -widgets/layouts/dynamiclayouts.py -widgets/layouts/flowlayout.py -widgets/mainwindows/application/application.py -widgets/mainwindows/dockwidgets/dockwidgets.py -widgets/mainwindows/mdi/mdi.py -widgets/painting/basicdrawing/basicdrawing.py -widgets/painting/concentriccircles.py -widgets/richtext/orderform.py -widgets/richtext/syntaxhighlighter.py -widgets/richtext/syntaxhighlighter/syntaxhighlighter.py -widgets/richtext/textobject/textobject.py -widgets/state-machine/eventtrans.py -widgets/state-machine/factstates.py -widgets/state-machine/pingpong.py -widgets/state-machine/rogue.py -widgets/state-machine/trafficlight.py -widgets/state-machine/twowaybutton.py -widgets/tutorials/addressbook/part1.py -widgets/tutorials/addressbook/part2.py -widgets/tutorials/addressbook/part3.py -widgets/tutorials/addressbook/part4.py -widgets/tutorials/addressbook/part5.py -widgets/tutorials/addressbook/part6.py -widgets/tutorials/addressbook/part7.py -widgets/widgets/hellogl_openglwidget_legacy.py -widgets/widgets/tetrix.py -xml/dombookmarks/dombookmarks.py -xmlpatterns/schema/schema.py diff --git a/examples/webenginewidgets/tabbedbrowser/tabbedbrowser.pyproject b/examples/webenginewidgets/tabbedbrowser/tabbedbrowser.pyproject new file mode 100644 index 000000000..1d26848b0 --- /dev/null +++ b/examples/webenginewidgets/tabbedbrowser/tabbedbrowser.pyproject @@ -0,0 +1,5 @@ +{ + "files": ["main.py", "bookmarkwidget.py", "browsertabwidget.py", + "downloadwidget.py", "findtoolbar.py", "historywindow.py", + "webengineview.py"] +} diff --git a/examples/webenginewidgets/tabbedbrowser/tabbedbrowser.pyqtc b/examples/webenginewidgets/tabbedbrowser/tabbedbrowser.pyqtc deleted file mode 100644 index b5fbffa28..000000000 --- a/examples/webenginewidgets/tabbedbrowser/tabbedbrowser.pyqtc +++ /dev/null @@ -1,7 +0,0 @@ -main.py -bookmarkwidget.py -browsertabwidget.py -downloadwidget.py -findtoolbar.py -historywindow.py -webengineview.py diff --git a/examples/widgets/tutorials/addressbook/part2.py b/examples/widgets/tutorials/addressbook/part2.py index 92f362e78..772b4d463 100644 --- a/examples/widgets/tutorials/addressbook/part2.py +++ b/examples/widgets/tutorials/addressbook/part2.py @@ -89,7 +89,6 @@ class AddressBook(QtWidgets.QWidget): self.addressText.setReadOnly(True) self.addButton = QtWidgets.QPushButton("&Add") - self.addButton.show() self.submitButton = QtWidgets.QPushButton("&Submit") self.submitButton.hide() self.cancelButton = QtWidgets.QPushButton("&Cancel") diff --git a/examples/widgets/tutorials/addressbook/part3.py b/examples/widgets/tutorials/addressbook/part3.py index 7ef4d6f8d..835adb3c6 100644 --- a/examples/widgets/tutorials/addressbook/part3.py +++ b/examples/widgets/tutorials/addressbook/part3.py @@ -89,7 +89,6 @@ class AddressBook(QtWidgets.QWidget): self.addressText.setReadOnly(True) self.addButton = QtWidgets.QPushButton("&Add") - self.addButton.show() self.submitButton = QtWidgets.QPushButton("&Submit") self.submitButton.hide() self.cancelButton = QtWidgets.QPushButton("&Cancel") diff --git a/examples/widgets/tutorials/addressbook/part4.py b/examples/widgets/tutorials/addressbook/part4.py index 2eaa67879..93cd310be 100644 --- a/examples/widgets/tutorials/addressbook/part4.py +++ b/examples/widgets/tutorials/addressbook/part4.py @@ -92,7 +92,6 @@ class AddressBook(QtWidgets.QWidget): self.addressText.setReadOnly(True) self.addButton = QtWidgets.QPushButton("&Add") - self.addButton.show() self.editButton = QtWidgets.QPushButton("&Edit") self.editButton.setEnabled(False) self.removeButton = QtWidgets.QPushButton("&Remove") diff --git a/examples/widgets/tutorials/addressbook/part5.py b/examples/widgets/tutorials/addressbook/part5.py index 4531210a7..9ea5312db 100644 --- a/examples/widgets/tutorials/addressbook/part5.py +++ b/examples/widgets/tutorials/addressbook/part5.py @@ -92,7 +92,6 @@ class AddressBook(QtWidgets.QWidget): self.addressText.setReadOnly(True) self.addButton = QtWidgets.QPushButton("&Add") - self.addButton.show() self.editButton = QtWidgets.QPushButton("&Edit") self.editButton.setEnabled(False) self.removeButton = QtWidgets.QPushButton("&Remove") diff --git a/examples/widgets/tutorials/addressbook/part6.py b/examples/widgets/tutorials/addressbook/part6.py index f642e8616..6f0550440 100644 --- a/examples/widgets/tutorials/addressbook/part6.py +++ b/examples/widgets/tutorials/addressbook/part6.py @@ -94,7 +94,6 @@ class AddressBook(QtWidgets.QWidget): self.addressText.setReadOnly(True) self.addButton = QtWidgets.QPushButton("&Add") - self.addButton.show() self.editButton = QtWidgets.QPushButton("&Edit") self.editButton.setEnabled(False) self.removeButton = QtWidgets.QPushButton("&Remove") diff --git a/examples/widgets/tutorials/addressbook/part7.py b/examples/widgets/tutorials/addressbook/part7.py index e6cbe54d2..8ad2e35c0 100644 --- a/examples/widgets/tutorials/addressbook/part7.py +++ b/examples/widgets/tutorials/addressbook/part7.py @@ -94,7 +94,6 @@ class AddressBook(QtWidgets.QWidget): self.addressText.setReadOnly(True) self.addButton = QtWidgets.QPushButton("&Add") - self.addButton.show() self.editButton = QtWidgets.QPushButton("&Edit") self.editButton.setEnabled(False) self.removeButton = QtWidgets.QPushButton("&Remove") |