本文整理汇总了C++中QDialog::resize方法的典型用法代码示例。如果您正苦于以下问题:C++ QDialog::resize方法的具体用法?C++ QDialog::resize怎么用?C++ QDialog::resize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDialog
的用法示例。
在下文中一共展示了QDialog::resize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: editGraphClicked
void AnimCurveControl::editGraphClicked() {
#ifdef SEEXPR_USE_ANIMLIB
QDialog* dialog = new QDialog(this);
CETool* tool = new CETool;
animlib::AnimAttrID attr1("", "");
animlib::AnimCurve& anim = *new animlib::AnimCurve(attr1);
anim = _editable->curve;
QWidget* widg;
tool->map(widg, 0);
QVBoxLayout* layout = new QVBoxLayout();
dialog->resize(QSize(1024, 640));
dialog->setLayout(layout);
layout->addWidget(widg);
tool->addCurve(&anim);
QDialogButtonBox* buttonbar = new QDialogButtonBox();
buttonbar->setStandardButtons(QDialogButtonBox::Cancel | QDialogButtonBox::Ok);
connect(buttonbar, SIGNAL(accepted()), dialog, SLOT(accept()));
connect(buttonbar, SIGNAL(rejected()), dialog, SLOT(reject()));
layout->addWidget(buttonbar);
if (dialog->exec() == QDialog::Accepted) {
// copy points back from child
_editable->curve = anim;
_preview->sample(_editable->curve);
_preview->repaint();
emit controlChanged(_id);
}
#endif
}
示例2: on_Paste__released
void UserFilters::on_Paste__released ()
{
auto edit = new QPlainTextEdit ();
QDialog dia (this);
dia.setWindowTitle (tr ("Paste rules"));
dia.resize (600, 400);
dia.setLayout (new QVBoxLayout ());
dia.layout ()->addWidget (new QLabel (tr ("Paste your custom rules here:")));
dia.layout ()->addWidget (edit);
auto box = new QDialogButtonBox (QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
dia.layout ()->addWidget (box);
connect (box,
SIGNAL (accepted ()),
&dia,
SLOT (accept ()));
connect (box,
SIGNAL (rejected ()),
&dia,
SLOT (reject ()));
if (dia.exec () != QDialog::Accepted)
return;
AddMulti (Model_, edit->toPlainText ());
}
示例3: QDialog
void Fix8Log::aboutSlot()
{
QDialog *aboutDialog = new QDialog();
QVBoxLayout *aboutLayout = new QVBoxLayout(0);
QDialogButtonBox *dialogButtonBox = new QDialogButtonBox();
dialogButtonBox->addButton(QDialogButtonBox::Ok);
connect(dialogButtonBox,SIGNAL(clicked(QAbstractButton*)),
aboutDialog,SLOT(close()));
QQuickView *aboutView = new QQuickView(QUrl("qrc:qml/helpAbout.qml"));
QQuickItem *qmlObject = aboutView->rootObject();
qmlObject->setProperty("color",aboutDialog->palette().color(QPalette::Window));
qmlObject->setProperty("bgColor",aboutDialog->palette().color(QPalette::Window));
qmlObject->setProperty("version",QString::number(Globals::version));
aboutView->setResizeMode(QQuickView::SizeRootObjectToView);
QWidget *aboutWidget = QWidget::createWindowContainer(aboutView,0);
aboutWidget->setPalette(aboutDialog->palette());
aboutWidget->setAutoFillBackground(false);
aboutDialog->setLayout(aboutLayout);
aboutLayout->addWidget(aboutWidget,1);
aboutLayout->addWidget(dialogButtonBox,0);
aboutDialog->resize(500,400);
aboutDialog->setWindowTitle(GUI::Globals::appName);
aboutDialog->exec();
aboutDialog->deleteLater();
}
示例4: displayFile
void AboutDialog::displayFile(const QString &fileName, const QString &title)
{
QDialog *dialog = new QDialog(this);
QLayout *layout = new QVBoxLayout(dialog);
QTextEdit *textEdit = new QTextEdit(dialog);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close, Qt::Horizontal, dialog);
textEdit->setStyleSheet(QLatin1String("font-family: monospace"));
QFile file(fileName);
if (file.open(QIODevice::ReadOnly)) {
QString text = QTextStream(&file).readAll();
textEdit->setPlainText(text);
}
textEdit->setReadOnly(true);
connect(buttonBox, SIGNAL(rejected()), dialog, SLOT(close()));
buttonBox->setCenterButtons(true);
layout->addWidget(textEdit);
layout->addWidget(buttonBox);
layout->setMargin(6);
dialog->setLayout(layout);
dialog->setWindowTitle(title);
dialog->setWindowFlags(Qt::Sheet);
dialog->resize(600, 350);
dialog->exec();
}
示例5: main
int main(int argc,char** argv){
QApplication app(argc,argv);
QDialog *parent;
QLineEdit *add;
QLabel *oper;
QLineEdit *added;
QPushButton *equ;
QLineEdit *res;
/* 指针赋值 */
parent=new QDialog();
parent->resize(650,300);
/* 给界面中组件指针赋值 */
add=new QLineEdit(parent);
oper=new QLabel("+",parent);
added=new QLineEdit(parent);
equ=new QPushButton("=",parent);
res=new QLineEdit(parent);
/* 调整位置 */
add->move(20,130);
oper->move(170,130);
added->move(220,130);
equ->move(360,130);
res->move(470,130);
parent->show();
return app.exec();
}
示例6: showabout
void showabout()
{
QDialog vedit;
vedit.setWindowTitle(QObject::tr("About vedit"));
vedit.contentsRect();
vedit.resize(300, 150);
vedit.exec();
}
示例7: insertWord
void newWordManageWindow::insertWord(QString spell, QString meaning)
{
QDialog *dialog = new QDialog(addDialog);
dialog->setWindowTitle("重复");
dialog->resize(200, 110);
QLabel *label = new QLabel(dialog);
QLabel *labelText = new QLabel(dialog);
label->setStyleSheet("background-color:lightblue");
labelText->setAlignment(Qt::AlignCenter);
labelText->setGeometry(30, 0, 140, 70);
label->setGeometry(0, 0, this->width(), this->height());
QPushButton *yesButton = new QPushButton(dialog);
yesButton->setGeometry(140, 70, 55, 20);
yesButton->setText("返回");
yesButton->setStyleSheet("color:black");
bool fail = false;
if(spell.size()==0)
{
labelText->setText("单词不能为空!");
fail = true;
}
else if(meaning.size()==0)
{
labelText->setText("释义不能为空!");
fail = true;
}
for(int i=0; i<newWordList.size(); i++)
{
if(newWordList[i].spell==spell)
{
labelText->setText("您已经添加过这个生词了!");
}
fail = true;
break;
}
if(fail)
{
dialog->show();
connect(yesButton,SIGNAL(clicked()), dialog, SLOT(close()));
}
if(!fail)
{
QDateTime sysTime = QDateTime::currentDateTime();
QStringList list = sysTime.toString("yyyy-MM-dd").split('-');
QString time = list[0]+list[1]+list[2];
NEWWORD newword = { meaning, spell, time };
newWordList.push_front(newword);
qDebug() << currentPage << " " << TotalPages;
update();
}
}
示例8: maximizeFirstGantt
// maximize first gantt
void MainWidget::maximizeFirstGantt()
{
QDialog *temp = new QDialog(this);
QVBoxLayout *tempLayout = new QVBoxLayout(temp);
// temp->setAttribute(Qt::WA_DeleteOnClose);
temp->resize(1600, 900);
tempLayout->addWidget(max1);
temp->setLayout(tempLayout);
temp->show();
}
示例9: main
int main(int argc,char *argv[])
{
QApplication a(argc,argv);
QTextCodec::setCodecForTr(QTextCodec::codecForLocale());
QDialog w;
w.resize(400,300);
QLabel label(&w);
label.move(120,120);
label.setText(QObject::tr("Hello World!ÄãºÃQt£¡"));
w.show();
return a.exec();
}
示例10: QDialog
/************
*
*功能:帮助操作界面
*
*
*
**/
void mainview::helpoperator()
{
QDialog *dialog = new QDialog();
dialog->setWindowTitle("帮助");
dialog->resize(800,600);
//QPushButton *button_ok = new QPushButton("OK",dialog);
QWebView *view = new QWebView(dialog);
//view->setGeometry(0,0,800,550);
//button_ok->setGeometry(550,750,50,50);
//view->load(QUrl("http://10.3.3.59/index.php?r=help/index"));
view->load(QUrl("./help.html"));
//connect(button_ok,SIGNAL(clicked()),dialog,SLOT(close()));
dialog->exec();
}
示例11: showDialog
void UpdateDetector::showDialog()
{
// if the version tag is set, there is a newer version.
QString ver = QString::fromLatin1("%1.%2.%3")
.arg(MIRALL_VERSION_MAJOR).arg(MIRALL_VERSION_MINOR).arg(MIRALL_VERSION_MICRO);
QDialog *msgBox = new QDialog;
QIcon info = msgBox->style()->standardIcon(QStyle::SP_MessageBoxInformation, 0, 0);
int iconSize = msgBox->style()->pixelMetric(QStyle::PM_MessageBoxIconSize, 0, 0);
msgBox->setWindowIcon(info);
QVBoxLayout *layout = new QVBoxLayout(msgBox);
QHBoxLayout *hlayout = new QHBoxLayout;
layout->addLayout(hlayout);
msgBox->setWindowTitle(tr("New Version Available"));
QLabel *ico = new QLabel;
ico->setFixedSize(iconSize, iconSize);
ico->setPixmap(info.pixmap(iconSize));
QLabel *lbl = new QLabel;
QString txt = tr("<p>A new version of the %1 Client is available.</p>"
"<p><b>%2</b> is available for download. The installed version is %3.<p>")
.arg(Theme::instance()->appNameGUI()).arg(ocClient.versionstring()).arg(ver);
lbl->setText(txt);
lbl->setTextFormat(Qt::RichText);
lbl->setWordWrap(true);
hlayout->addWidget(ico);
hlayout->addWidget(lbl);
QDialogButtonBox *bb = new QDialogButtonBox;
QPushButton *skip = bb->addButton(tr("Skip update"), QDialogButtonBox::ResetRole);
QPushButton *reject = bb->addButton(tr("Skip this time"), QDialogButtonBox::AcceptRole);
QPushButton *getupdate = bb->addButton(tr("Get update"), QDialogButtonBox::AcceptRole);
connect(skip, SIGNAL(clicked()), msgBox, SLOT(reject()));
connect(reject, SIGNAL(clicked()), msgBox, SLOT(reject()));
connect(getupdate, SIGNAL(clicked()), msgBox, SLOT(accept()));
connect(skip, SIGNAL(clicked()), SLOT(slotSetVersionSeen()));
connect(getupdate, SIGNAL(clicked()), SLOT(slotOpenUpdateUrl()));
layout->addWidget(bb);
msgBox->open();
msgBox->resize(400, msgBox->sizeHint().height());
}
示例12: newStation
void RadioView::newStation() {
QDialog *dia = new QDialog(this);
Ui_AddRadioDialog *ard = new Ui_AddRadioDialog;
ard->setupUi(dia);
ard->addRadioDialogLabel->setPixmap(IconManager::pixmap("addradiodialog", 32));
dia->resize(300, 100);
if (dia->exec() == QDialog::Accepted) {
if (!ard->title->text().isEmpty() && !ard->url->text().isEmpty()) {
Config::instance()->addRadioStation(ard->title->text(), ard->url->text());
connected();
}
}
delete dia;
}
示例13: restoreState
//-----------------------------------------------------------------------------
void ctkSettings::restoreState(const QString& key, QDialog& dialog)
{
this->beginGroup(key);
if(this->contains("Size"))
{
dialog.resize(this->value("Size").toSize());
}
if(this->contains("Position"))
{
dialog.move(this->value("Position").toPoint());
}
this->endGroup();
}
示例14: shaderMenuCallback
void OpenGLQtMenu::shaderMenuCallback(QObject* obj) {
QSize id = qobject_cast<QAction*>(obj)->data().toSize();
int shaderId = id.width();
int type = id.height();
const std::vector<Shader*> shaders{ShaderManager::getPtr()->getShaders()};
auto it = std::find_if(shaders.begin(), shaders.end(), [shaderId](Shader* shader) -> bool {
return static_cast<int>(shader->getID()) == shaderId;
});
if (it != shaders.end()) {
ShaderObject* shaderObj;
switch (type) {
case 1:
shaderObj = (*it)->getVertexShaderObject();
break;
case 2:
shaderObj = (*it)->getGeometryShaderObject();
break;
case 3:
shaderObj = (*it)->getFragmentShaderObject();
break;
default:
return;
}
QMainWindow* win =
static_cast<InviwoApplicationQt*>(InviwoApplication::getPtr())->getMainWindow();
QTextBrowser* shadercode = new QTextBrowser(nullptr);
shadercode->setText(shaderObj->print(true).c_str());
shadercode->setStyleSheet("font: 12pt \"Courier\";");
QDialog* dialog = new QDialog(win);
QGridLayout* layout = new QGridLayout(dialog);
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
layout->addWidget(shadercode);
dialog->setLayout(layout);
dialog->resize(600, 800);
dialog->exec();
delete dialog;
}
}
示例15: toggleConsole
void StandAloneJSConsole::toggleConsole() {
QMainWindow* mainWindow = qApp->getWindow();
if (!_jsConsole && !qApp->getLoginDialogPoppedUp()) {
QDialog* dialog = new QDialog(mainWindow, Qt::WindowStaysOnTopHint);
QVBoxLayout* layout = new QVBoxLayout(dialog);
dialog->setLayout(layout);
dialog->resize(QSize(CONSOLE_WIDTH, CONSOLE_HEIGHT));
layout->setMargin(0);
layout->setSpacing(0);
layout->addWidget(new JSConsole(dialog));
dialog->setWindowOpacity(CONSOLE_WINDOW_OPACITY);
dialog->setWindowTitle(CONSOLE_TITLE);
_jsConsole = dialog;
}
_jsConsole->setVisible(!_jsConsole->isVisible());
}