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


C++ QLayout::setMargin方法代码示例

本文整理汇总了C++中QLayout::setMargin方法的典型用法代码示例。如果您正苦于以下问题:C++ QLayout::setMargin方法的具体用法?C++ QLayout::setMargin怎么用?C++ QLayout::setMargin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QLayout的用法示例。


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

示例1: showEvent

void SearchWidget::showEvent(QShowEvent *event)
{
    if (!event->spontaneous() && !searchEngine) {
        QVBoxLayout *vLayout = new QVBoxLayout(this);
        vLayout->setMargin(0);
        vLayout->setSpacing(0);

        searchEngine = new QHelpSearchEngine(&LocalHelpManager::helpEngine(), this);

        Utils::StyledBar *toolbar = new Utils::StyledBar(this);
        toolbar->setSingleRow(false);
        QHelpSearchQueryWidget *queryWidget = searchEngine->queryWidget();
        QLayout *tbLayout = new QVBoxLayout();
        tbLayout->setSpacing(6);
        tbLayout->setMargin(4);
        tbLayout->addWidget(queryWidget);
        toolbar->setLayout(tbLayout);

        Utils::StyledBar *toolbar2 = new Utils::StyledBar(this);
        toolbar2->setSingleRow(false);
        tbLayout = new QVBoxLayout();
        tbLayout->setSpacing(0);
        tbLayout->setMargin(0);
        tbLayout->addWidget(resultWidget = searchEngine->resultWidget());
        toolbar2->setLayout(tbLayout);

        vLayout->addWidget(toolbar);
        vLayout->addWidget(toolbar2);

        setFocusProxy(queryWidget);

        connect(queryWidget, SIGNAL(search()), this, SLOT(search()));
        connect(resultWidget, &QHelpSearchResultWidget::requestShowLink, this,
                [this](const QUrl &url) {
                    emit linkActivated(url, currentSearchTerms(), false/*newPage*/);
                });

        connect(searchEngine, SIGNAL(searchingStarted()), this,
            SLOT(searchingStarted()));
        connect(searchEngine, SIGNAL(searchingFinished(int)), this,
            SLOT(searchingFinished(int)));

        QTextBrowser* browser = resultWidget->findChild<QTextBrowser*>();
        browser->viewport()->installEventFilter(this);

        connect(searchEngine, SIGNAL(indexingStarted()), this,
            SLOT(indexingStarted()));
        connect(searchEngine, SIGNAL(indexingFinished()), this,
            SLOT(indexingFinished()));

        QMetaObject::invokeMethod(&LocalHelpManager::helpEngine(), "setupFinished",
            Qt::QueuedConnection);
    }
开发者ID:55171514,项目名称:qtcreator,代码行数:53,代码来源:searchwidget.cpp

示例2: setup

void BookmarkWidget::setup()
{
    regExp.setPatternSyntax(QRegExp::FixedString);
    regExp.setCaseSensitivity(Qt::CaseInsensitive);

    QLayout *vlayout = new QVBoxLayout(this);
    vlayout->setMargin(0);
    vlayout->setSpacing(0);

    searchField = new Utils::FancyLineEdit(this);
    searchField->setFiltering(true);
    setFocusProxy(searchField);

    Utils::StyledBar *toolbar = new Utils::StyledBar(this);
    toolbar->setSingleRow(false);
    QLayout *tbLayout = new QHBoxLayout();
    tbLayout->setMargin(4);
    tbLayout->addWidget(searchField);
    toolbar->setLayout(tbLayout);

    vlayout->addWidget(toolbar);

    searchField->installEventFilter(this);
    connect(searchField, &Utils::FancyLineEdit::textChanged,
            this, &BookmarkWidget::filterChanged);

    treeView = new TreeView(this);
    vlayout->addWidget(treeView);

    filterBookmarkModel = new QSortFilterProxyModel(this);
    treeView->setModel(filterBookmarkModel);

    treeView->setDragEnabled(true);
    treeView->setAcceptDrops(true);
    treeView->setAutoExpandDelay(1000);
    treeView->setDropIndicatorShown(true);
    treeView->viewport()->installEventFilter(this);
    treeView->setContextMenuPolicy(Qt::CustomContextMenu);

    connect(treeView, &TreeView::expanded, this, &BookmarkWidget::expand);
    connect(treeView, &TreeView::collapsed, this, &BookmarkWidget::expand);
    connect(treeView, &TreeView::activated, this, &BookmarkWidget::activated);
    connect(treeView, &TreeView::customContextMenuRequested,
            this, &BookmarkWidget::customContextMenuRequested);

    filterBookmarkModel->setFilterKeyColumn(0);
    filterBookmarkModel->setDynamicSortFilter(true);
    filterBookmarkModel->setSourceModel(bookmarkManager->treeBookmarkModel());

    expandItems();
}
开发者ID:AgnosticPope,项目名称:qt-creator,代码行数:51,代码来源:bookmarkmanager.cpp

示例3: chModule

void SettingsWidget::chModule(QListWidgetItem *w)
{
	if (w)
	{
		page3->module = (Module *)w->data(Qt::UserRole).value<void *>();
		QWidget *w = page3->module->getSettingsWidget();
		if (w)
		{
			QLayout *layout = w->layout();
			layout->setMargin(2);
			if (QFormLayout *fLayout = qobject_cast<QFormLayout *>(layout))
				fLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
			else if (QGridLayout *gLayout = qobject_cast<QGridLayout *>(layout))
			{
				if (!gLayout->property("NoVHSpacer").toBool())
				{
					gLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding), gLayout->rowCount(), 0); //vSpacer
					gLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum), 0, gLayout->columnCount()); //hSpacer
				}
			}
			page3->scrollA->setWidget(w);
			w->setAutoFillBackground(false);
		}
		else if (page3->scrollA->widget())
			page3->scrollA->widget()->close(); //ustawi się na nullptr po usunięciu (WA_DeleteOnClose)
	}
}
开发者ID:arthurzam,项目名称:QMPlay2,代码行数:27,代码来源:SettingsWidget.cpp

示例4: rendererName

QmitkSelectableGLWidget::QmitkSelectableGLWidget(QWidget *parent)
  : QWidget(parent), m_Ui(new Ui::QmitkSelectableGLWidget)
{
  m_Ui->setupUi(this);
  QLayout *hlayout;
  hlayout = m_Ui->hboxLayout;
  hlayout->setMargin(3);

  QString rendererName("Renderer::");
  rendererName += objectName();

  // create Renderer
  m_Renderer = mitk::VtkPropRenderer::New(
    qPrintable(rendererName), NULL, mitk::RenderingManager::GetInstance(), mitk::BaseRenderer::RenderingMode::Standard);

  // create widget
  QString composedName("QSGLWt::");
  if (!objectName().isEmpty())
    composedName += objectName();
  else
    composedName += "QmitkGLWidget";
  /*
  * here is the place to define QT-Flags to enable and disable certain OpenGL elements, like StencilBuffer, RGBA and so
  * on.
  * See QGLFormat for futher informations
  * QGL::AlphaChannel: Enable Alpha in Framebuffer
  * QGL::Rgba enable use of rgba rather than color_index
  * QGL::StencilBuffer for use of stencilbuffer in OpenGL
  */
  m_RenderWindow = new QmitkRenderWindow(this, composedName, m_Renderer);

  hlayout->addWidget(m_RenderWindow);
}
开发者ID:pollen-metrology,项目名称:MITK,代码行数:33,代码来源:QmitkSelectableGLWidget.cpp

示例5: QDockWidget

TilesetDock::TilesetDock(QWidget *parent):
    QDockWidget(parent),
    mMapDocument(0),
    mDropDown(new QComboBox),
    mViewStack(new QStackedWidget),
    mCurrentTile(0),
    mCurrentTiles(0)
{
    setObjectName(QLatin1String("TilesetDock"));

    QWidget *w = new QWidget(this);
    QLayout *l = new QVBoxLayout(w);
    l->setSpacing(0);
    l->setMargin(0);
    l->addWidget(mDropDown);
    l->addWidget(mViewStack);

    mDropDown->setEditable(false);

    connect(mDropDown, SIGNAL(currentIndexChanged(int)),
            mViewStack, SLOT(setCurrentIndex(int)));
    connect(mViewStack, SIGNAL(currentChanged(int)),
            this, SLOT(updateCurrentTiles()));

    connect(TilesetManager::instance(), SIGNAL(tilesetChanged(Tileset*)),
            this, SLOT(tilesetChanged(Tileset*)));

    setWidget(w);
    retranslateUi();
    setAcceptDrops(true);
}
开发者ID:Zeitmaus,项目名称:tiled,代码行数:31,代码来源:tilesetdock.cpp

示例6: QWidget

QgsAttributeFormEditorWidget::QgsAttributeFormEditorWidget( QgsEditorWidgetWrapper* editorWidget, QgsAttributeForm* form )
    : QWidget( form )
    , mWidget( editorWidget )
    , mForm( form )
    , mMode( DefaultMode )
    , mMultiEditButton( new QgsMultiEditToolButton() )
    , mBlockValueUpdate( false )
    , mIsMixed( false )
    , mIsChanged( false )
{
  if ( !mWidget || !mForm )
    return;

  QLayout* l = new QHBoxLayout();
  l->setMargin( 0 );
  l->setContentsMargins( 0, 0, 0, 0 );
  l->addWidget( mWidget->widget() );

  if ( mWidget->widget() )
  {
    mWidget->widget()->setObjectName( mWidget->field().name() );
  }
  connect( mWidget, SIGNAL( valueChanged( const QVariant& ) ), this, SLOT( editorWidgetChanged( const QVariant & ) ) );
  connect( mMultiEditButton, SIGNAL( resetFieldValueTriggered() ), this, SLOT( resetValue() ) );
  connect( mMultiEditButton, SIGNAL( setFieldValueTriggered() ), this, SLOT( setFieldTriggered() ) );

  mMultiEditButton->setField( mWidget->field() );

  setLayout( l );
  updateWidgets();
}
开发者ID:PeterTFS,项目名称:QGIS,代码行数:31,代码来源:qgsattributeformeditorwidget.cpp

示例7: 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();
}
开发者ID:kingst,项目名称:op2-browser,代码行数:28,代码来源:aboutdialog.cpp

示例8: QWidget

QtResourceView::QtResourceView(QDesignerFormEditorInterface *core, QWidget *parent) :
    QWidget(parent),
    d_ptr(new QtResourceViewPrivate(core))
{
    d_ptr->q_ptr = this;

    QIcon editIcon = QIcon::fromTheme("document-properties", qdesigner_internal::createIconSet(QLatin1String("edit.png")));
    d_ptr->m_editResourcesAction = new QAction(editIcon, tr("Edit Resources..."), this);
    d_ptr->m_toolBar->addAction(d_ptr->m_editResourcesAction);
    connect(d_ptr->m_editResourcesAction, SIGNAL(triggered()), this, SLOT(slotEditResources()));
    d_ptr->m_editResourcesAction->setEnabled(false);

    QIcon refreshIcon = QIcon::fromTheme("view-refresh", qdesigner_internal::createIconSet(QLatin1String("reload.png")));
    d_ptr->m_reloadResourcesAction = new QAction(refreshIcon, tr("Reload"), this);

    d_ptr->m_toolBar->addAction(d_ptr->m_reloadResourcesAction);
    connect(d_ptr->m_reloadResourcesAction, SIGNAL(triggered()), this, SLOT(slotReloadResources()));
    d_ptr->m_reloadResourcesAction->setEnabled(false);

    QIcon copyIcon = QIcon::fromTheme("edit-copy", qdesigner_internal::createIconSet(QLatin1String("editcopy.png")));
    d_ptr->m_copyResourcePathAction = new QAction(copyIcon, tr("Copy Path"), this);
    connect(d_ptr->m_copyResourcePathAction, SIGNAL(triggered()), this, SLOT(slotCopyResourcePath()));
    d_ptr->m_copyResourcePathAction->setEnabled(false);

    //d_ptr->m_filterWidget = new qdesigner_internal::FilterWidget(0, qdesigner_internal::FilterWidget::LayoutAlignNone);
    d_ptr->m_filterWidget = new qdesigner_internal::FilterWidget(d_ptr->m_toolBar);
    d_ptr->m_toolBar->addWidget(d_ptr->m_filterWidget);
    connect(d_ptr->m_filterWidget, SIGNAL(filterChanged(QString)), this, SLOT(slotFilterChanged(QString)));

    d_ptr->m_splitter = new QSplitter;
    d_ptr->m_splitter->setChildrenCollapsible(false);
    d_ptr->m_splitter->addWidget(d_ptr->m_treeWidget);
    d_ptr->m_splitter->addWidget(d_ptr->m_listWidget);

    QLayout *layout = new QVBoxLayout(this);
    layout->setMargin(0);
    layout->setSpacing(0);
    layout->addWidget(d_ptr->m_toolBar);
    layout->addWidget(d_ptr->m_splitter);

    d_ptr->m_treeWidget->setColumnCount(1);
    d_ptr->m_treeWidget->header()->hide();
    d_ptr->m_treeWidget->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding));

    d_ptr->m_listWidget->setViewMode(QListView::IconMode);
    d_ptr->m_listWidget->setResizeMode(QListView::Adjust);
    d_ptr->m_listWidget->setIconSize(QSize(48, 48));
    d_ptr->m_listWidget->setGridSize(QSize(64, 64));

    connect(d_ptr->m_treeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)),
                    this, SLOT(slotCurrentPathChanged(QTreeWidgetItem*)));
    connect(d_ptr->m_listWidget, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)),
                    this, SLOT(slotCurrentResourceChanged(QListWidgetItem*)));
    connect(d_ptr->m_listWidget, SIGNAL(itemActivated(QListWidgetItem*)),
                    this, SLOT(slotResourceActivated(QListWidgetItem*)));
    d_ptr->m_listWidget->setContextMenuPolicy(Qt::CustomContextMenu);
    connect(d_ptr->m_listWidget, SIGNAL(customContextMenuRequested(QPoint)),
                this, SLOT(slotListWidgetContextMenuRequested(QPoint)));
}
开发者ID:Mr-Kumar-Abhishek,项目名称:qt,代码行数:59,代码来源:qtresourceview.cpp

示例9: setObjectName

IdentityFormWidget::IdentityFormWidget(Form::FormItem *formItem, QWidget *parent) :
    Form::IFormWidget(formItem,parent),
    m_ContainerLayout(0)
{
    setObjectName("IdentityFormWidget");
    // Create the central widget / layout
    QGridLayout *mainLayout = new QGridLayout(this);
    mainLayout->setSpacing(0);
    mainLayout->setMargin(0);

    // get options
    const QStringList &options = formItem->getOptions();
    m_Identity = new Identity::IdentityEditorWidget(this);
    m_Identity->initialize();

    Identity::IdentityEditorWidget::AvailableWidgets widgets = Identity::IdentityEditorWidget::FullIdentity;
    if (options.contains("with-photo", Qt::CaseInsensitive))
        widgets |= Identity::IdentityEditorWidget::Photo;
    if (options.contains("with-address", Qt::CaseInsensitive))
        widgets |= Identity::IdentityEditorWidget::FullAddress;
    if (options.contains("with-login", Qt::CaseInsensitive))
        widgets |= Identity::IdentityEditorWidget::FullLogin;
    m_Identity->setAvailableWidgets(widgets);

    if (options.contains("xml", Qt::CaseInsensitive))
        m_Identity->setXmlInOut(true);

    if (options.contains("readonly", Qt::CaseInsensitive))
        m_Identity->setReadOnly(true);

    // QtUi Loaded ?
    const QString &layout = formItem->spec()->value(Form::FormItemSpec::Spec_UiInsertIntoLayout).toString();
    if (!layout.isEmpty()) {
        // Find layout
        QLayout *lay = formItem->parentFormMain()->formWidget()->findChild<QLayout*>(layout);
        if (lay) {
            lay->addWidget(m_Identity);
            lay->setMargin(0);
            lay->setSpacing(0);
        } else {
            LOG_ERROR("Using the QtUiLinkage, layout not found in the ui: " + formItem->uuid());
        }
    } else {
        mainLayout->addWidget(m_Identity, 1, 0);
    }

    if (options.contains("compact", Qt::CaseInsensitive)) {
        m_Identity->layout()->setSpacing(0);
        m_Identity->layout()->setMargin(0);
    }

    setFocusedWidget(m_Identity);

    // create itemdata
    IdentityWidgetData *data = new IdentityWidgetData(m_FormItem);
    data->setIdentityFormWiget(this);
    m_FormItem->setItemData(data);
}
开发者ID:NyFanomezana,项目名称:freemedforms,代码行数:58,代码来源:identitywidgetfactory.cpp

示例10: QWidget

Tab::Tab(QWidget *parent) : QWidget (parent) {
    // Will contain chat window and list of online peers
	outputSplitter = new QSplitter;
    // Will split the outputSplitter from the input line
    inputSplitter = new QSplitter;
    inputSplitter->setOrientation(Qt::Vertical);
    // Contains the top portion (output) and bottom (input)
    QLayout *groupLayout = new QVBoxLayout;

    // Chat input
    chatInput = new QTextEdit;
    chatInput->setMinimumHeight(20);
    chatInput->setMaximumHeight(100);
    chatInput->installEventFilter(this);

    // Add chat viewer and chat input to main splitter
    inputSplitter->addWidget(outputSplitter);
    inputSplitter->addWidget(chatInput);

    // Configure sizing for main vertical splitter
    inputSplitter->setStretchFactor(0,99);
    inputSplitter->setStretchFactor(1,1);
    inputSplitter->setCollapsible(1,false);

    // Populate chat container
    QWidget *chatContainer = new QWidget;
    QLayout *chatContainerLayout = new QVBoxLayout;
    chat = new QTextBrowser;
    chatContainerLayout->addWidget(new QLabel("Chat:"));
    chatContainerLayout->addWidget(chat);
    chatContainerLayout->setMargin(0);
    chatContainerLayout->setSpacing(2);
    chatContainer->setLayout(chatContainerLayout);

    // Add chat viewer and online list to splitter
    outputSplitter->addWidget(chatContainer);

    groupLayout->addWidget(inputSplitter);
    groupLayout->setMargin(10);
    groupLayout->setSpacing(5);

	setLayout(groupLayout);

	this->setParent(parent);
}
开发者ID:sudowork,项目名称:GaoChat,代码行数:45,代码来源:clientgui.cpp

示例11: QWidget

BrushEditor::BrushEditor(QDesignerFormEditorInterface *core, QWidget *parent) :
    QWidget(parent),
    m_button(new QtColorButton(this)),
    m_changed(false),
    m_core(core)    
{
    QLayout *layout = new QHBoxLayout(this);
    layout->setMargin(0);
    layout->addWidget(m_button);
    connect(m_button, SIGNAL(colorChanged(QColor)), this, SLOT(brushChanged()));
    setFocusProxy(m_button);
}
开发者ID:NikhilNJ,项目名称:screenplay-dx,代码行数:12,代码来源:paletteeditor.cpp

示例12: ADVSplitWidget

DotPlotSplitter::DotPlotSplitter(AnnotatedDNAView* a)
    : ADVSplitWidget(a),
      locked(false)
{
    syncLockAction =        createAction(":core/images/sync_lock.png",      tr("Multiple view synchronization lock"),   SLOT(sl_toggleSyncLock(bool)));
    filterAction =          createAction(":dotplot/images/filter.png",      tr("Filter results"),                       SLOT(sl_toggleFilter()),            false);
    zoomInAction =          createAction(":core/images/zoom_in.png",        tr("Zoom in (<b> + </b>)"),                 SLOT(sl_toggleZoomIn()),            false);
    zoomOutAction =         createAction(":core/images/zoom_out.png",       tr("Zoom out (<b> - </b>)"),                SLOT(sl_toggleZoomOut()),           false);
    resetZoomingAction =    createAction(":core/images/zoom_whole.png",     tr("Reset zooming (<b>0</b>)"),             SLOT(sl_toggleZoomReset()),         false);
    selAction =             createAction(":dotplot/images/cursor.png",      tr("Select tool (<b>S</b>)"),               SLOT(sl_toggleSel()));
    handAction =            createAction(":dotplot/images/hand_icon.png",   tr("Hand tool (<b>H</b>)"),                 SLOT(sl_toggleHand()));

    splitter = new QSplitter(Qt::Horizontal);

    WidgetWithLocalToolbar* wgt = new WidgetWithLocalToolbar(this);
    QLayout* l = new QVBoxLayout();
    l->setMargin(0);
    l->setSpacing(0);
    l->addWidget(splitter);
    wgt->setContentLayout(l);

    wgt->addActionToLocalToolbar(filterAction);
    wgt->addActionToLocalToolbar(syncLockAction);
    wgt->addActionToLocalToolbar(zoomInAction);
    wgt->addActionToLocalToolbar(zoomOutAction);
    wgt->addActionToLocalToolbar(resetZoomingAction);
    wgt->addActionToLocalToolbar(selAction);
    wgt->addActionToLocalToolbar(handAction);

    QLayout* mainLayout = new QVBoxLayout();
    mainLayout->setSpacing(0);
    mainLayout->setMargin(0);
    mainLayout->addWidget(wgt);
    setLayout(mainLayout);

    setAcceptDrops(false);

    setFocus();
}
开发者ID:ugeneunipro,项目名称:ugene,代码行数:39,代码来源:DotPlotSplitter.cpp

示例13: init

void StorageInfoView::init()
{
    sinfo = QStorageMetaInfo::instance();
    QLayout *layout = new QVBoxLayout( this );
    layout->setSpacing( 0 );
    layout->setMargin( 0 );
    area = new QScrollArea;
    layout->addWidget( area );
    area->setFocusPolicy( Qt::TabFocus );
    area->setFrameShape( QFrame::NoFrame );
    updateMounts();
    connect(sinfo, SIGNAL(disksChanged()), this, SLOT(updateMounts()));
    startTimer(60000);
}
开发者ID:Camelek,项目名称:qtmoko,代码行数:14,代码来源:storage.cpp

示例14: QVBoxLayout

IndexWindow::IndexWindow()
    : m_searchLineEdit(0)
    , m_indexWidget(0)
{
    QVBoxLayout *layout = new QVBoxLayout(this);

    m_searchLineEdit = new Utils::FilterLineEdit();
    m_searchLineEdit->setPlaceholderText(QString());
    setFocusProxy(m_searchLineEdit);
    connect(m_searchLineEdit, SIGNAL(textChanged(QString)), this,
        SLOT(filterIndices(QString)));
    m_searchLineEdit->installEventFilter(this);

    QLabel *l = new QLabel(tr("&Look for:"));
    l->setBuddy(m_searchLineEdit);
    layout->addWidget(l);
    layout->setMargin(0);
    layout->setSpacing(0);

    Utils::StyledBar *toolbar = new Utils::StyledBar(this);
    toolbar->setSingleRow(false);
    QLayout *tbLayout = new QHBoxLayout();
    tbLayout->setSpacing(6);
    tbLayout->setMargin(4);
    tbLayout->addWidget(l);
    tbLayout->addWidget(m_searchLineEdit);
    toolbar->setLayout(tbLayout);
    layout->addWidget(toolbar);

    QHelpEngine *engine = &LocalHelpManager::helpEngine();
    m_indexWidget = engine->indexWidget();
    m_indexWidget->installEventFilter(this);
    connect(engine->indexModel(), SIGNAL(indexCreationStarted()), this,
        SLOT(disableSearchLineEdit()));
    connect(engine->indexModel(), SIGNAL(indexCreated()), this,
        SLOT(enableSearchLineEdit()));
    connect(m_indexWidget, SIGNAL(linkActivated(QUrl,QString)), this,
        SIGNAL(linkActivated(QUrl)));
    connect(m_indexWidget, SIGNAL(linksActivated(QMap<QString,QUrl>,QString)),
        this, SIGNAL(linksActivated(QMap<QString,QUrl>,QString)));
    connect(m_searchLineEdit, SIGNAL(returnPressed()), m_indexWidget,
        SLOT(activateCurrentItem()));
    m_indexWidget->setFrameStyle(QFrame::NoFrame);
    layout->addWidget(m_indexWidget);

    m_indexWidget->viewport()->installEventFilter(this);
}
开发者ID:CNOT,项目名称:julia-studio,代码行数:47,代码来源:indexwindow.cpp

示例15: LabeledSectionGroup

OptionsTiffImporter::OptionsTiffImporter(QWidget* pParent) :
   LabeledSectionGroup(pParent),
   mpDescriptor(NULL)
{
   QWidget* pFileBrowserWidget = new QWidget(this);
   QLabel* pFileBrowserLabel = new QLabel("Select an ISD metadata file or leave blank for no ISD metadata:",
      pFileBrowserWidget);
   mpFilename = new FileBrowser(pFileBrowserWidget);
   mpFilename->setWhatsThis("<p>An ISD metadata file is an XML file shipped with some imagery such as Quickbird. "
      "It contains image metadata. If you have an ISD metadata file and would like to load it with the cube data, "
      "select it here. If you do not want to load an ISD metadata file, leave this field blank.</p>"
      "Currently, the following information is loaded from the ISD file:"
      "<ul><li>RPC00B"
      "<li>Image header information needed to use the RPC00B"
      "</ul>");
   mpFilename->setBrowseCaption("Select ISD Metadata File");
   mpFilename->setBrowseFileFilters("ISD Metadata Files (*.xml)");
   mpFilename->setBrowseExistingFile(true);

   QGridLayout* pLayout = new QGridLayout(pFileBrowserWidget);
   pLayout->setMargin(0);
   pLayout->setSpacing(5);
   pLayout->addWidget(pFileBrowserLabel, 0, 0);
   pLayout->addWidget(mpFilename, 1, 0, 1, 2);
   pLayout->setColumnStretch(1, 5);

   LabeledSection* pFileBrowserSection = new LabeledSection(pFileBrowserWidget, "ISD Metadata File", this);

   // Layout
   QWidget* pWidget = widget();
   if (pWidget != NULL)
   {
      QLayout* pLayout = pWidget->layout();
      if (pLayout != NULL)
      {
         pLayout->setMargin(10);
      }
   }

   // Initialization
   addSection(pFileBrowserSection);
   addStretch(10);
   setSizeHint(300, 50);

   // Connections
   VERIFYNR(connect(mpFilename, SIGNAL(filenameChanged(const QString&)), this, SLOT(loadIsdMetadata(const QString&))));
}
开发者ID:Tom-VdE,项目名称:opticks,代码行数:47,代码来源:OptionsTiffImporter.cpp


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