Skip to content

Commit

Permalink
Use Type[QWidget] for btn_popup
Browse files Browse the repository at this point in the history
  • Loading branch information
zkovari committed Feb 23, 2022
1 parent cff6242 commit 61b8861
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions qthandy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import functools
from typing import Optional, Union
from typing import Optional, Union, Type

from qtpy.QtCore import Qt, QObject
from qtpy.QtGui import QCursor
Expand Down Expand Up @@ -118,7 +118,7 @@ def gc(obj: QObject):
obj.deleteLater()


def btn_popup(btn: Union[QPushButton, QToolButton], popup: QWidget, show_menu_icon: bool = False):
def btn_popup(btn: Union[QPushButton, QToolButton], popup: Type[QWidget], show_menu_icon: bool = False):
menu = QMenu(btn)
action = QWidgetAction(menu)
action.setDefaultWidget(popup)
Expand Down

0 comments on commit 61b8861

Please sign in to comment.