void MetadataDialog::build() { HelpWidget *help = new HelpWidget(32, tr("Pour être placées dans le Cloud, " "les sauvegardes doivent être signées. " "Ces signatures sont écrites dans un fichier " "nommé metadata.xml, normalement situé " "dans le même dossier que vos sauvegardes.\n" "Pour trouver votre numéro d'utilisateur, " "regardez le nom du dossier où se trouve vos sauvegardes. " "Si vous ne voyez pas, essayez en laissant le champ vide.\n" "Par défaut Hyne tente de signer les sauvegardes " "automatiquement, mais en cas d'erreur, vous pouvez " "essayer de le faire manuellement ici.")); _path = new QLineEdit(this); _pathButton = new QPushButton(tr("Parcourir..."), this); QHBoxLayout *pathLayout = new QHBoxLayout; pathLayout->addWidget(_path); pathLayout->addWidget(_pathButton); pathLayout->setContentsMargins(QMargins()); _userID = new QLineEdit(this); QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this); connect(buttonBox, SIGNAL(accepted()), SLOT(accept())); connect(buttonBox, SIGNAL(rejected()), SLOT(reject())); _formWidget = new QWidget(this); QFormLayout *formLayout = new QFormLayout(_formWidget); formLayout->addRow(tr("metadata.xml"), pathLayout); formLayout->addRow(tr("Numéro d'utilisateur"), _userID); formLayout->setContentsMargins(QMargins()); QVBoxLayout *layout = new QVBoxLayout(this); layout->addWidget(help); layout->addWidget(_formWidget); layout->addStretch(); layout->addWidget(buttonBox); connect(_pathButton, SIGNAL(clicked()), SLOT(setMetadataPath())); }
TimeWidget::TimeWidget(TimeView& timeView) : timeView(timeView), lastTimeInfoTimeStamp(0) { table = new QTableWidget(); table->setColumnCount(4); QStringList headerNames; headerNames << "Stopwatch" << "Min" << "Max" << "Avg"; table->setHorizontalHeaderLabels(headerNames); table->verticalHeader()->setVisible(false); table->verticalHeader()->setResizeMode(QHeaderView::Fixed); table->verticalHeader()->setDefaultSectionSize(15); table->horizontalHeader()->setResizeMode(3, QHeaderView::Stretch); table->setEditTriggers(QAbstractItemView::NoEditTriggers); table->setAlternatingRowColors(true); table->setSortingEnabled(true); table->setShowGrid(false); //initial sort by name QVBoxLayout* layout = new QVBoxLayout(this); QHBoxLayout* filterLayout = new QHBoxLayout(); filterLayout->addWidget(new QLabel(" Filter: ")); QLineEdit* filterEdit = new QLineEdit(); filterEdit->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); filterLayout->addWidget(filterEdit); filterLayout->setContentsMargins(QMargins()); frequency = new QLabel(" Frequency: "); layout->setSpacing(0); layout->addSpacing(2); layout->addWidget(frequency); layout->addSpacing(2); layout->addLayout(filterLayout); layout->addWidget(table); layout->setContentsMargins(QMargins()); this->setLayout(layout); lastTimeInfoTimeStamp = SystemCall::getCurrentSystemTime(); lastUpdate = SystemCall::getCurrentSystemTime(); QObject::connect(filterEdit,SIGNAL(textChanged(QString)),this,SLOT(filterChanged(QString))); QSettings& settings = RoboCupCtrl::application->getLayoutSettings(); settings.beginGroup(timeView.fullName); table->horizontalHeader()->restoreState(settings.value("HeaderState").toByteArray()); table->sortItems(settings.value("SortBy").toInt(), (Qt::SortOrder) settings.value("SortOrder").toInt()); filter = settings.value("Filter").toString(); filterEdit->setText(filter); settings.endGroup(); }
KKSliderVolume::KKSliderVolume( QGraphicsItem *parent /*= NULL*/ ) : KFrameItem(parent) , m_timerid(0) { KWidget *itemParent = qobject_cast<KWidget*>(parent->toGraphicsObject()); QGraphicsView *itemView = itemParent->view(); m_pWindow = new KBubbleTip(itemView); m_pWindow->setSceneMargins(QMargins(0,0,0,0)); KWidget *root = m_pWindow->rootWidget(); m_sliderPannel = new KFrameItem(root); root->addItem(m_sliderPannel); m_sliderPannel->setFrameType(KFrameItem::GridFour); m_sliderPannel->setLayoutType(KWidget::VBox); m_sliderFrame = new KSpacer(m_sliderPannel); m_sliderFrame->setLayoutType(KWidget::VBox); m_sliderFrame->setGrayToDisable(true); m_slider = new KSlider(m_sliderFrame); m_slider->setOrientation(Qt::Vertical); m_slider->setRange(0, 1.0); m_mute = new KFrameItem(m_sliderPannel); m_sliderFrame->addItem(m_slider); m_sliderPannel->addItem(m_sliderFrame); m_sliderPannel->addItem(m_mute); setAcceptHover(true); m_popupSize = QSize(20,100); m_mute->setFixHeight(20); m_mute->setAcceptClick(true); m_sliderPannel->setMargins(QMargins(0,0,0,0)); m_sliderPannel->setDefaultFrame(KFrameItem::RectWhite); m_sliderPannel->setFrameType(KFrameItem::GridFour); m_sliderPannel->setZValue(100); m_mute->setFrameSwitch(false); setFrameSwitch(false); m_pWindow->setTarget(this); m_pWindow->setDirection(KFollowWindow::TopCenter); m_pWindow->hide(); QObject::connect(m_mute, SIGNAL(clicked()), this, SLOT(on_mute_clicked())); QObject::connect(m_slider, SIGNAL(valueChanged(qreal)), this, SIGNAL(valueChanged(qreal))); }
void CFramelessWindow::showFullScreen() { if (isMaximized()) { QMainWindow::setContentsMargins(m_margins); m_frames = QMargins(); } QMainWindow::showFullScreen(); }
void QVistaHelper::updateCustomMargins(bool vistaMargins) { if (QWindow *window = wizard->windowHandle()) { // Reduce top frame to zero since we paint it ourselves. Use // device pixel to avoid rounding errors. const QMargins customMarginsDp = vistaMargins ? QMargins(0, -titleBarSizeDp(), 0, 0) : QMargins(); const QVariant customMarginsV = qVariantFromValue(customMarginsDp); // The dynamic property takes effect when creating the platform window. window->setProperty("_q_windowsCustomMargins", customMarginsV); // If a platform window exists, change via native interface. if (QPlatformWindow *platformWindow = window->handle()) { QGuiApplication::platformNativeInterface()-> setWindowProperty(platformWindow, QStringLiteral("WindowsCustomMargins"), customMarginsV); } } }
void AbstractBox::resizeMaxHeight(int32 newWidth, int32 maxHeight) { if (width() != newWidth || _maxHeight != maxHeight) { QRect g(geometry()); _maxHeight = maxHeight; resize(newWidth, countHeight()); if (parentWidget()) { parentWidget()->update(geometry().united(g).marginsAdded(QMargins(st::boxShadow.pxWidth(), st::boxShadow.pxHeight(), st::boxShadow.pxWidth(), st::boxShadow.pxHeight()))); } } }
void CLabel::createLayout() { m_pHLayout = new QHBoxLayout; m_pHLayout->setSpacing(6); m_pHLayout->setContentsMargins(QMargins(5, 0, 5, 0)); m_pHLayout->addWidget(m_pLabelIcon); m_pHLayout->addWidget(m_pLabelText); this->setLayout(m_pHLayout); }
QMargins QHaikuWindow::frameMargins() const { const BRect decoratorFrame = m_window->DecoratorFrame(); const BRect frame = m_window->Frame(); return QMargins(frame.left - decoratorFrame.left, frame.top - decoratorFrame.top, decoratorFrame.right - frame.right, decoratorFrame.bottom - frame.bottom); }
SimpleCodeStylePreferencesWidget::SimpleCodeStylePreferencesWidget(QWidget *parent) : QWidget(parent), m_preferences(0) { m_tabSettingsWidget = new TabSettingsWidget(this); QVBoxLayout *layout = new QVBoxLayout(this); layout->addWidget(m_tabSettingsWidget); layout->setContentsMargins(QMargins()); m_tabSettingsWidget->setEnabled(false); }
void PopupMenu::enterEvent(QEvent *e) { QPoint mouse = QCursor::pos(); if (!_inner.marginsRemoved(QMargins(0, _st.skip, 0, _st.skip)).contains(mapFromGlobal(mouse))) { if (_mouseSelection && _childMenuIndex < 0) { _mouseSelection = false; setSelected(-1); } } return TWidget::enterEvent(e); }
QMetaObjectEditor::QMetaObjectEditor(QWidget* parent) : QWidget(parent) { QVBoxLayout* layout = new QVBoxLayout(); layout->setContentsMargins(QMargins()); layout->setAlignment(Qt::AlignTop); setLayout(layout); layout->addWidget(_box = new QComboBox()); connect(_box, SIGNAL(currentIndexChanged(int)), SLOT(updateMetaObject())); foreach (const QMetaObject* metaObject, Bitstream::getMetaObjectSubClasses(&SharedObject::staticMetaObject)) { _box->addItem(metaObject->className(), QVariant::fromValue(metaObject)); }
GmacsMainField::GmacsMainField(QWidget *parent) : QWidget(parent) { edit_area = new GmacsTextField(); status_bar = new GmacsStatusBar();; layout = new QVBoxLayout(); layout->setSpacing(0); layout->setContentsMargins(QMargins(0, 0, 0, 0)); layout->addWidget(edit_area); layout->addWidget(status_bar); setLayout(layout); }
CSVWorld::SceneToolMode::SceneToolMode (SceneToolbar *parent) : SceneTool (parent), mButtonSize (parent->getButtonSize()), mIconSize (parent->getIconSize()) { mPanel = new QFrame (this, Qt::Popup); mLayout = new QHBoxLayout (mPanel); mLayout->setContentsMargins (QMargins (0, 0, 0, 0)); mPanel->setLayout (mLayout); }
void TTriadEditor::buildWidget() { QVBoxLayout *layout = new QVBoxLayout(this); tabWidget = new QTabWidget(this); tabWidget->addTab(buildPage1(), tr("Cartes")); tabWidget->addTab(buildPage2(), tr("Règles")); layout->addWidget(tabWidget); layout->setContentsMargins(QMargins()); }
LoadingDialog::LoadingDialog(QWidget *parent) : QDialog(parent) { //Modal = true; setWindowTitle("Loading Route..."); iconArea = new QLabel(); iconArea->setObjectName("iconArea"); iconArea->setFrameStyle(QFrame::StyledPanel); iconArea->setMinimumSize(QSize(210, 210)); iconArea->setPixmap(QPixmap(":/RWMapMaker/Resources/MapMakerPersp-ico.png")); iconArea->setAlignment(Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop); logText = new QLabel(); logText->setObjectName("logText"); logText->setFrameStyle(QFrame::StyledPanel); logText->setMinimumSize(QSize(240, 192)); logText->setMaximumSize(QSize(480, 240)); logText->setAlignment(Qt::AlignLeft|Qt::AlignTop); logText->setWordWrap(true); cancelButton = new QPushButton(); cancelButton->setObjectName("cancelButton"); cancelButton->setText("Abort"); cancelButton->setShortcut(QKeySequence("Esc")); cancelButton->setMinimumSize(QSize(48, 12)); connect(cancelButton, SIGNAL(clicked()), this, SLOT(doAbort())); progressBar = new QProgressBar(); progressBar->setObjectName("progressBar"); progressBar->setFormat("%v (%p%)"); progressBar->setAlignment(Qt::AlignCenter); row1Layout = new QHBoxLayout(); row1Layout->setObjectName("row1Layout"); row1Layout->setSpacing(12); row1Layout->addWidget(iconArea); row1Layout->addWidget(logText); row2Layout = new QHBoxLayout(); row2Layout->setObjectName("row2Layout"); row2Layout->setSpacing(12); row2Layout->addWidget(this->cancelButton); row2Layout->addStretch(1); col1Layout = new QVBoxLayout(); col1Layout->setObjectName("col1Layout"); col1Layout->setSpacing(12); col1Layout->setContentsMargins(QMargins(10,10,10,5)); col1Layout->addLayout(this->row1Layout); col1Layout->addWidget(this->progressBar); col1Layout->addLayout(this->row2Layout); setLayout(col1Layout); }
void MiscEditor::buildWidget() { QVBoxLayout *layout = new QVBoxLayout(this); tabWidget = new QTabWidget(this); tabWidget->addTab(buildPage1(), tr("Divers")); tabWidget->addTab(buildPage2(), tr("Tutoriel")); layout->addWidget(tabWidget); layout->setContentsMargins(QMargins()); }
BackScene::BackScene(ItemCollector *ic, QObject *parent) :ic(ic) { this->setSceneRect(ic->getPixmap().rect()-=QMargins(10, 10, 10, 10)); QGraphicsPixmapItem *back = new QGraphicsPixmapItem(); back->setPixmap(QPixmap(ic->getPixmap())); back->setZValue(-10); this->addItem(back); this->setParent(parent); isPressing = false; oldPoint = ic->outPoint(); }
void Record::createWaveFormPic(Ffmpeg_t *ffmpeg, QString recortPath) { std::pair<std::vector<double>, std::vector<double> > dataWaveForm = ffmpeg->getSamplesForWaveformPlotting(recortPath + "/" + m_Name); QCustomPlot Plotter; Plotter.setBackground(QBrush(Qt::transparent) ); Plotter.xAxis->setVisible(false); Plotter.yAxis->setVisible(false); Plotter.axisRect()->setAutoMargins(QCP::msNone); Plotter.axisRect()->setMargins(QMargins(0, 5, 0, 5)); QCPGraph *Waveform = Plotter.addGraph(); Waveform->setPen(QPen(Qt::green) ); if (!Waveform) { qDebug("addGraph failed\n"); } QVector<double> Amplitudes(QVector<double>::fromStdVector(dataWaveForm.first) ); QVector<double> Time; double CurrentTime = 0; auto TimeSlotCount = Amplitudes.size(); for (int64_t i = 1; i < TimeSlotCount; i++) { Time.append(CurrentTime); CurrentTime += 0.5; } Waveform->setData(Time, Amplitudes); Plotter.xAxis->setRange(0, Time.back() ); Plotter.yAxis->setRange(SHRT_MIN, SHRT_MAX); QByteArray ByteArray; QBuffer Buffer(&ByteArray); Buffer.open(QBuffer::WriteOnly); uint32_t time = m_EndTime - m_StartTime; for (int i = 1; i < 10000; i*=10) { Plotter.toPixmap(time/(i), this->height()).save(&Buffer, "PNG", 0); //Plotter.saveJpg(recortPath + "/plot" + QString::number(m_Id) + QString::number(i) + ".jpg", time/(i), this->height()); QPixmap Pixmap; Pixmap.loadFromData(ByteArray, "PNG"); v_PixWaves.append(Pixmap); ByteArray.clear(); Buffer.reset(); } Buffer.close(); qDebug() << m_WavePic->margin(); // místo 2 podle toho jaký zoom m_WavePic->setPixmap(v_PixWaves[2]); }
void MainWindow::genMarginGroup() { resetPlot(); customPlot->plotLayout()->clear(); customPlot->plotLayout()->addElement(0, 0, new QCPAxisRect(customPlot)); customPlot->plotLayout()->addElement(0, 1, new QCPAxisRect(customPlot)); customPlot->plotLayout()->addElement(1, 0, new QCPAxisRect(customPlot)); customPlot->plotLayout()->addElement(1, 1, new QCPAxisRect(customPlot)); foreach (QCPAxisRect *r, customPlot->axisRects()) r->axis(QCPAxis::atBottom)->setTickLabels(false); QCPMarginGroup *marginGroup = new QCPMarginGroup(customPlot); customPlot->axisRect(0)->setMarginGroup(QCP::msLeft, marginGroup); customPlot->axisRect(2)->setMarginGroup(QCP::msLeft, marginGroup); customPlot->axisRect(0)->axis(QCPAxis::atLeft)->setRange(0, 1300); customPlot->axisRect(1)->axis(QCPAxis::atLeft)->setRange(0, 1300); customPlot->axisRect(0)->axis(QCPAxis::atLeft)->setLabel("y"); customPlot->axisRect(1)->axis(QCPAxis::atLeft)->setLabel("y"); customPlot->plotLayout()->setAutoMargins(QCP::msLeft|QCP::msRight|QCP::msBottom); customPlot->plotLayout()->setMargins(QMargins(0, 25, 0, 0)); QFont textFont; textFont.setBold(true); QCPItemText *leftCaption = new QCPItemText(customPlot); customPlot->addItem(leftCaption); leftCaption->position->setType(QCPItemPosition::ptViewportRatio); leftCaption->setClipToAxisRect(false); leftCaption->position->setCoords(0.25, 0); leftCaption->setPositionAlignment(Qt::AlignTop|Qt::AlignHCenter); leftCaption->setText("left sides in margin group"); leftCaption->setFont(textFont); QCPItemText *rightCaption = new QCPItemText(customPlot); customPlot->addItem(rightCaption); rightCaption->position->setType(QCPItemPosition::ptViewportRatio); rightCaption->position->setCoords(0.75, 0); rightCaption->setClipToAxisRect(false); rightCaption->setPositionAlignment(Qt::AlignTop|Qt::AlignHCenter); rightCaption->setText("no margin group"); rightCaption->setFont(textFont); QCPItemLine *splitter = new QCPItemLine(customPlot); splitter->start->setType(QCPItemPosition::ptViewportRatio); splitter->start->setCoords(0.5, 0); splitter->end->setType(QCPItemPosition::ptViewportRatio); splitter->end->setCoords(0.5, 1); splitter->setClipToAxisRect(false); splitter->setPen(QPen(Qt::gray, 0, Qt::DashLine)); customPlot->savePng(dir.filePath("QCPMarginGroup.png"), 400, 400); }
void SearchDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const { if (index.data(Qt::AccessibleDescriptionRole).toString() == QLatin1String("configure")) { QItemDelegate::paint(painter, option, index); return; } drawBackground(painter, option, index); if (index.data(Qt::AccessibleDescriptionRole).toString() == QLatin1String("separator")) { QStyleOptionFrame frameOption; frameOption.palette = option.palette; frameOption.rect = option.rect; frameOption.state = option.state; frameOption.frameShape = QFrame::HLine; QApplication::style()->drawControl(QStyle::CE_ShapedFrame, &frameOption, painter, 0); return; } const int shortcutWidth = ((option.rect.width() > 150) ? 40 : 0); QRect titleReactangle = option.rect; if (!index.data(Qt::DecorationRole).value<QIcon>().isNull()) { QRect decorationRectangle = option.rect; decorationRectangle.setRight(option.rect.left() + option.rect.height()); decorationRectangle = decorationRectangle.marginsRemoved(QMargins(2, 2, 2, 2)); index.data(Qt::DecorationRole).value<QIcon>().paint(painter, decorationRectangle, option.decorationAlignment); titleReactangle.setLeft(option.rect.left() + option.rect.height()); } if (shortcutWidth > 0) { titleReactangle.setRight(titleReactangle.right() - (shortcutWidth + 5)); } drawDisplay(painter, option, titleReactangle, index.data(Qt::UserRole).toString()); if (shortcutWidth > 0) { QRect shortcutReactangle = option.rect; shortcutReactangle.setLeft(option.rect.right() - shortcutWidth); drawDisplay(painter, option, shortcutReactangle, index.data(Qt::UserRole + 2).toString()); } }
CSVWidget::SceneToolMode::SceneToolMode (SceneToolbar *parent, const QString& toolTip) : SceneTool (parent), mButtonSize (parent->getButtonSize()), mIconSize (parent->getIconSize()), mToolTip (toolTip), mFirst (0), mCurrent (0), mToolbar (parent) { mPanel = new QFrame (this, Qt::Popup); mLayout = new QHBoxLayout (mPanel); mLayout->setContentsMargins (QMargins (0, 0, 0, 0)); mPanel->setLayout (mLayout); }
QtKeySequenceEdit::QtKeySequenceEdit(QWidget *parent) : QWidget(parent), m_num(0), m_lineEdit(new QLineEdit(this)) { QHBoxLayout *layout = new QHBoxLayout(this); layout->addWidget(m_lineEdit); layout->setContentsMargins(QMargins()); m_lineEdit->installEventFilter(this); m_lineEdit->setReadOnly(true); m_lineEdit->setFocusProxy(this); setFocusPolicy(m_lineEdit->focusPolicy()); setAttribute(Qt::WA_InputMethodEnabled); }
QMargins HGLayout::margins() const { if (layout()) { qreal left = 0; qreal top = 0; qreal right = 0; qreal bottom = 0; layout()->getContentsMargins(&left, &top, &right, &bottom); return QMargins(left, top, right, bottom); } return HLayout::margins(); }
SCsFindWidget::SCsFindWidget(QWidget *parent/* =0 */): QWidget(parent) { //installEventFilter(this); QFont font("Arial", 11); font.setStyleHint(QFont::Serif); this->setFont(font); setMaximumHeight(35); mSearchEdit = new QLineEdit(this); mSearchEdit->setMinimumWidth(80); connect(mSearchEdit, SIGNAL(textChanged(QString)), this, SLOT(textChanged(QString))); connect(mSearchEdit, SIGNAL(returnPressed()), this, SIGNAL(findNext())); connect(mSearchEdit, SIGNAL(textChanged(QString)), this, SLOT(updateButtons())); mFindPreviousButton = setupToolButton(tr("Previous"), ":scs/media/icons/find-previous.png"); connect(mFindPreviousButton, SIGNAL(clicked()), this, SIGNAL(findPrevious())); mFindNextButton = setupToolButton(tr("Next"), ":scs/media/icons/find-next.png"); connect(mFindNextButton, SIGNAL(clicked()), this, SIGNAL(findNext())); mCaseSensitiveCheck = new QCheckBox(tr("Case sensitive"),this); mFindWholeWordCheck = new QCheckBox(tr("Whole word"),this); connect(mCaseSensitiveCheck, SIGNAL(stateChanged(int)), this, SLOT(caseSensitivityChanged(int))); connect(mFindWholeWordCheck, SIGNAL(stateChanged(int)), this, SLOT(wholeWordChanged(int))); mCloseButton = setupToolButton("", ":scs/media/icons/find-close.png"); connect(mCloseButton, SIGNAL(clicked()), this, SLOT(hide())); mCloseButton->setFixedHeight(28); mCloseButton->setFixedWidth(28); QHBoxLayout *layout = new QHBoxLayout(); layout->setContentsMargins(0,0,0,0); layout->addWidget(mCloseButton); layout->addWidget(mSearchEdit); layout->addWidget(mFindPreviousButton); layout->addWidget(mFindNextButton); layout->addWidget(mCaseSensitiveCheck); layout->addWidget(mFindWholeWordCheck); layout->setContentsMargins(QMargins(0,5,20,0)); layout->addStretch(); setLayout(layout); hide(); }
CSVWidget::SceneToolToggle::SceneToolToggle (SceneToolbar *parent, const QString& toolTip, const std::string& emptyIcon) : SceneTool (parent), mEmptyIcon (emptyIcon), mButtonSize (parent->getButtonSize()), mIconSize (parent->getIconSize()), mToolTip (toolTip), mFirst (0) { mPanel = new QFrame (this, Qt::Popup); mLayout = new QHBoxLayout (mPanel); mLayout->setContentsMargins (QMargins (0, 0, 0, 0)); mPanel->setLayout (mLayout); }
CustomWindow::CustomWindow(QWebView* view , QWidget*parent): QMainWindow(parent){ //set windows layout QWidget* widget = new QWidget(this); QGridLayout *gridLayout = new QGridLayout(widget); gridLayout->addWidget(view); widget->setLayout(gridLayout); setCentralWidget(widget); setContentsMargins(0,0,0,0); gridLayout->setContentsMargins(QMargins(0,0,0,0)); setAttribute(Qt::WA_TranslucentBackground, true); setWindowFlags(Qt::FramelessWindowHint); }
void Menu::handleMouseMove(QPoint globalPosition) { auto inner = rect().marginsRemoved(QMargins(0, _st.skip, 0, _st.skip)); auto localPosition = mapFromGlobal(globalPosition); if (inner.contains(localPosition)) { _mouseSelection = true; updateSelected(globalPosition); } else { clearMouseSelection(); if (_mouseMoveDelegate) { _mouseMoveDelegate(globalPosition); } } }
Console::Console(QWidget *parent) : QWidget(parent), m_isRunnig(false), m_game(0) { m_display = new Display(this); QVBoxLayout *layout = new QVBoxLayout(this); layout->setContentsMargins(QMargins()); layout->addWidget(m_display); setFixedSize(800, 480); }
TCommonRepeatingWidgetPrivate::TCommonRepeatingWidgetPrivate() { RBEvery = new QRadioButton; //HBLEvery = new QHBoxLayout; //HBLEvery->addWidget(RBEvery); RBEveryN = new QRadioButton("Every"); SBEveryN = new QSpinBox; SBEveryN->setMinimum(1); LEveryNName = new QLabel; HBLEveryN = new QHBoxLayout; HBLEveryN->addWidget(RBEveryN); HBLEveryN->addWidget(SBEveryN); HBLEveryN->addWidget(LEveryNName); HBLEveryN->addStretch(); QVBoxLayout *VBLLeftCommon = new QVBoxLayout; VBLLeftCommon->addWidget(RBEvery); VBLLeftCommon->addLayout(HBLEveryN); HBLCommon = new QHBoxLayout; HBLCommon->addLayout(VBLLeftCommon); HBLCommon->setSpacing(0); HBLCommon->setContentsMargins(QMargins()); ButtonGroup = new QButtonGroup; ButtonGroup->addButton(RBEvery); ButtonGroup->addButton(RBEveryN); MainLayout = new QVBoxLayout; MainLayout->addLayout(HBLCommon); MainLayout->addStretch(); MainLayout->setSpacing(0); MainLayout->setContentsMargins(QMargins(5, 0, 0, 0)); }
DWizardPage::DWizardPage(QWizard* const dlg, const QString& title) : QWizardPage(dlg), d(new Private) { setTitle(title); const int spacing = QApplication::style()->pixelMetric(QStyle::PM_DefaultLayoutSpacing); QScrollArea* const sv = new QScrollArea(this); QWidget* const panel = new QWidget(sv->viewport()); sv->setWidget(panel); sv->setWidgetResizable(true); d->hlay = new QHBoxLayout(panel); d->leftView = new QWidget(panel); QVBoxLayout* const vboxLay = new QVBoxLayout(d->leftView); d->logo = new QLabel(d->leftView); d->logo->setAlignment(Qt::AlignTop); d->logo->setPixmap(QIcon::fromTheme(QLatin1String("digikam")).pixmap(QSize(128, 128))); QWidget* const space = new QLabel(d->leftView); d->leftBottomPix = new QLabel(d->leftView); d->leftBottomPix->setAlignment(Qt::AlignBottom); vboxLay->addWidget(d->logo); vboxLay->addWidget(space); vboxLay->addWidget(d->leftBottomPix); vboxLay->setStretchFactor(space, 10); vboxLay->setContentsMargins(spacing, spacing, spacing, spacing); vboxLay->setSpacing(spacing); QFrame* const vline = new QFrame(panel); vline->setLineWidth(1); vline->setMidLineWidth(0); vline->setFrameShape(QFrame::VLine); vline->setFrameShadow(QFrame::Sunken); vline->setMinimumSize(2, 0); vline->updateGeometry(); d->hlay->addWidget(d->leftView); d->hlay->addWidget(vline); d->hlay->setContentsMargins(QMargins()); d->hlay->setSpacing(spacing); QVBoxLayout* const layout = new QVBoxLayout; layout->addWidget(sv); setLayout(layout); d->dlg = dlg; d->id = d->dlg->addPage(this); }