本文整理汇总了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
}
示例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
}