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


C++ QDialog::adjustSize方法代码示例

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

示例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());
    }
}
开发者ID:hechenyu,项目名称:cpp_code,代码行数:18,代码来源:httpwindow.cpp

示例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();
}
开发者ID:EMSL-MSC,项目名称:pacifica-auth,代码行数:19,代码来源:mainwindow.cpp

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


}
开发者ID:toxa-svr,项目名称:OpencvFilters,代码行数:64,代码来源:NodeItem.cpp


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