• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ setViewportMargins函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: setViewportMargins

void TraceWidget::updateMargins(int width)
{
  if (isLeftToRight())
    setViewportMargins(width + cbar_->width(), 0, 0, 0);
  else
    setViewportMargins(0, 0, width + cbar_->width(), 0);
}
开发者ID:RCambier,项目名称:EmbeddedAndVerification,代码行数:7,代码来源:traceDock.cpp


示例2: setViewportMargins

void QScriptEdit::updateExtraAreaWidth()
{
    if (isLeftToRight())
        setViewportMargins(extraAreaWidth(), 0, 0, 0);
    else
        setViewportMargins(0, 0, extraAreaWidth(), 0);
}
开发者ID:wpbest,项目名称:copperspice,代码行数:7,代码来源:qscriptedit.cpp


示例3: setViewportMargins

void TextEdit::updateLineNumberAreaWidth(int /* newBlockCount */)
{
    if (lineNumberArea->isVisiblePrivate())
        setViewportMargins(lineNumberAreaWidth() + 12, 0, 0, 0);
    else
        setViewportMargins(0, 0, 0, 0);
}
开发者ID:thesoulless,项目名称:SoulNote,代码行数:7,代码来源:textedit.cpp


示例4: setViewportMargins

void TextEditLineNumbers::setLineAreaVisble(bool visible)
{
	m_lineAreaVisble = visible;
	if (m_lineAreaVisble) {
		setViewportMargins(getAreaWidth(),0,0,0);
	}
	else {
		setViewportMargins(0,0,0,0);
	}
}
开发者ID:EQ4,项目名称:CsoundQt,代码行数:10,代码来源:texteditor.cpp


示例5: setViewportMargins

void FilterTableHeader::updateGeometries()
{
    // If there are any input widgets add a viewport margin to the header to generate some empty space for them which is not affected by scrolling
    if(filterWidgets.size())
        setViewportMargins(0, 0, 0, filterWidgets.at(0)->sizeHint().height());
    else
        setViewportMargins(0, 0, 0, 0);

    // Now just call the parent implementation and reposition the input widgets
    QHeaderView::updateGeometries();
    adjustPositions();
}
开发者ID:0359xiaodong,项目名称:sqlitebrowser,代码行数:12,代码来源:FilterTableHeader.cpp


示例6: setHorizontalScrollBarPolicy

void SourceViewerWidget::optionChanged(const QString &option, const QVariant &value)
{
	if (option == QLatin1String("Interface/ShowScrollBars"))
	{
		setHorizontalScrollBarPolicy(value.toBool() ? Qt::ScrollBarAsNeeded : Qt::ScrollBarAlwaysOff);
		setVerticalScrollBarPolicy(value.toBool() ? Qt::ScrollBarAsNeeded : Qt::ScrollBarAlwaysOff);
	}
	else if (option == QLatin1String("SourceViewer/ShowLineNumbers"))
	{
		if (value.toBool() && !m_marginWidget)
		{
			m_marginWidget = new MarginWidget(this);
			m_marginWidget->show();
			m_marginWidget->setGeometry(QRect(contentsRect().left(), contentsRect().top(), m_marginWidget->width(), contentsRect().height()));
		}
		else if (!value.toBool() && m_marginWidget)
		{
			m_marginWidget->deleteLater();
			m_marginWidget = NULL;

			setViewportMargins(0, 0, 0, 0);
		}
	}
	else if (option == QLatin1String("SourceViewer/WrapLines"))
	{
		setLineWrapMode(value.toBool() ? QPlainTextEdit::WidgetWidth : QPlainTextEdit::NoWrap);
	}
}
开发者ID:davidyang5405,项目名称:otter-browser,代码行数:28,代码来源:SourceViewerWidget.cpp


示例7: QPlainTextEdit

SourceWindow::SourceWindow(const QString& fileName, QWidget* parent) :
	QPlainTextEdit(parent),
	m_fileName(fileName),
	m_highlighter(0),
	m_widthItems(16),
	m_widthPlus(12),
	m_widthLineNo(30),
	m_lineInfoArea(new LineInfoArea(this))
{
    // load pixmaps
    m_pcinner = UserIcon("pcinner");
    m_pcup = UserIcon("pcup");
    m_brkena = UserIcon("brkena");
    m_brkdis = UserIcon("brkdis");
    m_brktmp = UserIcon("brktmp");
    m_brkcond = UserIcon("brkcond");
    m_brkorph = UserIcon("brkorph");
    setFont(KGlobalSettings::fixedFont());
    setReadOnly(true);
    setViewportMargins(lineInfoAreaWidth(), 0, 0 ,0);
    setWordWrapMode(QTextOption::NoWrap);
    connect(this, SIGNAL(updateRequest(const QRect&, int)),
	    m_lineInfoArea, SLOT(update()));
    connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(cursorChanged()));

    // add a syntax highlighter
    if (QRegExp("\\.(c(pp|c|\\+\\+)?|CC?|h(\\+\\+|h|pp)?|HH?)$").indexIn(m_fileName) >= 0)
    {
	m_highlighter = new HighlightCpp(this);
    }
}
开发者ID:chiky123ser,项目名称:nsga2,代码行数:31,代码来源:sourcewnd.cpp


示例8: setViewportMargins

void MarkdownEditor::setupPaperMargins(int width)
{
    if (EditorWidthFull == editorWidth)
    {
        preferredLayout->setContentsMargins(0, 0, 0, 0);
        setViewportMargins(0, 0, 0, 0);

        return;
    }

    int screenWidth = QApplication::desktop()->screenGeometry().width();
    int proposedEditorWidth = width;
    int margin = 0;

    switch (editorWidth)
    {
        case EditorWidthNarrow:
            proposedEditorWidth = screenWidth / 3;
            break;
        case EditorWidthMedium:
            proposedEditorWidth = screenWidth / 2;
            break;
        case EditorWidthWide:
            proposedEditorWidth = 2 * (screenWidth / 3);
            break;
        default:
            break;
    }

    if (proposedEditorWidth <= width)
    {
        margin = (width - proposedEditorWidth) / 2;
    }

    if (EditorAspectStretch == aspect)
    {
        preferredLayout->setContentsMargins(0, 0, 0, 0);
        setViewportMargins(margin, 20, margin, 0);
    }
    else
    {
        preferredLayout->setContentsMargins(margin, 20, margin, 20);
        setViewportMargins(10, 10, 10, 10);
    }
}
开发者ID:p2edwards,项目名称:ghostwriter,代码行数:45,代码来源:MarkdownEditor.cpp


示例9: setViewportMargins

void HeaderedWidget::setHeaderLabels(const QStringList& headerLabels, const char* aligns)
{
  headerItemModel->setHorizontalHeaderLabels(headerLabels);
  int headerHeight = headerView->sizeHint().height();
  headerView->setFixedHeight(headerHeight);
  setViewportMargins(0, headerHeight, 0, 0);
  for(int i = headerLabels.count() - 1; i >= 0; i--)
    headerItemModel->horizontalHeaderItem(i)->setTextAlignment((aligns == 0 || aligns[i] == 'l') ? Qt::AlignLeft : (aligns[i] == 'r' ? Qt::AlignRight : Qt::AlignCenter));
}
开发者ID:Ambaboo,项目名称:BHuman2013,代码行数:9,代码来源:HeaderedWidget.cpp


示例10: setViewportMargins

void RosegardenScrollView::setBottomFixedWidget(QWidget* w)
{
    m_bottomWidget = w;
    if (m_bottomWidget) {
        m_bottomWidget->setParent(this);
        m_bottomWidget->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed));
        setViewportMargins( 0, 0, 0, m_bottomWidget->sizeHint().height() );
        RG_DEBUG << "RosegardenScrollView::setBottomFixedWidget" << endl;
    }
}
开发者ID:UIKit0,项目名称:rosegarden,代码行数:10,代码来源:RosegardenScrollView.cpp


示例11: QTextEdit

XMLTextEdit::XMLTextEdit(QWidget *parent)
  : QTextEdit(parent)
{
  setViewportMargins(50, 0, 0, 0);
  highlight = new XmlHighlighter(document());
  setLineWrapMode ( QTextEdit::NoWrap );
  setAcceptRichText ( false );
  connect(verticalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(update()));
  connect(this, SIGNAL(textChanged()), this, SLOT(update()));
}
开发者ID:SorinS,项目名称:fop-miniscribus,代码行数:10,代码来源:XML_Editor.cpp


示例12: setViewportMargins

/*******************************************************************************
    show/hide bottom panel
*******************************************************************************/
void BrowserView::show_bottom_panel(QWidget* w)
{
    //Debug::debug() << "  [BrowserView] show_bottom_panel";

    m_bottomWidget->setContent( w );
   
    if(!w) 
    {
      m_bottomWidget->hide();
      setViewportMargins(0,0,0,0);
    }
    else
    {
      m_bottomWidget->show();  

      m_bottomWidget->resize(m_bottomWidget->width(),w->sizeHint().height() + 4);
      setViewportMargins(0,0,0,w->sizeHint().height() + 4);
    }
}
开发者ID:RavetcoFX,项目名称:Yarock,代码行数:22,代码来源:browser_view.cpp


示例13: QScrollArea

EvScrollTabBar::EvScrollTabBar(Qt::Orientation orientation,QWidget *parent) :
    QScrollArea(parent)
{
    m_tabBar = new EvTabBar(orientation,this);
    setWidget(m_tabBar);
    setWidgetResizable(true);
    setViewportMargins(0,0,-3,-3);
    setFrameShape(QFrame::NoFrame);
    connect(m_tabBar,SIGNAL(currentIndexChanged(bool)),this,SLOT(updateScrollPosition(bool)));
}
开发者ID:kaabimg,项目名称:EvLibrary,代码行数:10,代码来源:EvScrollTabBar.cpp


示例14: QPlainTextEdit

/* ==== JBEAM TEXT EDIT ==== */
JBEAM_TextBox::JBEAM_TextBox(QWidget *parent, NodeBeam *nb) : QPlainTextEdit(parent)
{
    LineNumbersA = new LineNumbers(this);
    setViewportMargins(26,0,0,0);

    //Connect linenumbers update request
    connect(this, SIGNAL(updateRequest(QRect,int)), this, SLOT(updateLineNumbers(QRect,int)));
    connect(this, SIGNAL(textChanged()), this, SLOT(textchanged()));

    synhigh = new Highlighter(this->document());

    JBEAM_NodeCursor = -1;
    JBEAM_BeamCursor = -1;
    CurrentNodeBeam = nb;

    this->setLineWrapMode(QPlainTextEdit::NoWrap); //No automatic line change
    this->setTabStopWidth(15); //Set smaller TAB width

    EmptyJbeamTextTemplate = "{\n"
                   "    \"Vehicle\":{\n"
                   "        \"information\":{\n"
                   "            \"authors\":\"Your name\"      \n"
                   "        },\n"
                   "        \"nodes\":[\n"
                   "            [\"id\", \"posX\", \"posY\", \"posZ\"],\n\n"
                   "            //BNEnodes\n"
                   "   \n"
                   "        ],\n"
                   "        \"beams\":[\n"
                   "            [\"id1:\", \"id2:\"],\n\n"
                   "            //BNEbeams\n"
                   "   \n"
                   "   \n"
                   "        ],\n"
                   "        \"triangles\":[\n"
                   "            [\"id1:\", \"id2:\", \"id3:\"],\n\n"
                   "            //BNEtriangles\n"
                   "   \n"
                   "   \n"
                   "        ],\n"
                   "   }\n"
                   "}\n";

    ResetContents();

    QFont fontti;
    fontti.setFamily(tr("Verdana"));
    this->setFont(fontti);

    for(int i=0; i<CurrentNodeBeam->ListTypes.size();i++)
    {
        this->JBEAM_curorNames.append(CurrentNodeBeam->ListTypes.at(i).keyword);
    }
}
开发者ID:RORMasa,项目名称:NodeBeamEditor,代码行数:55,代码来源:jbeamtextbox.cpp


示例15: verticalScrollBar

void AdjustingScrollArea::resizeEvent(QResizeEvent* ev)
{
    int scrollBarWidth =
        verticalScrollBar()->isVisible() ? verticalScrollBar()->sizeHint().width() : 0;

    if (layoutDirection() == Qt::RightToLeft)
        setViewportMargins(-scrollBarWidth, 0, 0, 0);

    updateGeometry();
    QScrollArea::resizeEvent(ev);
}
开发者ID:Grokafar,项目名称:qTox,代码行数:11,代码来源:adjustingscrollarea.cpp


示例16: setViewportMargins

void CodeEditor::resizeEvent(QResizeEvent* event)
{
    QPlainTextEdit::resizeEvent(event);

    lineNumWidth = FONTWIDTH * lineNumDigits;

    int width = lineNumWidth + foldBoxWidth + 2 * foldBoxIndent;

    setViewportMargins(width, 0, 0, 0);

    extraArea->setGeometry(contentsRect().x(), contentsRect().y(), width, contentsRect().height());
}
开发者ID:MichaelJE,项目名称:Clips,代码行数:12,代码来源:codeeditor.cpp


示例17: QSize

void ToolBarList::updateGeometries()
{
	// Resize viewport margins
	QSize hint = m_toolbar->isHidden() ? QSize(0,0) : m_toolbar->sizeHint();
	setViewportMargins(0, 0, 0, hint.height());

	// Resize toolbar
	QRect rect = viewport()->geometry();
	QRect geometry(rect.left(), rect.top() + rect.height(), rect.width(), hint.height());
	m_toolbar->setGeometry(geometry);

	QListWidget::updateGeometries();
}
开发者ID:gottcode,项目名称:tetzle,代码行数:13,代码来源:toolbar_list.cpp


示例18: setViewportMargins

void VariableTableView::showEvent(QShowEvent *event)
{
    setViewportMargins(m_header->sizeHint().width(), this->rowHeight(0) + 6, 0, 0);
    m_header->setGeometry(0,
                          static_cast<int>(this->rowHeight(0) / 2.0),
                          m_header->sizeHint().width() + 10,
                          this->rowHeight(0) * m_header->sectionCount());
    horizontalHeader()->setMinimumWidth(horizontalHeader()->count() * horizontalHeader()->sectionSize(1));
    horizontalScrollBar()->setMaximum((horizontalHeader()->count() - 1) * horizontalHeader()->sectionSize(1));
    horizontalScrollBar()->updateGeometry();
    viewport()->update();
    QWidget::showEvent(event);
}
开发者ID:fl0f,项目名称:eddypro-gui,代码行数:13,代码来源:variable_tableview.cpp


示例19: setViewportMargins

void IrgaTableView::resizeEvent(QResizeEvent *event)
{
    setViewportMargins(m_header->sizeHint().width() - 2, rowHeight(0) + 2, 0, 0);
    m_header->setGeometry(0,
                          static_cast<int>(rowHeight(0) / 2.0) + 2,
                          m_header->sizeHint().width() + 10,
                          rowHeight(0) * m_header->sectionCount());
    horizontalHeader()->setMinimumWidth(horizontalHeader()->count() * horizontalHeader()->sectionSize(1));
    horizontalScrollBar()->setMaximum((horizontalHeader()->count() - 1) * horizontalHeader()->sectionSize(1));
    horizontalScrollBar()->updateGeometry();
    viewport()->update();
    QWidget::resizeEvent(event);
}
开发者ID:LI-COR,项目名称:eddypro-gui,代码行数:13,代码来源:irga_tableview.cpp


示例20: QListView

DWIDGET_USE_NAMESPACE

DFM_BEGIN_NAMESPACE

DCompleterListView::DCompleterListView(QWidget *parent)
    : QListView(parent)
{
    setFocusPolicy(Qt::NoFocus);
    overrideWindowFlags(Qt::Tool | Qt::WindowDoesNotAcceptFocus);
    setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
    setViewportMargins(0, 0, -verticalScrollBar()->sizeHint().width(), 0);
    setMouseTracking(true);
}
开发者ID:linuxdeepin,项目名称:dde-file-manager,代码行数:14,代码来源:dcompleterlistview.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ setViewportUpdateMode函数代码示例发布时间:2022-05-30
下一篇:
C++ setViewport函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap