Пример #1
0
void ScreenshotsWidget::mouseDoubleClickEvent(QMouseEvent *event)
{
    if(currentShotState == finishShot || currentShotState == finishMoveShot || currentShotState == finishControl){
        emit finishPixmap(shotPixmap); //当完成时发送finishPixmap信号
        hide();
    }
}
Пример #2
0
MainWidget::MainWidget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::MainWidget),
    ts(new RectSelector),
    maximizedState(false)
{
    ui->setupUi(this);

    QVector<QPushButton*> modeButtons;
    modeButtons.push_back(ui->mode0Button);
    modeButtons.push_back(ui->mode1Button);
    modeBox = new ModeBox(modeButtons);

    createActions();
    createTrayIcon();
    windowVisibility = true;

    loadSettings();
    //storePositionInfo();

    connect(this, SIGNAL(setPixmap(QPixmap)), ts, SLOT(loadBackgroundPixmap(QPixmap)));
    connect(ts, SIGNAL(finishPixmap(QPixmap)), this, SLOT(triangleReceiver(QPixmap)));
    connect(ts, SIGNAL(quitPixmap()), this, SLOT(triangleReceiver()));
    connect(trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
            this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));

    shootFullScreen();
    updateScreenshotLabel();
}
void WizScreenShotWidget::mouseDoubleClickEvent(QMouseEvent *event)
{
    if (currentShotState == finishShot || currentShotState == finishMoveShot || currentShotState == finishControl)
    {
        QRect rcSelect = getMoveControlSelectedRect();
        hideWidget();
        if (rcSelect.contains(event->pos()))
            emit finishPixmap(shotPixmap);
    }
}
Пример #4
0
void ScreenshotsWidget::sendPixmap(){
    emit finishPixmap(shotPixmap); //当完成时发送finishPixmap信号
    hide();
}
Пример #5
0
ChatForm::ChatForm(User *receiver, QWidget *parent) :
    QWidget(parent),
    ui(new Ui::ChatForm),
    receiver(receiver),
    sender(UserService::getService()->getMyself()),
    mChatRecords(ChatRecordService::getService()->getChatRecordsByUserUuid(receiver->getUuid(), ChatRecord::NotRead)),
    mIconService(IconService::getService()),
    mScreenshotsWidget(new ScreenshotsWidget)
{
    ui->setupUi(this);

    /* recent friends */
    UserService::getService()->insertRecentFriend(*receiver);
    /* end of recent friends */

    setAttribute(Qt::WA_DeleteOnClose);
    this->mChatService = ChatService::getService();
    this->mFileMsgService = FileMessageService::getService();

    ui->userIcon->setIcon(this->receiver->getIcon());
    ui->userIcon->setIconSize(QSize(40, 40));

    ui->usernameLabel->setText(this->receiver->getName());
    ui->signatrueLabel->setText(this->receiver->getInfo());

    setStyleSheet("#ChatForm {background-color:#ffdbf8}");

    connect(mChatService, SIGNAL(receiveSuccess(QHostAddress,quint16,ChatMessage)), this, SLOT(receiveSuccess(QHostAddress,quint16,ChatMessage)));
    connect(mChatService, SIGNAL(sendError(QUuid, QString)), this, SLOT(sendError(QUuid, QString)));
    connect(mChatService, SIGNAL(sendSuccess(QUuid)), this, SLOT(sendSuccess(QUuid)));
    connect(mFileMsgService, SIGNAL(received(QHostAddress,quint16,ChatMessage)), this, SLOT(fileMsgReceived(QHostAddress,quint16,ChatMessage)));

    updateChatRecordView();
    loadSetting();

    sendFileModel = new QStandardItemModel;
    receiveFileModel = new QStandardItemModel;

    QStringList heads;
    heads << "filename" << "progress" << "size" << "type" << "url" << "uuid";
    sendFileModel->setHorizontalHeaderLabels(heads);
    receiveFileModel->setHorizontalHeaderLabels(heads);

    ui->sendFileTableView->setModel(sendFileModel);
    ui->receiveFileTableView->setModel(receiveFileModel);

    mFileSender = 0;
    mFileReceiver = 0;
    mFileMessage = 0;

    fileSendRow = 0;
    fileReceiveRow = 0;

    mShakeTimer = new QTimer(this);
    mShakeTimer->setInterval(30);
    mShakePosition = 0;
    shakeMaxLimitTimes = 12;
    shakeMaxLimitSpace = 5;
    connect(mShakeTimer, SIGNAL(timeout()),this, SLOT(shakeTimeOut()));

    connect(mScreenshotsWidget, SIGNAL(finishPixmap(QPixmap)), this, SLOT(screenshotsFinish(QPixmap)));

    connect(&mFacesDialog, SIGNAL(clicked(Image)), this, SLOT(facesClicked(Image)));
}
WizScreenShotHelper::WizScreenShotHelper()
{
    m_widget = new WizScreenShotWidget();
    connect(m_widget, SIGNAL(finishPixmap(QPixmap)), SIGNAL(screenShotCaptured(QPixmap)));
    connect(m_widget, SIGNAL(shotScreenQuit()), SIGNAL(shotScreenQuit()));
}
void WizScreenShotWidget::savePixmap()
{
    hideWidget();
    emit finishPixmap(shotPixmap);
}