Skip to content

Commit b1e29db

Browse files
pankajpjreback
authored andcommitted
BUG: Fix linux clipboard QApplication() creation
closes pandas-dev#14372 A Qt application cannot instantiate multiple `QApplication` instances, so we create a new `QApplication` only when the global `QApplication.instance()` is None. Author: Pankaj Pandey <[email protected]> Closes pandas-dev#14815 from pankajp/patch-2 and squashes the following commits: 40d70f9 [Pankaj Pandey] BUG: Fix linux clipboard QApplication() creation
1 parent bd24926 commit b1e29db

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

doc/source/whatsnew/v0.20.0.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,7 @@ Bug Fixes
828828

829829
- Bug in ``pd.read_msgpack()`` in which ``Series`` categoricals were being improperly processed (:issue:`14901`)
830830
- Bug in ``Series.ffill()`` with mixed dtypes containing tz-aware datetimes. (:issue:`14956`)
831-
831+
- Bug in interactions with ``Qt`` when a ``QtApplication`` already exists (:issue:`14372`)
832832
- Bug in ``DataFrame.isin`` comparing datetimelike to empty frame (:issue:`15473`)
833833

834834
- Bug in ``Series.where()`` and ``DataFrame.where()`` where array-like conditionals were being rejected (:issue:`15414`)

pandas/util/clipboard/clipboards.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ def init_qt_clipboard():
5050
# $DISPLAY should exist
5151
from PyQt4.QtGui import QApplication
5252

53-
app = QApplication([])
53+
# use the global instance if it exists
54+
app = QApplication.instance() or QApplication([])
5455

5556
def copy_qt(text):
5657
cb = app.clipboard()

0 commit comments

Comments
 (0)