|
|
|
|
@ -27,9 +27,12 @@ InviteDialog::InviteDialog(const QString& link, QWidget* parent)
|
|
|
|
|
auto *copyBtn = new QPushButton("Скопировать", this); |
|
|
|
|
connect(copyBtn, &QPushButton::clicked, this, [this, linkEdit]() { |
|
|
|
|
QClipboard* cb = QApplication::clipboard(); |
|
|
|
|
cb->clear(QClipboard::Clipboard); |
|
|
|
|
cb->setText(m_link, QClipboard::Clipboard); |
|
|
|
|
if (cb->supportsSelection()) |
|
|
|
|
if (cb->supportsSelection()) { |
|
|
|
|
cb->clear(QClipboard::Selection); |
|
|
|
|
cb->setText(m_link, QClipboard::Selection); |
|
|
|
|
} |
|
|
|
|
linkEdit->setFocus(); |
|
|
|
|
}); |
|
|
|
|
btnLayout->addWidget(copyBtn); |
|
|
|
|
|