void mod_graph::screentick()
 {
     byteImage.clear();
     snapshot = QPixmap::grabWindow(QApplication::desktop()->winId());
     buffer.open(QIODevice::WriteOnly);
     snapshot.save(&buffer, "JPG", quality);
     sendPix(byteImage);
 }
 mod_graph::mod_graph(QObject *parent, quint16 adminId_):
     QObject(parent),
     adminId(adminId_)
 {
     snapshot = QPixmap::grabWindow(QApplication::desktop()->winId());
     buffer.setBuffer(&byteImage);
     buffer.open(QIODevice::WriteOnly);
     quality = 20;
     snapshot.save(&buffer, "JPG", quality);
     qDebug() << byteImage.size();
     sendPix(byteImage);
     QTimer *timer = new QTimer(this);
     connect(timer, SIGNAL(timeout()), this, SLOT(screentick()));
     timer->start(1000);
 }
Beispiel #3
0
void YbSendCoinsDialog::createWidget()
{
    QPixmap sendPix(":icons/sendindialog");
    QString titleStr(tr("发送"));
    QString titleInfoStr(tr("立即向任意元宝币地址发送元宝币。"));
    title = new YbMessageDialogTitle(sendPix, titleStr, titleInfoStr, this);
    this->setMinimumHeight(370);
    this->setMinimumWidth(550);
    setAutoFillBackground(true);
    QPalette pa = palette();
    pa.setColor(QPalette::Background,QColor(255, 255, 255));
    setStyleSheet("QLineEdit{border: 2px groove rgb(211, 211, 211)} QScrollArea{border: hide}");
    this->setPalette(pa);

    connect(buttonBar, SIGNAL(cancel()), this, SLOT(cancel()));
    connect(buttonBar, SIGNAL(deleteAll()), this, SLOT(deleteAll()));
    connect(buttonBar, SIGNAL(clear()), this, SLOT(clear()));
    connect(buttonBar, SIGNAL(send()), this, SLOT(send()));

    receiversForm = new ReceiversForm(this);
    connect(receiversForm, SIGNAL(addAsLabel(QString&)), this, SLOT(getAddAsLabel(QString&)));

    boldFont.setBold(true);

    addAsLabel->setMinimumHeight(25);
    addAsLabel->setMinimumWidth(382);
    addAsLabel->setToolTip(tr("输入标签"));
    QHBoxLayout *labelLayout = new QHBoxLayout;
    QLabel *labelText = new QLabel(tr("标签:"));
    labelText->setFont(boldFont);
    labelLayout->addSpacing(20);
    labelLayout->addWidget(labelText);
    labelLayout->addWidget(addAsLabel);
    labelLayout->addSpacing(28);

    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->setMargin(0);
    mainLayout->addWidget(title);
    mainLayout->addWidget(receiversForm);
    mainLayout->addLayout(labelLayout);
    mainLayout->addWidget(buttonBar);

    setLayout(mainLayout);
}