完成发布
This commit is contained in:
@@ -8,14 +8,12 @@ FrmImgShow::FrmImgShow(QWidget *parent) : QWidget(parent)
|
||||
connect(TCHttpService::getInstance(), &TCHttpService::signal_imageDownloaded,
|
||||
this, [this](const QString& requestId, const QPixmap& pixmap){
|
||||
if (requestId == m_requestId) {
|
||||
// setLoadingState(false);
|
||||
qDebug() << "load success";
|
||||
setImage(pixmap);
|
||||
}
|
||||
});
|
||||
|
||||
connect(TCHttpService::getInstance(), &TCHttpService::signal_downloadFailed,
|
||||
this, [this](const QString& requestId, const QString& error){
|
||||
this, [this](const QString& requestId){
|
||||
if (requestId == m_requestId) {
|
||||
qDebug() << "load failed";
|
||||
}
|
||||
@@ -24,7 +22,6 @@ FrmImgShow::FrmImgShow(QWidget *parent) : QWidget(parent)
|
||||
|
||||
void FrmImgShow::loadImage(const QUrl &imageUrl)
|
||||
{
|
||||
qDebug() << "loadImage";
|
||||
m_currentUrl = imageUrl;
|
||||
m_requestId = QUuid::createUuid().toString();
|
||||
TCHttpService::getInstance()->downloadImage(m_requestId, imageUrl);
|
||||
@@ -46,14 +43,9 @@ void FrmImgShow::setImage(const QPixmap &pixmap)
|
||||
labImg->setPixmap(pixmap.scaled(this->labImg->width(), this->labImg->height()));
|
||||
}
|
||||
|
||||
void FrmImgShow::setLoadingState(bool loading)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void FrmImgShow::initSignalSlot()
|
||||
{
|
||||
connect(btnCopy, &QPushButton::clicked, [this](){
|
||||
connect(btnCopy, &QPushButton::clicked, this, [this](){
|
||||
switch(FrmAlbum::getCopyType()) {
|
||||
case 0:
|
||||
{
|
||||
@@ -86,7 +78,7 @@ void FrmImgShow::initSignalSlot()
|
||||
}
|
||||
});
|
||||
|
||||
connect(ckbSelect, &QCheckBox::checkStateChanged, [this](Qt::CheckState state){
|
||||
connect(ckbSelect, &QCheckBox::checkStateChanged, this, [this](Qt::CheckState state){
|
||||
if (state == Qt::Unchecked) {
|
||||
emit signal_imageUnselected(m_currentUrl.toString());
|
||||
}
|
||||
@@ -95,6 +87,15 @@ void FrmImgShow::initSignalSlot()
|
||||
emit signal_imageSelected(m_currentUrl.toString());
|
||||
}
|
||||
});
|
||||
|
||||
connect(btnDelete, &QPushButton::clicked, this, [this](){
|
||||
// qDebug() <<"delete";
|
||||
QString domain = FileConfigDecode::getInstance()->getAddress();
|
||||
QString userName = FileConfigDecode::getInstance()->getUserName();
|
||||
int del_res = ImageManager::instance()->removeImageUrl(domain, userName, m_currentUrl.toString());
|
||||
// qDebug() << "del_res:" << del_res;
|
||||
emit signal_imageDelete();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -199,7 +200,7 @@ void FrmImgShow::initForm()
|
||||
// btnCopy->setFixedSize(32, 32);
|
||||
// btnCopy->setCursor(Qt::PointingHandCursor);
|
||||
|
||||
setStyleSheet("background-color: #FF0000");
|
||||
// setStyleSheet("background-color: #FF0000");
|
||||
|
||||
setFixedSize(134, 160);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user