本文整理汇总了C++中QDialog::setMinimumSize方法的典型用法代码示例。如果您正苦于以下问题:C++ QDialog::setMinimumSize方法的具体用法?C++ QDialog::setMinimumSize怎么用?C++ QDialog::setMinimumSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDialog
的用法示例。
在下文中一共展示了QDialog::setMinimumSize方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QDialog
QDialog * MainWindow::createAddSessionDialogue(const QString & title, MTListWidget * lw)
{
QDialog * d = new QDialog(this);
#ifdef Q_WS_MAC
d->setWindowTitle(QString("%1 - %2").arg(current_db_name).arg(title));
#else
d->setWindowTitle(QString("%1 - %2 - iTest").arg(current_db_name).arg(title));
#endif
d->setMinimumSize(QSize(300, 100));
QVBoxLayout * vl = new QVBoxLayout(d);
vl->setMargin(6); vl->setSpacing(6);
QHBoxLayout * hl = new QHBoxLayout(d);
hl->setMargin(0); hl->setSpacing(6);
QLabel * lbl = new QLabel(tr("Search:"), d);
ExtendedLineEdit * sle = new ExtendedLineEdit(d);
hl->addWidget(lbl);
hl->addWidget(sle);
vl->addLayout(hl);
if (lw == NULL) { lw = new MTListWidget(d); } else { lw->setParent(d); }
QObject::connect(lw, SIGNAL(itemDoubleClicked(QListWidgetItem *)), d, SLOT(accept()));
QObject::connect(sle, SIGNAL(textChanged(QLineEdit *, const QString &)), lw, SLOT(filterItems(QLineEdit *, const QString &)));
vl->addWidget(lw);
QDialogButtonBox * bb = new QDialogButtonBox(d);
bb->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
QObject::connect(bb, SIGNAL(accepted()), d, SLOT(accept()));
QObject::connect(bb, SIGNAL(rejected()), d, SLOT(reject()));
vl->addWidget(bb);
return d;
}
示例2: editAccount
void AccountSettings::editAccount(QMailAccount *account)
{
QMailAccountConfiguration config;
if (account->id().isValid()) {
config = QMailAccountConfiguration(account->id());
} else {
account->setStatus(QMailAccount::UserEditable, true);
account->setStatus(QMailAccount::UserRemovable, true);
}
QDialog *editAccountView;
bool wasPreferred(account->status() & QMailAccount::PreferredSender);
EditAccount *e = new EditAccount(this, "EditAccount");
e->setAccount(account, &config);
editAccountView = e;
editAccountView->setMinimumSize(QSize(400,400));
int ret = editAccountView->exec();
delete editAccountView;
if (ret == QDialog::Accepted) {
QMailAccountId previousPreferredId;
if ((account->status() & QMailAccount::PreferredSender) && !wasPreferred) {
// This account is now preferred - see if there is a predecessor that must be deselected
QMailAccountKey preferredKey(QMailAccountKey::status(QMailAccount::PreferredSender, QMailDataComparator::Includes));
QMailAccountKey typeKey(QMailAccountKey::messageType(account->messageType()));
QMailAccountIdList previousIds = QMailStore::instance()->queryAccounts(preferredKey & typeKey);
if (!previousIds.isEmpty())
previousPreferredId = previousIds.first();
}
preExisting = account->id().isValid();
if (preExisting) {
QMailStore::instance()->updateAccount(account, &config);
} else {
QMailStore::instance()->addAccount(account, &config);
accountView->setCurrentIndex(accountModel->index(accountModel->rowCount() - 1, 0));
}
if ((account->status() & QMailAccount::PreferredSender) && !wasPreferred) {
if (previousPreferredId.isValid()) {
QMailAccount previousAccount(previousPreferredId);
previousAccount.setStatus(QMailAccount::PreferredSender, false);
QMailStore::instance()->updateAccount(&previousAccount);
QMessageBox::warning(this,
tr("New default account"),
tr("<qt>Your previous default mail account has been unchecked</qt>"),
QMessageBox::Ok);
}
}
QTimer::singleShot(0, this, SLOT(testConfiguration()));
}
}
示例3: configura
void GameBoard::configura()
{
//Pausa o Jogo para as Configurações
stopped();
//Cria a nova janela de configurações
QDialog *janelaconfig = new QDialog;
//Textos da nova janela e de identificação dos botões
QLabel *Titulo = new QLabel("<big><b>Configuracoes</b></big>");
QLabel *Key_Menu = new QLabel("Menu de Atalhos: ");
QLabel *Configur = new QLabel("Configurar Parametros: ");
//Caixa de organização de grupos
QGroupBox *confBox = new QGroupBox;
confBox->setCheckable(false);
confBox->setChecked(true);
//Botões da janela de configuração
QPushButton *keys = new QPushButton("Atalhos do Teclado");
QPushButton *ajuste = new QPushButton("Ajustes de Jogo");
QPushButton *voltar = new QPushButton("Voltar");
connect(keys, SIGNAL(clicked()), SLOT(Menu()));
connect(ajuste, SIGNAL(clicked()), SLOT(Settings()));
connect(voltar, SIGNAL(clicked()), this, SLOT(continueGame()));
connect(voltar, SIGNAL(clicked()), janelaconfig, SLOT(close()));
//Ajuste do Layout da Página
QGridLayout *toplay = new QGridLayout;
toplay->addWidget(Key_Menu, 0, 0);
toplay->addWidget(keys,0, 1);
toplay->addWidget(Configur, 1, 0);
toplay->addWidget(ajuste, 1, 1);
toplay->addWidget(voltar, 2, 1);
confBox->setLayout(toplay);
QVBoxLayout *leftlay = new QVBoxLayout;
leftlay->addWidget(Titulo);
leftlay->addWidget(confBox);
janelaconfig->setLayout(leftlay);
janelaconfig->setMinimumSize(300, 230);
janelaconfig->show();
}
示例4: editBookmark
void BookmarksToolbar::editBookmark()
{
QAction* act = qobject_cast<QAction*> (sender());
if (!act) {
return;
}
ToolButton* button = static_cast<ToolButton*>(act->data().value<void*>());
if (!button) {
return;
}
Bookmark b = button->data().value<Bookmark>();
QDialog* dialog = new QDialog(this);
QFormLayout* layout = new QFormLayout(dialog);
QLabel* label = new QLabel(dialog);
QLineEdit* editUrl = new QLineEdit(dialog);
QLineEdit* editTitle = new QLineEdit(dialog);
QDialogButtonBox* box = new QDialogButtonBox(dialog);
box->addButton(QDialogButtonBox::Ok);
box->addButton(QDialogButtonBox::Cancel);
connect(box, SIGNAL(rejected()), dialog, SLOT(reject()));
connect(box, SIGNAL(accepted()), dialog, SLOT(accept()));
label->setText(tr("Edit bookmark: "));
layout->addRow(label);
layout->addRow(new QLabel(tr("Title: ")), editTitle);
layout->addRow(new QLabel(tr("Url: ")), editUrl);
layout->addRow(box);
editUrl->setText(b.url.toString());
editTitle->setText(b.title);
editUrl->setCursorPosition(0);
editTitle->setCursorPosition(0);
dialog->setWindowTitle(tr("Edit Bookmark"));
dialog->setMinimumSize(400, 100);
dialog->exec();
if (dialog->result() == QDialog::Rejected) {
return;
}
QUrl url = QUrl::fromEncoded(editUrl->text().toUtf8());
QString title = editTitle->text();
if (url.isEmpty() || title.isEmpty()) {
return;
}
m_bookmarksModel->editBookmark(b.id, title, url, b.folder);
}
示例5: editFeed
void RSSManager::editFeed()
{
QString url = ui->tabWidget->tabToolTip(ui->tabWidget->currentIndex());
if (url.isEmpty()) {
return;
}
QDialog* dialog = new QDialog(this);
QFormLayout* layout = new QFormLayout(dialog);
QLabel* label = new QLabel(dialog);
QLineEdit* editUrl = new QLineEdit(dialog);
QLineEdit* editTitle = new QLineEdit(dialog);
QDialogButtonBox* box = new QDialogButtonBox(dialog);
box->addButton(QDialogButtonBox::Ok);
box->addButton(QDialogButtonBox::Cancel);
connect(box, SIGNAL(rejected()), dialog, SLOT(reject()));
connect(box, SIGNAL(accepted()), dialog, SLOT(accept()));
label->setText(tr("Fill title and URL of a feed: "));
layout->addRow(label);
layout->addRow(new QLabel(tr("Feed title: ")), editTitle);
layout->addRow(new QLabel(tr("Feed URL: ")), editUrl);
layout->addRow(box);
editUrl->setText(ui->tabWidget->tabToolTip(ui->tabWidget->currentIndex()));
editTitle->setText(ui->tabWidget->tabText(ui->tabWidget->currentIndex()));
dialog->setWindowTitle(tr("Edit RSS Feed"));
dialog->setMinimumSize(400, 100);
dialog->exec();
if (dialog->result() == QDialog::Rejected) {
return;
}
QString address = editUrl->text();
QString title = editTitle->text();
if (address.isEmpty() || title.isEmpty()) {
return;
}
QSqlQuery query;
query.prepare("UPDATE rss SET address=?, title=? WHERE address=?");
query.bindValue(0, address);
query.bindValue(1, title);
query.bindValue(2, url);
query.exec();
refreshTable();
}