本文整理汇总了C++中QDialogButtonBox::setGeometry方法的典型用法代码示例。如果您正苦于以下问题:C++ QDialogButtonBox::setGeometry方法的具体用法?C++ QDialogButtonBox::setGeometry怎么用?C++ QDialogButtonBox::setGeometry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDialogButtonBox
的用法示例。
在下文中一共展示了QDialogButtonBox::setGeometry方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QDialogButtonBox
NewSoundDialog::NewSoundDialog(QWidget *parent, const SoundController *soundController) :
QDialog(parent),
soundController(soundController),
sceneSound(nullptr)
{
this->setWindowTitle("New Sound");
this->resize(530, 160);
setupNameFields();
setupSoundFilenameFields();
setupSoundTypeFields();
QDialogButtonBox *buttonBox = new QDialogButtonBox(this);
buttonBox->setGeometry(QRect(30, 120, 475, 22));
buttonBox->setOrientation(Qt::Horizontal);
buttonBox->setStandardButtons(QDialogButtonBox::Ok|QDialogButtonBox::Cancel);
QObject::connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
QObject::connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
}
示例2: createDialogs
/**
* This method creates all the dialog boxes required for the
* scatter plot window. Called from the ScatterPlotWindow
* constructor.
*
*/
void ScatterPlotWindow::createDialogs(){
QDialogButtonBox *configButtonBox;
QLabel *label;
QLabel *label2;
QLabel *label3;
p_configDialog = new QDialog();
p_configDialog->setWindowTitle("Setup Scatter Plot");
p_configDialog->setModal(true);
configButtonBox = new QDialogButtonBox(p_configDialog);
configButtonBox->setGeometry(QRect(30, 200, 341, 32));
configButtonBox->setOrientation(Qt::Horizontal);
configButtonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok);
p_cube1Label = new QLabel(p_configDialog);
p_cube1Label->setText("Cube 1:");
p_cube1Label->setGeometry(QRect(10, 70, 75, 27));
p_cube1BandComboBox = new QComboBox(p_configDialog);
p_cube1BandComboBox->setGeometry(QRect(250, 70, 60, 22));
p_numBinsOne = new QLineEdit(p_configDialog);
p_numBinsOne->setGeometry(QRect(320, 70, 40, 22));
p_numBinsOne->setText("255");
p_numBinsTwo = new QLineEdit(p_configDialog);
p_numBinsTwo->setGeometry(QRect(320, 130, 40, 22));
p_numBinsTwo->setText("255");
p_cube2BandComboBox = new QComboBox(p_configDialog);
p_cube2BandComboBox->setGeometry(QRect(250, 130, 60, 22));
p_cube1ComboBox = new QComboBox(p_configDialog);
p_cube1ComboBox->setGeometry(QRect(55, 70, 181, 25));
QObject::connect(p_cube1ComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(fillBands()));
p_cube2ComboBox = new QComboBox(p_configDialog);
p_cube2ComboBox->setGeometry(QRect(55, 130, 181, 25));
QObject::connect(p_cube2ComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(fillBands()));
p_cube2Label = new QLabel(p_configDialog);
p_cube2Label->setText("Cube 2:");
p_cube2Label->setGeometry(QRect(10, 130, 75, 27));
label = new QLabel(p_configDialog);
label->setObjectName(QString::fromUtf8("label"));
label->setText("Band");
label->setGeometry(QRect(260, 40, 81, 20));
label2 = new QLabel(p_configDialog);
label2->setObjectName(QString::fromUtf8("label2"));
label2->setText("Select 2 Cubes (may be the same cube.)");
label2->setGeometry(QRect(10, 40, 230, 20));
label3 = new QLabel(p_configDialog);
label3->setText("# Bins");
label3->setGeometry(QRect(320,40,70,20));
QObject::connect(configButtonBox, SIGNAL(accepted()), this, SLOT(showScatterPlot()));
QObject::connect(configButtonBox, SIGNAL(accepted()), p_configDialog, SLOT(accept()));
QObject::connect(configButtonBox, SIGNAL(rejected()), this, SLOT(cancel()));
// -------- End of p_configDialog
QDialogButtonBox *minMaxButtonBox;
QLabel *label_5;
QLabel *label_4;
QLabel *label_6;
QLabel *label_2;
QLabel *label_3;
QLabel *label_0;
p_minMaxDialog = new QDialog();
p_minMaxDialog->resize(283, 300);
minMaxButtonBox = new QDialogButtonBox(p_minMaxDialog);
minMaxButtonBox->setGeometry(QRect(20, 250, 211, 32));
minMaxButtonBox->setOrientation(Qt::Horizontal);
minMaxButtonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok);
p_yMaxEdit = new QLineEdit(p_minMaxDialog);
p_yMaxEdit->setGeometry(QRect(100, 200, 113, 25));
p_yMaxEdit->setText(QString::number(p_MaxTwo));
p_yMinEdit = new QLineEdit(p_minMaxDialog);
p_yMinEdit->setGeometry(QRect(100, 160, 113, 25));
p_yMinEdit->setText(QString::number(p_MinTwo));
p_xMaxEdit = new QLineEdit(p_minMaxDialog);
p_xMaxEdit->setGeometry(QRect(100, 90, 113, 25));
p_xMaxEdit->setText(QString::number(p_MaxOne));
p_xMinEdit = new QLineEdit(p_minMaxDialog);
p_xMinEdit->setGeometry(QRect(100, 50, 113, 25));
p_xMinEdit->setText(QString::number(p_MinOne));
label_5 = new QLabel(p_minMaxDialog);
//.........这里部分代码省略.........
示例3: initUI
void FilterChoice::initUI()
{
QDialogButtonBox *buttonBox;
QLabel *label;
QLabel *label_2;
this->setWindowTitle("FilterChoice");
this->setMinimumSize(623, 374);
buttonBox = new QDialogButtonBox(this);
buttonBox->setGeometry(QRect(260, 310, 341, 32));
buttonBox->setOrientation(Qt::Horizontal);
buttonBox->setStandardButtons(QDialogButtonBox::Cancel);
QPushButton* applyButton = buttonBox->addButton(QString::fromStdString("Apply"), QDialogButtonBox::ApplyRole);
_deleteButton = buttonBox->addButton(QString::fromStdString("Delete"), QDialogButtonBox::ActionRole);
_deleteButton->setGeometry(QRect(310, 310, 98, 27));
_deleteButton->setEnabled(false);
QObject::connect(applyButton, SIGNAL(clicked()), this, SLOT(validate()));
QObject::connect(buttonBox, SIGNAL(rejected()), this, SLOT(cancel()));
QObject::connect(_deleteButton, SIGNAL(clicked()), this, SLOT(deleteFilter()));
label = new QLabel(this);
label->setText("Blur:");
label->setGeometry(QRect(70, 80, 66, 17));
label_2 = new QLabel(this);
label_2->setText("Policy");
label_2->setGeometry(QRect(60, 150, 66, 17));
_labelNumber = new QLabel(this);
_labelNumber->setText("Number of pixels:");
_labelNumber->setGeometry(QRect(30, 220, 241, 17));
_number = new QSpinBox(this);
_number->setValue(3);
_number->setMinimum(1);
_number->setGeometry(QRect(170, 210, 60, 27));
QObject::connect(_number, SIGNAL(valueChanged(const QString&)), this, SLOT(dataChanged(const QString&)));
/* INIT FILTER */
_filterView = new QTableWidget(3, 3, this);
_filterView->setGeometry(QRect(300, 20, 311, 281));
_filterView->verticalHeader()->hide();
_filterView->horizontalHeader()->hide();
_filterView->setDragEnabled(false);
_filterView->setCornerButtonEnabled(false);
int numPixels = _number->value();
for(int i = 0; i < numPixels; i++)
{
_filterView->setColumnWidth(i, _filterView->rowHeight(0));
for(int j = 0; j < numPixels; j++)
{
QTableWidgetItem* item = new QTableWidgetItem("1");
item->setTextAlignment(Qt::AlignHCenter);
item->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEnabled);
_filterView->setItem(i, j, item);
}
}
/* BLUR CHOICE */
_blurChoices = new QComboBox(this);
_blurChoices->setGeometry(QRect(140, 80, 141, 27));
QStringList blurs = QStringList();
blurs.push_back("Uniform");
blurs.push_back("Gaussian");
blurs.push_back("Prewitt");
blurs.push_back("Roberts");
blurs.push_back("Sobel");
blurs.push_back("SquareLaplacien");
_filters.push_back(Filter::uniform(3));
_filters.push_back(Filter::gaussian(1));
_filters.push_back(Filter::prewitt(3));
_filters.push_back(Filter::roberts());
_filters.push_back(Filter::sobel());
_filters.push_back(Filter::squareLaplacien());
//Personal filters
QFile file("filters.xml");
if(file.exists())
{
QDomDocument doc("");
file.open(QIODevice::ReadOnly);
doc.setContent(&file);
file.close();
QDomElement root = doc.documentElement();
QDomNode child = root.firstChild();
while(!child.isNull())
{
QDomElement e = child.toElement();
// We know how to treat appearance and geometry
blurs.push_back(e.attribute("name"));
int nbFilters = e.attribute("nbFilters").toInt();
std::vector<Filter*> temp;
QDomNode grandChild = e.firstChild();
for(int i = 0; i < nbFilters && !grandChild.isNull(); i++)
{
//.........这里部分代码省略.........