本文整理汇总了C++中QDialog::adjustSize方法的典型用法代码示例。如果您正苦于以下问题:C++ QDialog::adjustSize方法的具体用法?C++ QDialog::adjustSize怎么用?C++ QDialog::adjustSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDialog
的用法示例。
在下文中一共展示了QDialog::adjustSize方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: slotAuthenticationRequired
void DownloadDialog::slotAuthenticationRequired(const QString &hostName, quint16, QAuthenticator *authenticator)
{
QDialog dlg;
Ui_DlgAuthorization ui;
ui.setupUi(&dlg);
dlg.adjustSize();
ui.siteDescription->setText(tr("%1 at %2").arg(authenticator->realm()).arg(hostName));
if (dlg.exec() == QDialog::Accepted) {
authenticator->setUser(ui.username->text());
authenticator->setPassword(ui.password->text());
}
}
示例2: slotAuthenticationRequired
void HttpWindow::slotAuthenticationRequired(QNetworkReply*,QAuthenticator *authenticator)
{
QDialog dlg;
Ui::Dialog ui;
ui.setupUi(&dlg);
dlg.adjustSize();
ui.siteDescription->setText(tr("%1 at %2").arg(authenticator->realm()).arg(url.host()));
// Did the URL have information? Fill the UI
// This is only relevant if the URL-supplied credentials were wrong
ui.userEdit->setText(url.userName());
ui.passwordEdit->setText(url.password());
if (dlg.exec() == QDialog::Accepted) {
authenticator->setUser(ui.userEdit->text());
authenticator->setPassword(ui.passwordEdit->text());
}
}
示例3: authentication_required
void MainWindow::authentication_required(QNetworkReply * reply, QAuthenticator *authenticator)
{
QDialog dialog;
Ui::Dialog ui;
ui.setupUi(&dialog);
ui.site->setText(tr("%1").arg(authenticator->realm()));
dialog.adjustSize();
this->hide();
if(dialog.exec() == QDialog::Accepted)
{
authenticator->setUser(ui.user->text());
authenticator->setPassword(ui.password->text());
}
else
{
exit(-1);
}
this->show();
}
示例4: QGraphicsProxyWidget
NodeItem::NodeItem(QWidget * widget, Qt::WindowFlags wFlags, QGraphicsItem *parent) :
QGraphicsProxyWidget(parent, wFlags),
isMoving(false),
isMovable(true),
isResizable(false)
{
setCacheMode(DeviceCoordinateCache);
setZValue(1);
setFlag(QGraphicsItem::ItemIsMovable, true);
setFlag(QGraphicsItem::ItemIsSelectable, true);
setFlag(QGraphicsItem::ItemIsFocusable, true);
QDialog * itemDialog = new QDialog;
QVBoxLayout * layout = new QVBoxLayout(itemDialog);
itemDialog->setLayout(layout);
widget->setFixedSize(widget->geometry().size());
ExpanderWidget* ew = new ExpanderWidget(itemDialog);
ew->setExpanderTitle("Filter settings");
ExpanderWidget* ew2 = new ExpanderWidget(itemDialog);
ew2->setExpanderTitle("Ports");
if (widget) {
layout->addWidget(ew);
layout->addWidget(ew2);
layout->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding));
ew->addPage(widget);
ew2->addPage(new QLabel("ports here", ew2));
ew->show();
ew2->show();
widget->show();
}
itemDialog->adjustSize();
// QHBoxLayout * layout = new QHBoxLayout;
// layout->setSizeConstraint(QLayout::SetFixedSize);
// if (widget) {
// widget->setFixedSize(widget->geometry().size());
// layout->addWidget(widget);
// widget->setWindowFlags(Qt::Dialog);
// widget->show();
// }
// itemDialog->setLayout(layout);
// itemDialog->setWindowFlags(Qt::Dialog);
// itemDialog->setVisible(true);
// itemDialog->update();
// itemDialog->adjustSize();
// setWidget(itemDialog);
//widget->setFixedSize(widget->geometry().size());
setWidget(widget);
setWindowFlags(Qt::Dialog);
setVisible(true);
update();
widget->adjustSize();
}