You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
904 B
33 lines
904 B
#include "widget.h"
|
|
|
|
#include <QPushButton>
|
|
|
|
#ifndef QT_NO_DEBUG
|
|
#include <QDebug>
|
|
#endif
|
|
|
|
#include "OE/OEasyScreenshot"
|
|
#include "qxt/qxtglobalshortcut.h"
|
|
|
|
Widget::Widget(QWidget *parent) :
|
|
QWidget(parent),openScreenshotButton_(new QPushButton(this)) {
|
|
|
|
openScreenshotButton_->setGeometry(0,0,300,300);
|
|
openScreenshotButton_->setObjectName("OpenScreenshotButton");
|
|
openScreenshotButton_->show();
|
|
openScreenshotButton_->setText(QStringLiteral(
|
|
"单击我\n\n快捷键( Shift+A )"));
|
|
QxtGlobalShortcut* shortcut = new QxtGlobalShortcut(
|
|
QKeySequence("Shift+A"), this);
|
|
|
|
connect(shortcut, SIGNAL(activated()),
|
|
this, SLOT(onScreenshot()));
|
|
connect(openScreenshotButton_.get(), SIGNAL(clicked()),
|
|
this, SLOT(onScreenshot()));
|
|
}
|
|
|
|
|
|
void Widget::onScreenshot()
|
|
{
|
|
OEScreenshot::Instance();
|
|
}
|
|
|