Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. Updating to 6.9.1 breaks code which work under 6.9.0
Forum Updated to NodeBB v4.3 + New Features

Updating to 6.9.1 breaks code which work under 6.9.0

Scheduled Pinned Locked Moved Unsolved Qt for Python
5 Posts 4 Posters 540 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    Ed Schneider
    wrote on last edited by Ed Schneider
    #1

    I recently updated to 6.9.1. A heatmap I produce with pyqtgraph was no longer visible. When I deleted 6.9.1 and restored 6.9.0 the heatmap again worked even with updates to NumPy, pandas, and scikit-learn. Are others having problems with 6.9.1? Is a 6.9.1.1 coming?

    1 Reply Last reply
    1
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Are talking about PySide6 ?
      How did you install it ?
      Can you provide a minimal script and dependencies for people to reproduce this issue ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • P Offline
        P Offline
        Plankter
        wrote on last edited by Plankter
        #3

        I have the same issue with pyqtgraph since the 6.9.1 update. Rolling back to version 6.9.0 fixes the problem.

        You can reproduce the error by running pyqtgraph demo (BasicPlotting, for example):

        import pyqtgraph.examples
        pyqtgraph.examples.run()

        1 Reply Last reply
        0
        • E Offline
          E Offline
          Ed Schneider
          wrote on last edited by
          #4

          Yes I use PySide6 to create a 150 item GUI. Here's the code which produces a heatmap in 6.9.0 but shows just the axes in 6.9.1. I am trying to reproduce a heatmap I create with matplotib. It is still a work in process and requires some handstands in pyqtgraph such as an axis inversion. I've removed several failed attempts to rotate horizontal axis labels and failed attempts to place the colormap so that it aligns with the heatmap. Even with those removed it still has the problem with 6.9.1.
          def plot_a_heatmap_using_pyqtgraph(self):
          # Get data from director
          distances_as_square = self._director.configuration_active.distances_as_square

          	nreferent = self._director.configuration_active.nreferent
          	item_names = self._director.configuration_active.item_names
          	item_labels = self._director.configuration_active.item_labels
          	
          	# Create lower triangle matrix like matplotlib
          	distances_as_lower_triangle = np.triu(distances_as_square, k=0)
          	
          	# Create layout widget
          	layout_widget = pg.GraphicsLayoutWidget()
          	layout_widget.setBackground('w')
          	
          	# Create plot with title
          	plot_item = pg.PlotItem(title='Inter-point Distances')
          	plot_item.getViewBox().setDefaultPadding(0)
          	
          	# Create the image item for the heatmap and add it to the plot
          	img = pg.ImageItem()
          	plot_item.addItem(img)
          
          	img.setImage(distances_as_lower_triangle)
          	plot_item.invertY(True)
          	img.setRect(pg.QtCore.QRectF(-0.5, -0.5, nreferent, nreferent))
          	
          	# Set colormap
          	cmap = pg.colormap.getFromMatplotlib('gist_yarg')
          		
          	img.setColorMap(cmap)
          
          	# Configure axes
          	plot_item.setLabel('left', "Items")
          	x_axis = plot_item.getAxis('bottom')
          	y_axis = plot_item.getAxis('left')
          	
          	# Set vertical axis labels
          	y_axis.setTicks([[(i, name) for i, name in enumerate(item_names)]])
          	
          	x_axis.setHeight(80)
          	# Use item_labels for the bottom axis
          	x_labels = [(i, item_labels[i]) for i in range(nreferent)]
          	x_axis.setTicks([x_labels])
          	
          	# Set view range for the matrix part only
          	plot_item.getViewBox().setRange(
          		xRange=(-0.5, nreferent-0.5),
          		yRange=(-1.5, nreferent-0.5)
          	)
          	
          	# Get the current viewbox range
          	vb = plot_item.vb
          	x_min, x_max = vb.state['viewRange'][0]
          	y_min, y_max = vb.state['viewRange'][1]
          
          	# Add lines at top and right
          	top_line = pg.InfiniteLine(pos=y_min, angle=0, pen='k')   # horizontal
          	right_line = pg.InfiniteLine(pos=x_max, angle=90, pen='k')  # vertical
          
          	# Link the lines to the ViewBox so they move with zoom/pan
          	vb.addItem(top_line)
          	vb.addItem(right_line)
          
          	# Add the plot to the main layout
          	layout_widget.addItem(plot_item, row=0, col=0)
          	
          	# Add colorbar
          	colorbar = pg.ColorBarItem(
          		values=(np.nanmin(distances_as_lower_triangle), 
          				np.nanmax(distances_as_lower_triangle)),
          		colorMap=cmap,
          		width=20,
          		interactive=False
          	)
          	colorbar.setImageItem(img)
          	
          	# Add colorbar to layout
          	layout_widget.addItem(colorbar, row=0, col=1)
          
          	layout_widget.ci.layout.setAlignment(
          		colorbar, pg.QtCore.Qt.AlignVCenter)
          	
          	# Add extra space at the bottom for rotated labels
          	layout_widget.ci.layout.setRowStretchFactor(0, 3)
          	
          	return layout_widget
          
          1 Reply Last reply
          0
          • F Offline
            F Offline
            friedemannkleint
            wrote on last edited by
            #5

            There was a regression related to QGraphicsView in 6.9.1, https://bugreports.qt.io/browse/PYSIDE-3115 , this could be the reason. It will hopefully again work in 6.9.2.

            1 Reply Last reply
            2

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved