24 grid->addWidget(commentEdit, 1, 0, 1, 2);
36 if (event->button() == Qt::LeftButton
37 && iconLabel->geometry().contains(event->pos())) {
40 QDrag *drag =
new QDrag(
this);
41 QMimeData *mimeData =
new QMimeData;
43 mimeData->setText(commentEdit->toPlainText());
44 drag->setMimeData(mimeData);
46 drag->setPixmap(iconPixmap);
48 Qt::DropAction dropAction = drag->exec();
54 actionText = tr(
"The text was copied.");
57 actionText = tr(
"The text was moved.");
60 actionText = tr(
"The text was linked.");
62 case Qt::IgnoreAction:
63 actionText = tr(
"The drag was ignored.");
66 actionText = tr(
"Unknown action.");
69 statusBar()->showMessage(actionText);
void mousePressEvent(QMouseEvent *event) override
[0]
MainWindow(QWidget *parent=nullptr)