adamerose / PandasGUI

A GUI for Pandas DataFrames
MIT No Attribution
3.17k stars 229 forks source link

Find toolbar doesn't display properly #181

Closed chadkennedyonline closed 2 years ago

chadkennedyonline commented 2 years ago

Describe the bug
image

Due to this exception:

Traceback (most recent call last): File "C:\project\lib\site-packages\pandasgui\widgets\find_toolbar.py", line 308, in resizeEvent button.move( TypeError: arguments did not match any overloaded call: move(self, QPoint): argument 1 has unexpected type 'int' move(self, int, int): argument 2 has unexpected type 'float'

This occurs because (self.rect().bottom() - buttonSize.height() + 1) / 2 is a float, under Python 3, if self.rect().bottom() - buttonSize.height() happens to be even. There's no version of move() that takes a float. One fix is to change the expression above to (self.rect().bottom() - buttonSize.height() + 1) // 2.

After the fix is applied, it looks like this:

image

Note in both cases there's a white horizontal line at the top of the find toolbar. Not sure why it's there, but I believe it's not caused by my fix, since it's in the "before" screenshot as well.

Will submit a PR shortly.

Environment OS: Windows 10 Python: 3.10.1 IDE: PyCharm

Package versions

ipython==7.30.1
pandasgui==0.2.13        
plotly==5.4.0
PyQt5==5.15.6
PyQt5-Qt5==5.15.2        
PyQt5-sip==12.9.0        
PyQtWebEngine==5.15.5    
PyQtWebEngine-Qt5==5.15.2
mlindsk commented 2 years ago

I still get this error:

import pandas as pd
import pandasgui as gui

df = pd.DataFrame({'a' : [1, 2], 'b' : [3, 4]})
gui.show(df)

image

The gui window opens, but freezes (not responding) immediately.

Environment:

Package versions:

ipython==8.2.0
pandasgui==0.2.13        
plotly==5.7.0
PyQt5==5.15.6
PyQt5-Qt5==5.15.2        
PyQt5-sip==12.10.1        
PyQtWebEngine==5.15.5    
PyQtWebEngine-Qt5==5.15.2

Cheers, Mads