PreferencesDialog::PreferencesDialog(QWidget* parent) : QDialog(parent) { QFontMetrics fontMetrics(font()); int width = fontMetrics.width("Diagram Defaults") + 8; int height = fontMetrics.height(); listWidget = new QListWidget(); stackedWidget = new QStackedWidget(); listWidget->setIconSize(QSize(1.6 * height, 1.6 * height)); listWidget->setGridSize(QSize(width, 3.2 * height)); listWidget->setViewMode(QListView::IconMode); listWidget->setMovement(QListView::Static); listWidget->setFixedWidth(width + 1); listWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); connect(listWidget, SIGNAL(currentRowChanged(int)), stackedWidget, SLOT(setCurrentIndex(int))); setupGeneralFrame(); setupDiagramDefaultsFrame(); QWidget *widget = new QWidget(); QHBoxLayout *hLayout = new QHBoxLayout(); hLayout->addWidget(listWidget); hLayout->addWidget(stackedWidget, 100); hLayout->setSpacing(16); widget->setLayout(hLayout); QVBoxLayout* vLayout = new QVBoxLayout(); vLayout->addWidget(widget, 100); vLayout->addWidget(createButtonBox()); setLayout(vLayout); setWindowTitle("Preferences"); resize(500, 500); }
/* * createAnimationDialog - Create animation dialog. * * parameter styleSheet - const GLMotif::StyleSheet& */ void AnimationDialog::createAnimationDialog(const GLMotif::StyleSheet& styleSheet) { GLMotif::RowColumn* animationDialog = new GLMotif::RowColumn("AnimationDialog", this, false); GLMotif::RowColumn* buttonBox = createButtonBox(animationDialog); buttonBox->manageChild(); GLMotif::RowColumn* timeStepBox = createTimeStepBox(animationDialog); timeStepBox->manageChild(); animationDialog->manageChild(); }
void CAlgorithmPanel::createLayout() { thisLayout = new QVBoxLayout; thisLayout->addWidget(singleRadio); thisLayout->addWidget(multiRadio); thisLayout->addWidget(infoLabel); thisLayout->addWidget(createCheckAlgorithmBox()); thisLayout->addWidget(createButtonBox()); thisLayout->addWidget(createUsedAlgorithmBox()); thisLayout->addWidget(buttonSave); this->setLayout(thisLayout); }
DiagramToolBox::DiagramToolBox(DiagramView* diagramView) : QWidget() { mDiagramView = diagramView; createActions(); QVBoxLayout* vLayout = new QVBoxLayout(); vLayout->addWidget(createButtonBox()); vLayout->addWidget(createTreeWidget(), 100); setLayout(vLayout); setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding); connect(mDiagramView, SIGNAL(modeChanged(DrawingView::Mode)), this, SLOT(updateDiagramMode(DrawingView::Mode))); }
ConnectionDialog::ConnectionDialog(QWidget *parent) : QDialog(parent) { QGroupBox *inputBox= creatInputWidget(); QDialogButtonBox *buttonBox= createButtonBox(); readSettings(); QVBoxLayout *layout= new QVBoxLayout; layout->addWidget(inputBox); layout->addWidget( buttonBox); setLayout( layout); setWindowTitle("Connection a la BDD"); }
/* * createContoursDialog - Create color map dialog. * * parameter styleSheet - const GLMotif::StyleSheet& */ void Contours::createContoursDialog(const GLMotif::StyleSheet& styleSheet) { GLMotif::RowColumn* contoursDialog = new GLMotif::RowColumn("ContoursDialog", this, false); GLMotif::Label * contourLabel = new GLMotif::Label( "ContourLabel", contoursDialog, "Contours"); contourLabel->setString("Contour"); createAlphaComponent(styleSheet, contoursDialog); GLMotif::RowColumn* buttonBox = createButtonBox(contoursDialog); buttonBox->manageChild(); GLMotif::Label * sliceContourLabel = new GLMotif::Label( "SliceContourLabel", contoursDialog, "SliceContours"); sliceContourLabel->setString("Slice Contours"); createXYZContours(styleSheet, contoursDialog); contoursDialog->manageChild(); }
SaveChangesDialog::SaveChangesDialog(bool showDiscardButton, QWidget *parent) : QDialog(parent), currentCnPage(0) { setWindowTitle(tr("Save changes")); QVBoxLayout *mainLayout = new QVBoxLayout(); createTreeAndPreviewPane(mainLayout); createButtonBox(mainLayout, showDiscardButton); setLayout(mainLayout); resize(650, 400); }
Dialog::Dialog(QWidget *parent) : QDialog(parent) { createRotableGroupBox(); createOptionsGroupBox(); createButtonBox(); mainLayout = new QGridLayout; mainLayout->addWidget(rotableGroupBox, 0, 0); mainLayout->addWidget(optionsGroupBox, 1, 0); mainLayout->addWidget(buttonBox, 2, 0); setLayout(mainLayout); mainLayout->setSizeConstraint(QLayout::SetMinimumSize); setWindowTitle(tr("Dynamic Layouts")); }
QT_BEGIN_NAMESPACE NewForm::NewForm(QDesignerWorkbench *workbench, QWidget *parentWidget, const QString &fileName) : QDialog(parentWidget, #ifdef Q_WS_MAC Qt::Tool | #endif Qt::WindowTitleHint | Qt::WindowSystemMenuHint), m_fileName(fileName), m_newFormWidget(QDesignerNewFormWidgetInterface::createNewFormWidget(workbench->core())), m_workbench(workbench), m_chkShowOnStartup(new QCheckBox(tr("Show this Dialog on Startup"))), m_createButton(new QPushButton(QApplication::translate("NewForm", "C&reate", 0, QApplication::UnicodeUTF8))), m_recentButton(new QPushButton(QApplication::translate("NewForm", "Recent", 0, QApplication::UnicodeUTF8))), m_buttonBox(0) { setWindowTitle(tr("New Form")); QDesignerSettings settings(m_workbench->core()); QVBoxLayout *vBoxLayout = new QVBoxLayout; connect(m_newFormWidget, SIGNAL(templateActivated()), this, SLOT(slotTemplateActivated())); connect(m_newFormWidget, SIGNAL(currentTemplateChanged(bool)), this, SLOT(slotCurrentTemplateChanged(bool))); vBoxLayout->addWidget(m_newFormWidget); QFrame *horizontalLine = new QFrame; horizontalLine->setFrameShape(QFrame::HLine); horizontalLine->setFrameShadow(QFrame::Sunken); vBoxLayout->addWidget(horizontalLine); m_chkShowOnStartup->setChecked(settings.showNewFormOnStartup()); vBoxLayout->addWidget(m_chkShowOnStartup); m_buttonBox = createButtonBox(); vBoxLayout->addWidget(m_buttonBox); setLayout(vBoxLayout); resize(500, 400); slotCurrentTemplateChanged(m_newFormWidget->hasCurrentTemplate()); }
PropertiesDialog::PropertiesDialog(QWidget * parent) :QDialog(parent) { createCoverBox(); createGeneralInfoBox(); createAuthorsBox(); createPublishingBox(); createButtonBox(); createPlotBox(); createTabBar(); mainLayout = new QGridLayout; //mainLayout->addWidget(coverBox,0,0); mainLayout->addWidget(tabBar,0,1); mainLayout->setColumnStretch(1,1); /*mainLayout->addWidget(authorsBox,1,1); mainLayout->addWidget(publishingBox,2,1);*/ mainLayout->addWidget(buttonBox,1,1,Qt::AlignBottom); mainWidget = new QWidget(this); mainWidget->setAutoFillBackground(true); mainWidget->setFixedSize(470,444); mainWidget->setLayout(mainLayout); mainLayout->setSizeConstraint(QLayout::SetMinimumSize); int heightDesktopResolution = QApplication::desktop()->screenGeometry().height(); int widthDesktopResolution = QApplication::desktop()->screenGeometry().width(); int sHeight,sWidth; sHeight = static_cast<int>(heightDesktopResolution*0.65); sWidth = static_cast<int>(sHeight*1.4); //setCover(QPixmap(":/images/notCover.png")); this->move(QPoint((widthDesktopResolution-sWidth)/2,((heightDesktopResolution-sHeight)-40)/2)); setModal(true); setFixedSize( sizeHint() ); mainWidget->move(280,0); }
// --------------- QDesignerPromotionDialog QDesignerPromotionDialog::QDesignerPromotionDialog(QDesignerFormEditorInterface *core, QWidget *parent, const QString &promotableWidgetClassName, QString *promoteTo) : QDialog(parent), m_mode(promotableWidgetClassName.isEmpty() || promoteTo == 0 ? ModeEdit : ModeEditChooseClass), m_promotableWidgetClassName(promotableWidgetClassName), m_core(core), m_promoteTo(promoteTo), m_promotion(core->promotion()), m_model(new PromotionModel(core)), m_treeView(new QTreeView), m_buttonBox(0), m_removeButton(new QPushButton(createIconSet(QString::fromUtf8("minus.png")), QString())) { m_buttonBox = createButtonBox(); setModal(true); setWindowTitle(tr("Promoted Widgets")); setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); QVBoxLayout *vboxLayout = new QVBoxLayout(this); // tree view group QGroupBox *treeViewGroup = new QGroupBox(); treeViewGroup->setTitle(tr("Promoted Classes")); QVBoxLayout *treeViewVBoxLayout = new QVBoxLayout(treeViewGroup); // tree view m_treeView->setModel (m_model); m_treeView->setMinimumWidth(450); m_treeView->setContextMenuPolicy(Qt::CustomContextMenu); connect(m_treeView->selectionModel(), SIGNAL(selectionChanged(QItemSelection, QItemSelection)), this, SLOT(slotSelectionChanged(QItemSelection, QItemSelection))); connect(m_treeView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(slotTreeViewContextMenu(QPoint))); QHeaderView *headerView = m_treeView->header(); headerView->setResizeMode(QHeaderView::ResizeToContents); treeViewVBoxLayout->addWidget(m_treeView); // remove button QHBoxLayout *hboxLayout = new QHBoxLayout(); hboxLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Ignored)); m_removeButton->setAutoDefault(false); connect(m_removeButton, SIGNAL(clicked()), this, SLOT(slotRemove())); m_removeButton->setEnabled(false); hboxLayout->addWidget(m_removeButton); treeViewVBoxLayout->addLayout(hboxLayout); vboxLayout->addWidget(treeViewGroup); // Create new panel: Try to be smart and preselect a base class. Default to QFrame const QStringList &baseClassNameList = baseClassNames(m_promotion); int preselectedBaseClass = -1; if (m_mode == ModeEditChooseClass) { preselectedBaseClass = baseClassNameList.indexOf(m_promotableWidgetClassName); } if (preselectedBaseClass == -1) preselectedBaseClass = baseClassNameList.indexOf(QLatin1String("QFrame")); NewPromotedClassPanel *newPromotedClassPanel = new NewPromotedClassPanel(baseClassNameList, preselectedBaseClass); connect(newPromotedClassPanel, SIGNAL(newPromotedClass(PromotionParameters, bool *)), this, SLOT(slotNewPromotedClass(PromotionParameters, bool *))); connect(this, SIGNAL(selectedBaseClassChanged(QString)), newPromotedClassPanel, SLOT(chooseBaseClass(QString))); vboxLayout->addWidget(newPromotedClassPanel); // button box vboxLayout->addWidget(m_buttonBox); // connect model connect(m_model, SIGNAL(includeFileChanged(QDesignerWidgetDataBaseItemInterface*, QString)), this, SLOT(slotIncludeFileChanged(QDesignerWidgetDataBaseItemInterface*, QString))); connect(m_model, SIGNAL(classNameChanged(QDesignerWidgetDataBaseItemInterface*, QString)), this, SLOT(slotClassNameChanged(QDesignerWidgetDataBaseItemInterface*, QString))); // focus if (m_mode == ModeEditChooseClass) newPromotedClassPanel->grabFocus(); slotUpdateFromWidgetDatabase(); }