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


C++ QScrollView::setMargin方法代码示例

本文整理汇总了C++中QScrollView::setMargin方法的典型用法代码示例。如果您正苦于以下问题:C++ QScrollView::setMargin方法的具体用法?C++ QScrollView::setMargin怎么用?C++ QScrollView::setMargin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QScrollView的用法示例。


在下文中一共展示了QScrollView::setMargin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: addButtonClicked

void AdminUsers::addButtonClicked()
{
#if DEBUG_ADMINUSERS
	qDebug("init addButtonClicked");
#endif
	QScrollView *scroll = new QScrollView(this, 0, Qt::WDestructiveClose);
	scroll->setResizePolicy(QScrollView::AutoOneFit);
	scroll->setMargin(10);
	
	FormAdminUsers *formAdminUsers = new FormAdminUsers(FormBase::Add, scroll->viewport() );
	connect(formAdminUsers, SIGNAL(message2osd(const QString& )) , this, SIGNAL(message2osd(const QString& )));

	formAdminUsers->setType( FormBase::Add);
	connect(formAdminUsers, SIGNAL(cancelled()), scroll, SLOT(close()));
	connect(formAdminUsers, SIGNAL(inserted(const QString& )), this, SLOT(addItem( const QString& )));

	scroll->addChild(formAdminUsers);
	formAdminUsers->setupButtons( FormBase::AcceptButton, FormBase::CancelButton );

	formAdminUsers->setTitle(i18n("Admin User"));
	formAdminUsers->setExplanation(i18n("Fill the fields with the user information"));
	
	emit sendWidget(scroll,i18n("Add user")); 
#if DEBUG_ADMINUSERS
	qDebug("end addButtonClicked");
#endif
}
开发者ID:BackupTheBerlios,项目名称:kludoteca-svn,代码行数:27,代码来源:adminusers.cpp

示例2: modifyButtonClicked

void AdminUsers::modifyButtonClicked()
{
#if DEBUG_ADMINUSERS
	qDebug("init modifyButtonClicked");
#endif
	QScrollView *scroll = new QScrollView(this, 0, Qt::WDestructiveClose);
	scroll->setResizePolicy(QScrollView::AutoOneFit);
	scroll->setMargin(10);
	
	FormAdminUsers *formAdminUsers = new FormAdminUsers(FormBase::Edit, scroll->viewport() );
	
	connect(formAdminUsers, SIGNAL(message2osd(const QString& )) , this, SIGNAL(message2osd(const QString& )));

	KLSelect sqlquery(QStringList() << "ldt_users.docident" << "login" << "firstname" << "lastname" << "genre" << "address" << "phone" << "email" << "permissions", QStringList() << "ldt_users" << "ldt_persons" );
	
	sqlquery.setWhere("ldt_persons.docIdent=ldt_users.docIdent and login="+SQLSTR(m_listView->currentItem()->text(2))); // Login in the listview
	
	KLResultSet resultSet = KLDM->execQuery(&sqlquery);
	
	m_xmlsource.setData(resultSet.toString());
	
	if ( ! m_xmlreader.analizeXml(&m_xmlsource, KLResultSetInterpreter::Total) )
	{
		std::cerr << "No se puede analizar" << std::endl;
		return;
	}
	
	KLSqlResults results = m_xmlreader.results();
	
	std::cout << results["login"] << std::endl;

	formAdminUsers->setAddress( results["address"] );
	formAdminUsers->setEmail(results["email"]);
	formAdminUsers->setFirstName( results["firstname"]);
	formAdminUsers->setIdentification( results["ldt_users.docident"]);
	formAdminUsers->setLastName( results["lastname"]);
	formAdminUsers->setLogin( results["login"]);
	formAdminUsers->setPermissions( results["permissions"]);
	formAdminUsers->setPhone( results["phone"]);
	formAdminUsers->setGenre( results["genre"]);
	
	formAdminUsers->setType( FormBase::Edit );
	connect(formAdminUsers, SIGNAL(cancelled()), scroll, SLOT(close()));
	connect(formAdminUsers, SIGNAL(inserted(const QString& )), this, SLOT(updateItem(const QString &)));

	scroll->addChild(formAdminUsers);
	formAdminUsers->setupButtons( FormBase::AcceptButton, FormBase::CancelButton );
	formAdminUsers->setTextAcceptButton(i18n("Modify"));
	formAdminUsers->setTextCancelButton(i18n("Close"));
	formAdminUsers->setTitle(i18n("Admin User"));
	formAdminUsers->setExplanation(i18n("Modify the fields with the user information"));
	
	emit sendWidget(scroll,i18n("Modify user"));
#if DEBUG_ADMINUSERS
	qDebug("end addButtonClicked");
#endif
}
开发者ID:BackupTheBerlios,项目名称:kludoteca-svn,代码行数:57,代码来源:adminusers.cpp


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