当前位置: 首页>>代码示例>>C++>>正文


C++ QMargins函数代码示例

本文整理汇总了C++中QMargins函数的典型用法代码示例。如果您正苦于以下问题:C++ QMargins函数的具体用法?C++ QMargins怎么用?C++ QMargins使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了QMargins函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: HelpWidget

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()));
}
开发者ID:kaniini,项目名称:hyne,代码行数:45,代码来源:MetadataDialog.cpp

示例2: timeView

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();
}
开发者ID:BADBDY23,项目名称:BHumanCodeRelease,代码行数:45,代码来源:TimeWidget.cpp

示例3: KFrameItem

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)));
}
开发者ID:kxtry,项目名称:kxfw-example,代码行数:45,代码来源:kkslidervolume.cpp

示例4: QMargins

void CFramelessWindow::showFullScreen()
{
    if (isMaximized())
    {
        QMainWindow::setContentsMargins(m_margins);
        m_frames = QMargins();
    }
    QMainWindow::showFullScreen();
}
开发者ID:bao-boyle,项目名称:Qt-Nice-Frameless-Window,代码行数:9,代码来源:framelesswindow.cpp

示例5: QMargins

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);
        }
    }
}
开发者ID:2gis,项目名称:2gisqt5android,代码行数:19,代码来源:qwizard_win.cpp

示例6: g

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())));
		}
	}
}
开发者ID:neuroidss,项目名称:tdesktop,代码行数:10,代码来源:abstractbox.cpp

示例7: createLayout

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);
}
开发者ID:GuofengLiang,项目名称:360Code,代码行数:10,代码来源:clabel.cpp

示例8: QMargins

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);
}
开发者ID:2gis,项目名称:2gisqt5android,代码行数:10,代码来源:qhaikuwindow.cpp

示例9: QWidget

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);
}
开发者ID:OSLL,项目名称:sca,代码行数:10,代码来源:simplecodestylepreferenceswidget.cpp

示例10: enterEvent

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);
}
开发者ID:MobinRanjbar,项目名称:tdesktop,代码行数:10,代码来源:popupmenu.cpp

示例11: QWidget

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));
    }
开发者ID:RyanDowne,项目名称:hifi,代码行数:11,代码来源:MetavoxelUtil.cpp

示例12: QWidget

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);
}
开发者ID:goccy,项目名称:gmacs,代码行数:11,代码来源:GmacsMainField.cpp

示例13: SceneTool

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);
}
开发者ID:0xmono,项目名称:openmw,代码行数:11,代码来源:scenetoolmode.cpp

示例14: QVBoxLayout

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());
}
开发者ID:kaniini,项目名称:hyne,代码行数:11,代码来源:TTriadEditor.cpp

示例15: QDialog

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);
}
开发者ID:rivimey,项目名称:rwmapmaker,代码行数:54,代码来源:LoadingDialog.cpp


注:本文中的QMargins函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。