当前位置: 首页>>代码示例>>C++>>正文


C++ LayerManager::getpLayerList方法代码示例

本文整理汇总了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();
}
开发者ID:Iownnoname,项目名称:qt,代码行数:20,代码来源:layertableview.cpp

示例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);

}
开发者ID:Iownnoname,项目名称:qt,代码行数:77,代码来源:exportdlg.cpp


注:本文中的LayerManager::getpLayerList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。