#!/usr/bin/python3 # -*- coding: utf-8 -*- import sys from PyQt5.QtWidgets import (QPushButton, QWidget, QLineEdit, QApplication) # QPushButtonを継承 class Button(QPushButton): def __init__(self, title, parent): super().__init__(title, parent) # ボタンに対してドロップ操作を可能にする self.setAcceptDrops(True) def dragEnterEvent(self, e): # ドラッグ可能なデータ形式を設定 if e.mimeData().hasFormat('text/plain'): e.accept() else: e.igno