本文整理汇总了C++中LayerManager::getpLayerList方法的典型用法代码示例。如果您正苦于以下问题:C++ LayerManager::getpLayerList方法的具体用法?C++ LayerManager::getpLayerList怎么用?C++ LayerManager::getpLayerList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LayerManager
的用法示例。
在下文中一共展示了LayerManager::getpLayerList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateView
void LayerTableView::updateView()
{
//Select layer at init.
model->refreshModel();
this->resizeRowsToContents();
LayerManager* pManager = LayerManager::getInstance();
QList<LayerItem>* pList = pManager->getpLayerList();
int index = 0;
for (QList<LayerItem>::iterator it = pList->begin(); it != pList->end(); it++)
{
if (it->isSelected)
{
this->selectRow(index);
break;
}
index++;
}
this->update();
}
示例2: image
ExportDlg::ExportDlg(QWidget *parent)
: QDialog()
{
this->setWindowTitle("Export image");
LayerManager *layerManager = LayerManager::getInstance();
imageSize = layerManager->getLayerSize();
originalSizeLabel = new QLabel(QString("Original size: " + QString::number(imageSize.width()) + "px * " + QString::number(imageSize.height()) + "px"));
exportSizeLabel = new QLabel(QString("Export Size:"));
widthLabel = new QLabel(QString("Width:"));
widthLabel->setFixedWidth(50);
heightLabel = new QLabel(QString("Height: "));
heightLabel->setFixedWidth(50);
widthEdit = new QLineEdit();
widthEdit->setText(QString::number(imageSize.width()));
connect(widthEdit, SIGNAL(textChanged(const QString &)), this, SLOT(widthEditChangedSlot(const QString &)));
heightEdit = new QLineEdit();
heightEdit->setText(QString::number(imageSize.height()));
connect(heightEdit, SIGNAL(textChanged(const QString &)), this, SLOT(heightEditChangedSlot(const QString &)));
widthEdit->setValidator(new QIntValidator(1, 1920, this));
heightEdit->setValidator(new QIntValidator(1, 1080, this));
buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
canvas = new ThumbnailCanvas(false);
canvas->setFixedSize(200, 200);
//Merge all layer to one image.
QImage image(layerManager->getLayerSize().width(), layerManager->getLayerSize().height(), QImage::Format_ARGB32);
QColor transparent(0, 0, 0, 0);
image.fill(transparent);
QList<LayerItem>* layerList = layerManager->getpLayerList();
QPainter mergePainter(&image);
mergePainter.setCompositionMode(QPainter::CompositionMode_DestinationOver);
for (QList<LayerItem>::iterator it = layerList->begin(); it != layerList->end(); it++)
{
if (it->isShow)
{
mergePainter.drawImage(it->anchor.rx(), it->anchor.ry(), it->thumbnail);
}
}
previewImage = QPixmap::fromImage(image);
canvas->setPixmap(previewImage);
QHBoxLayout *widthLayout = new QHBoxLayout();
QHBoxLayout *heightLayout = new QHBoxLayout();
widthLayout->addWidget(widthLabel);
widthLayout->addWidget(widthEdit);
widthLayout->addWidget(new QLabel("px"));
heightLayout->addWidget(heightLabel);
heightLayout->addWidget(heightEdit);
heightLayout->addWidget(new QLabel("px"));
QVBoxLayout *rightLayout = new QVBoxLayout();
rightLayout->addWidget(originalSizeLabel);
rightLayout->addWidget(exportSizeLabel);
rightLayout->addLayout(widthLayout);
rightLayout->addLayout(heightLayout);
QHBoxLayout *leftLayout = new QHBoxLayout();
leftLayout->addWidget(canvas);
leftLayout->addLayout(rightLayout);
QVBoxLayout* mainLayout = new QVBoxLayout();
mainLayout->addLayout(leftLayout);
mainLayout->addWidget(buttonBox);
this->setLayout(mainLayout);
}