您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ verticalScrollBar函数代码示例

51自学网 2021-06-03 09:37:58
  C++
这篇教程C++ verticalScrollBar函数代码示例写得很实用,希望能帮到您。

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

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

示例1: setModel

FreezeTableWidget::FreezeTableWidget( QAbstractItemModel * model, QWidget * parent ){    setModel(model);    frozenTableView = new QTableView(this);    init();    //connect the headers and scrollbars of both tableviews together    connect(horizontalHeader(),SIGNAL(sectionResized(int,int,int)), this,            SLOT(updateSectionWidth(int,int,int)));    connect(verticalHeader(),SIGNAL(sectionResized(int,int,int)), this,            SLOT(updateSectionHeight(int,int,int)));    connect(frozenTableView->verticalScrollBar(), SIGNAL(valueChanged(int)),            verticalScrollBar(), SLOT(setValue(int)));    connect(verticalScrollBar(), SIGNAL(valueChanged(int)),            frozenTableView->verticalScrollBar(), SLOT(setValue(int)));    connect(frozenTableView->horizontalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(keepFrozenHorizonalScroll()) );}
开发者ID:chemmalion,项目名称:EIDBEditor,代码行数:20,


示例2: horizontalScrollBar

void TileSelectionWidget::select(int xpos, int ypos){    xpos += horizontalScrollBar()->value();    ypos += verticalScrollBar()->value();    if (xpos < 40) xpos = 40;    if (xpos >= 40 + tileSetLabel->width()) xpos = tileSetLabel->width();    if (ypos < 40) ypos = 40;    if (ypos >= 40 + tileSetLabel->height()) ypos = tileSetLabel->height();    xpos = round40(xpos);    ypos = round40(ypos);    cursor->move(xpos, ypos);    id = (ypos - 40) / 40 * (tileSetLabel->width() / 40) + (xpos - 40) / 40 + 1;    emit selected(id);    emit selected(tileSetPixmap.copy(xpos - 40, ypos - 40, 40, 40));}
开发者ID:espacee,项目名称:BossBrawl,代码行数:20,


示例3: QGraphicsView

PHIAGraphicsView::PHIAGraphicsView( QWidget *parent )    : QGraphicsView( parent ){    qDebug( "PHIAGraphicsView::PHIAGraphicsView()" );    setAcceptDrops( true );    setInteractive( true );    setDragMode( NoDrag );    setRenderHint( QPainter::Antialiasing, true );    setRenderHint( QPainter::SmoothPixmapTransform, true );    setRenderHint( QPainter::TextAntialiasing, true );    setFrameShape( QFrame::NoFrame );    setFrameShadow( QFrame::Plain );    setViewportUpdateMode( QGraphicsView::SmartViewportUpdate );    setCacheMode( CacheNone );    setAlignment( Qt::AlignHCenter | Qt::AlignTop );    connect( horizontalScrollBar(), SIGNAL( valueChanged( int ) ),        this, SLOT( slotSliderChanged( int ) ) );    connect( verticalScrollBar(), SIGNAL( valueChanged( int ) ),        this, SLOT( slotSliderChanged( int ) ) );}
开发者ID:Phisketeer,项目名称:phisketeer,代码行数:20,


示例4: verticalScrollBar

void Robot25DWindow::mousePressEvent(QMouseEvent *event){    const QScrollBar * vert = verticalScrollBar();    const QScrollBar * horiz = horizontalScrollBar();    bool scrollable = vert->maximum() + horiz->maximum() > 0;    if (scrollable) {        if (event->button() == Qt::LeftButton) {            setCursor(Qt::ClosedHandCursor);            mousePressPosition_ = event->pos();        }        else {            setCursor(Qt::OpenHandCursor);        }        event->accept();    }    else {        setCursor(Qt::ArrowCursor);        event->ignore();    }}
开发者ID:woronin,项目名称:kumir2,代码行数:20,


示例5: context

IntervalSummaryWindow::IntervalSummaryWindow(Context *context) : context(context){    setWindowTitle(tr("Interval Summary"));    setReadOnly(true);    setFrameStyle(QFrame::NoFrame);#ifdef Q_OS_WIN    QStyle *cde = QStyleFactory::create(OS_STYLE);    verticalScrollBar()->setStyle(cde);#endif#ifdef Q_OS_MAC    setAttribute(Qt::WA_MacShowFocusRect, 0);#endif    connect(context, SIGNAL(intervalsChanged()), this, SLOT(intervalSelected()));    connect(context, SIGNAL(intervalSelected()), this, SLOT(intervalSelected()));    connect(context, SIGNAL(intervalHover(IntervalItem*)), this, SLOT(intervalHover(IntervalItem*)));    connect(context, SIGNAL(configChanged(qint32)), this, SLOT(intervalSelected()));    setHtml(GCColor::css() + "<body></body>");}
开发者ID:JanDeVisser,项目名称:GoldenCheetah,代码行数:20,


示例6: verticalScrollBar

voidchat::_cond_scroll_prepare() {    // Chack that if the last line before new text is entered is not visible,    // then do not do the scrolling because it means user has scrolled the    // buffer back and wants to view older text.    QScrollBar *vbar = verticalScrollBar();    int maximum = vbar->maximum();    int value = vbar->value();    int single_step = vbar->singleStep();    _saved_pre_insert_vertical_value = value;    _allow_scroll = (maximum - value < single_step);    ACE_DEBUG((LM_DEBUG, "chat::_cond_scroll_prepare: max %d, val %d, singleStep %d, allow_scroll: %d/n", maximum, value, single_step, _allow_scroll));    // Ensure text is inserted at the end of the buffer    QTextCursor c = this->textCursor();    c.movePosition(QTextCursor::End);    setTextCursor(c);}
开发者ID:ajalkane,项目名称:rvhouse,代码行数:20,


示例7: QAbstractItemView

ColorGridView::ColorGridView(QWidget *parent) :    QAbstractItemView(parent),    menu(this),    colorWheel(0),    margin(5),    gridMargin(2),    gridWidth(16),    gridCount(10),    gridsSize((gridMargin+gridWidth)*gridCount, (gridMargin+gridWidth)*gridCount){    // we do not support multi selection or row selection    setSelectionMode(QAbstractItemView::SingleSelection);    setSelectionBehavior(QAbstractItemView::SelectItems);    horizontalScrollBar()->setRange(0, 0);    verticalScrollBar()->setRange(0, 0);    setMouseTracking(true);    initGridBackgroundImg();    initContextMenu();    resize(gridsSize);}
开发者ID:evansf,项目名称:Qt-Plus,代码行数:20,


示例8: painter

//------------------------------------------------------------------------------// Name: paintEvent//------------------------------------------------------------------------------void NandView::paintEvent(QPaintEvent *) {	QPainter painter(viewport());	int font_width_ = 12;	int chars_per_row = 8;	int origin_ = 0;	painter.translate(-horizontalScrollBar()->value() * font_width_, 0);	// current actual offset (in bytes)	quint64 offset = (quint64)verticalScrollBar()->value() * chars_per_row;	if(origin_ != 0) {			if(offset > 0) {					offset += origin_;					offset -= chars_per_row;			} else {					origin_ = 0;					updateScrollbars();			}	}}
开发者ID:bunnie,项目名称:nandsee,代码行数:23,


示例9: verticalScrollBar

void SortableView::scrollTimeout(){	if(m_scrollDelta == 0) {		// Nothing to do		m_scrollTimer.stop();		return;	}	QScrollBar *bar = verticalScrollBar();	bar->setValue(bar->value() + m_scrollDelta);	// Move the indicator	int before = sortableIndexAtPos(		m_curMousePos + getScrollOffset(), m_curLevel, true);	moveIndicator(before);	if(isIndexValidForLevel(before, m_curLevel))		m_indicator.show();	else		m_indicator.hide();}
开发者ID:andrejsavikin,项目名称:mishira,代码行数:20,


示例10: charWidth

int FastoHexEdit::positionAtPoint(const QPoint &point) const {  const int px = point.x();  const int py = point.y();  const int charW = charWidth();  const int charH = charHeight();  const QRect rect = stableRect(viewport()->rect());  const int yPosStart = rect.top();  const int xPosStart = rect.left();  const int yPosEnd = rect.bottom();  const int xPosEnd = rect.right();  const int wid = xPosEnd - xPosStart;  const int widchars = wid - TextMarginXY * 2;  const int xPosAscii = widchars/4 * 3;  // line pos  int acharInLine = asciiCharInLine(widchars);  if (acharInLine < 0) {    acharInLine = 0;  }  if ((px >= xPosStart && px < xPosAscii) && (py >= yPosStart && py < yPosEnd)) {    int posx = (xPosStart + px) / charW;    int div = posx / 3;    int mod = posx % 3;    int pos = 0;  // symbol pos in data;    if (mod == 0) {      pos = div * 2;    } else {      pos = (div * 2) + 1;    }    int firstLineIdx = verticalScrollBar()->value();    int posy = (py - yPosStart) / charH;    pos = pos + (firstLineIdx + posy) * acharInLine * 2;    return pos;  }  return -1;}
开发者ID:kunyuqiushuang,项目名称:fastonosql,代码行数:41,


示例11: rect

void KNMusicAlbumView::scrollTo(const QModelIndex &index, ScrollHint hint){    //Check the index and the max column count.    if(!index.isValid() || m_maxColumnCount==0)    {        return;    }    //Check whether we need to move the vertical scroll bar.    if(hint==QAbstractItemView::EnsureVisible &&            rect().contains(visualRect(index), true))    {        return;    }    //Use timeline to move to the position.    m_scrollTimeLine->stop();    m_scrollTimeLine->setFrameRange(verticalScrollBar()->value(),                                    indexScrollBarValue(index, hint));    m_scrollTimeLine->start();    //Update.    viewport()->update();}
开发者ID:AG3,项目名称:Mu,代码行数:21,


示例12: connect

/** * @brief Sets the view settings for this view. * * When they change, the view is updated accordingly. * * @param view_settings The settings to watch. */void TilesetView::set_view_settings(ViewSettings& view_settings) {  this->view_settings = &view_settings;  connect(&view_settings, SIGNAL(zoom_changed(double)),          this, SLOT(update_zoom()));  update_zoom();  connect(this->view_settings, SIGNAL(grid_visibility_changed(bool)),          this, SLOT(update_grid_visibility()));  connect(this->view_settings, SIGNAL(grid_size_changed(QSize)),          this, SLOT(update_grid_visibility()));  connect(this->view_settings, SIGNAL(grid_style_changed(GridStyle)),          this, SLOT(update_grid_visibility()));  connect(this->view_settings, SIGNAL(grid_color_changed(QColor)),          this, SLOT(update_grid_visibility()));  update_grid_visibility();  horizontalScrollBar()->setValue(0);  verticalScrollBar()->setValue(0);}
开发者ID:vlag,项目名称:solarus-quest-editor,代码行数:28,


示例13: QTreeWidget

CWizFolderView::CWizFolderView(CWizExplorerApp& app, QWidget *parent)    : QTreeWidget(parent)    , m_app(app)    , m_dbMgr(app.databaseManager()){    header()->hide();    setAnimated(true);    setAttribute(Qt::WA_MacShowFocusRect, false);    setStyle(::WizGetStyle(m_app.userSettings().skin()));    setVerticalScrollMode(QAbstractItemView::ScrollPerItem);#ifdef WIZNOTE_CUSTOM_SCROLLBAR    setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);    setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);    m_vScroll = new CWizScrollBar(this);    m_vScroll->syncWith(verticalScrollBar());#endif    initFolders();}
开发者ID:AlanForeverAi,项目名称:WizQTClient,代码行数:21,


示例14: moveCursor

void ConsoleWidget::prompt(QString text){    QString text2 = text;    moveCursor(QTextCursor::End);    handleColor(); // change to default color    // add space because it looks better    text2 += " ";    // go to new line if line isn't empty    emptyLine();    insertPlainText(text2);    m_lastLine = "";    // if we have trouble keeping viewport    QScrollBar *sb = verticalScrollBar();    sb->setSliderPosition(sb->maximum());    m_prompt = text2;}
开发者ID:CodeMonkey1959,项目名称:pixy,代码行数:21,


示例15: QScrollArea

NotifierWindowTab::NotifierWindowTab(KviWindow * pWnd, QTabWidget * pParent)    : QScrollArea(pParent){	m_pWnd = pWnd;	if(m_pWnd)	{		m_szLabel = m_pWnd->windowName();		connect(pWnd, SIGNAL(windowNameChanged()), this, SLOT(labelChanged()));		connect(pWnd, SIGNAL(destroyed()), this, SLOT(closeMe()));	}	else	{		m_szLabel = "----";	}	if(pParent)	{		m_pParent = pParent;		m_pParent->addTab(this, m_szLabel);	}	setFocusPolicy(Qt::NoFocus);	setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);	setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);	if(verticalScrollBar())		connect(verticalScrollBar(), SIGNAL(rangeChanged(int, int)), this, SLOT(scrollRangeChanged(int, int)));	QPalette pal = palette();	pal.setColor(backgroundRole(), Qt::transparent);	setPalette(pal);	m_pVWidget = new QWidget(viewport());	m_pVBox = new QVBoxLayout(m_pVWidget);	m_pVBox->setSizeConstraint(QLayout::SetFixedSize);	m_pVBox->setSpacing(SPACING);	m_pVBox->setMargin(SPACING);	setWidget(m_pVWidget);}
开发者ID:CardinalSins,项目名称:KVIrc,代码行数:40,


示例16: QTableView

WLibraryTableView::WLibraryTableView(QWidget* parent,                                     ConfigObject<ConfigValue>* pConfig,                                     ConfigKey vScrollBarPosKey)        : QTableView(parent),          m_pConfig(pConfig),          m_vScrollBarPosKey(vScrollBarPosKey) {    // Setup properties for table    // Editing starts when clicking on an already selected item.    setEditTriggers(QAbstractItemView::SelectedClicked);    //Enable selection by rows and extended selection (ctrl/shift click)    setSelectionBehavior(QAbstractItemView::SelectRows);    setSelectionMode(QAbstractItemView::ExtendedSelection);    setWordWrap(false);    setShowGrid(false);    setCornerButtonEnabled(false);    setSortingEnabled(true);    // Used by delegates (e.g. StarDelegate) to tell when the mouse enters a    // cell.    setMouseTracking(true);    //Work around a Qt bug that lets you make your columns so wide you    //can't reach the divider to make them small again.    setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel);    verticalHeader()->hide();    int rowHeight = m_pConfig->getValueString(ConfigKey("[Library]","RowHeight"), "20").toInt();    verticalHeader()->setDefaultSectionSize(rowHeight);    setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);    setAlternatingRowColors(true);    loadVScrollBarPosState();    connect(verticalScrollBar(), SIGNAL(valueChanged(int)),            this, SIGNAL(scrollValueChanged(int)));    setTabKeyNavigation(false);}
开发者ID:neo1973,项目名称:mixxx,代码行数:40,


示例17: switch

void Canvas::keyPressEvent(QKeyEvent* event){    if (!event)    {        return;    }    int mult = 1;    if ((event->modifiers() & Qt::ControlModifier))    {        mult = 10;    }    switch (event->key())    {        case Qt::Key_Right:        {            horizontalScrollBar()->setValue(horizontalScrollBar()->value() + horizontalScrollBar()->singleStep()*mult);            break;        }        case Qt::Key_Left:        {            horizontalScrollBar()->setValue(horizontalScrollBar()->value() - horizontalScrollBar()->singleStep()*mult);            break;        }        case Qt::Key_Up:        {            verticalScrollBar()->setValue(verticalScrollBar()->value() - verticalScrollBar()->singleStep()*mult);            break;        }        case Qt::Key_Down:        {            verticalScrollBar()->setValue(verticalScrollBar()->value() + verticalScrollBar()->singleStep()*mult);            break;        }        default:        {            event->ignore();            break;        }    }}
开发者ID:rickysarraf,项目名称:digikam,代码行数:47,


示例18: atan2

/** * @param x x coordinate * @param y y coordinate */void EditorView::moveDrag(int x, int y){    const int dx = dragx_ - x;    const int dy = dragy_ - y;    if(isdragging_==ROTATE) {        qreal preva = atan2( width()/2 - dragx_, height()/2 - dragy_ );        qreal a = atan2( width()/2 - x, height()/2 - y );        setRotation(rotation() + (preva-a) * (180.0 / M_PI));    } else {        QScrollBar *ver = verticalScrollBar();        ver->setSliderPosition(ver->sliderPosition()+dy);        QScrollBar *hor = horizontalScrollBar();        hor->setSliderPosition(hor->sliderPosition()+dx);    }    dragx_ = x;    dragy_ = y;    // notify of scene change    sceneChanged();}
开发者ID:Galatamon,项目名称:Drawpile,代码行数:26,


示例19: getViewOptions

void Pageview::slotPagePartChanged (const QModelIndex &index,      const QImage &image, int scaled_linenum)   {   const Pagedelegate *del = (Pagedelegate *)itemDelegate ();   QStyleOptionViewItem option = getViewOptions ();   int hvalue = horizontalScrollBar()->value();   int vvalue = verticalScrollBar()->value();   QRect rect = rectForIndex (index);   QRect part_rect;   option.rect = rect;   del->getPagePart (option, index, scaled_linenum, image.height (), part_rect);   part_rect.translate (-hvalue, -vvalue);   QWidget *vp = viewport ();//    qDebug () << "repaint" << part_rect;//    part_rect.setHeight (part_rect.height () - 1);   // leave blank line (for testing!)//    vp->repaint (part_rect);   vp->update (part_rect);   }
开发者ID:arunjalota,项目名称:paperman,代码行数:22,


示例20: scrollTopMax

void ScrollArea::scrollToY(int toTop, int toBottom) {	int toMin = 0, toMax = scrollTopMax();	if (toTop < toMin) {		toTop = toMin;	} else if (toTop > toMax) {		toTop = toMax;	}	bool exact = (toBottom < 0);	int curTop = scrollTop(), curHeight = height(), curBottom = curTop + curHeight, scToTop = toTop;	if (!exact && toTop >= curTop) {		if (toBottom < toTop) toBottom = toTop;		if (toBottom <= curBottom) return;		scToTop = toBottom - curHeight;		if (scToTop > toTop) scToTop = toTop;		if (scToTop == curTop) return;	} else {		scToTop = toTop;	}	verticalScrollBar()->setValue(scToTop);}
开发者ID:AmesianX,项目名称:tdesktop,代码行数:22,


示例21: gestureEvent

    void gestureEvent(QGestureEvent *event)    {        QPanGesture *pan = static_cast<QPanGesture *>(event->gesture(Qt::PanGesture));        if (pan) {            switch(pan->state()) {            case Qt::GestureStarted: qDebug() << this << "Pan: started"; break;            case Qt::GestureFinished: qDebug() << this << "Pan: finished"; break;            case Qt::GestureCanceled: qDebug() << this << "Pan: canceled"; break;            case Qt::GestureUpdated: break;            default: qDebug() << this << "Pan: <unknown state>"; break;            }            if (pan->state() == Qt::GestureStarted)                outside = false;            event->ignore();            event->ignore(pan);            if (outside)                return;            const QPointF delta = pan->delta();            const QPointF totalOffset = pan->offset();            QScrollBar *vbar = verticalScrollBar();            QScrollBar *hbar = horizontalScrollBar();            if ((vbar->value() == vbar->minimum() && totalOffset.y() > 10) ||                (vbar->value() == vbar->maximum() && totalOffset.y() < -10)) {                outside = true;                return;            }            if ((hbar->value() == hbar->minimum() && totalOffset.x() > 10) ||                (hbar->value() == hbar->maximum() && totalOffset.x() < -10)) {                outside = true;                return;            }            vbar->setValue(vbar->value() - delta.y());            hbar->setValue(hbar->value() - delta.x());            event->accept(pan);        }    }
开发者ID:KDE,项目名称:android-qt5-qtbase,代码行数:39,


示例22: connect

void TracksView::initConnections()      {      connect(horizontalHeader(), SIGNAL(sectionResized(int,int,int)),              this, SLOT(updateMainViewSectionWidth(int,int,int)));      connect(verticalHeader(), SIGNAL(sectionResized(int,int,int)),              this, SLOT(updateMainViewSectionHeight(int,int,int)));      connect(verticalHeader(), SIGNAL(sectionMoved(int,int,int)),              SLOT(onVSectionMove(int,int,int)));      connect(horizontalHeader(), SIGNAL(sectionMoved(int,int,int)),              SLOT(onHSectionMove(int,int,int)));      connect(horizontalScrollBar(), SIGNAL(valueChanged(int)),              _frozenHTableView->horizontalScrollBar(), SLOT(setValue(int)));      connect(_frozenHTableView->horizontalScrollBar(), SIGNAL(valueChanged(int)),              horizontalScrollBar(), SLOT(setValue(int)));      connect(verticalScrollBar(), SIGNAL(valueChanged(int)),              _frozenVTableView->verticalScrollBar(), SLOT(setValue(int)));      connect(_frozenVTableView->verticalScrollBar(), SIGNAL(valueChanged(int)),              verticalScrollBar(), SLOT(setValue(int)));      }
开发者ID:AdrianShe,项目名称:MuseScore,代码行数:22,


示例23: toPlainText

ConsoleWidget::~ConsoleWidget(){  output = toPlainText();  consoleWidget = 0;  if(consoleView.loadAndSaveOutput)  {    QSettings& settings = RoboCupCtrl::application->getLayoutSettings();    settings.beginGroup(consoleView.fullName);    settings.setValue("Output", output);    QTextCursor cursor = textCursor();    settings.setValue("selectionStart", cursor.anchor());    settings.setValue("selectionEnd", cursor.position());      QScrollBar* scrollBar = verticalScrollBar();    settings.setValue("verticalScrollPosition", scrollBar->value());    settings.setValue("verticalScrollMaximum", scrollBar->maximum());    settings.endGroup();    output.clear();  }}
开发者ID:RomanMichna,项目名称:diplomovka,代码行数:22,


示例24: selectionModel

void ThumbnailView::rowsInserted( const QModelIndex &parent, int start, int end ){    QListView::rowsInserted( parent, start, end );    if( !Qtopia::mousePreferred() )    {        if( !currentIndex().isValid() )            selectionModel()->setCurrentIndex( model()->index( 0, 0, parent ), QItemSelectionModel::ClearAndSelect );    }    else        selectionModel()->clearSelection();    QScrollBar *vScroll = verticalScrollBar();    int startY = visualRect( model()->index( start, 0 ) ).top();    int endY = visualRect( model()->index( end + 1, 0 ) ).top();    int scrollValue = vScroll->value() + endY - startY;    if( startY <= 0 )        vScroll->setValue( scrollValue );}
开发者ID:Camelek,项目名称:qtmoko,代码行数:22,


示例25: qAtan2

/** * @param x x coordinate * @param y y coordinate */void CanvasView::moveDrag(int x, int y){	const int dx = _dragx - x;	const int dy = _dragy - y;	if(_isdragging==ROTATE) {		qreal preva = qAtan2( width()/2 - _dragx, height()/2 - _dragy );		qreal a = qAtan2( width()/2 - x, height()/2 - y );		setRotation(rotation() + qRadiansToDegrees(preva-a));	} else {		QScrollBar *ver = verticalScrollBar();		ver->setSliderPosition(ver->sliderPosition()+dy);		QScrollBar *hor = horizontalScrollBar();		hor->setSliderPosition(hor->sliderPosition()+dx);	}	_dragx = x;	_dragy = y;	// notify of scene change	sceneChanged();}
开发者ID:hexaditidom,项目名称:Drawpile,代码行数:26,


示例26: viewportSize

    QSize viewportSize( int w, int h ) const    {        const int sbHeight = horizontalScrollBar()->sizeHint().height();        const int sbWidth = verticalScrollBar()->sizeHint().width();        const int cw = contentsRect().width();        const int ch = contentsRect().height();        int vw = cw;        int vh = ch;        if ( w > vw )            vh -= sbHeight;        if ( h > vh )        {            vw -= sbWidth;            if ( w > vw && vh == ch )                vh -= sbHeight;        }        return QSize( vw, vh );    }
开发者ID:anomtria,项目名称:getaran_syahdu,代码行数:22,


示例27: horizontalScrollBar

/*!/brief reimplementation of the mouseMoveEvent * * ... */void LaunchFileView::mouseMoveEvent(QMouseEvent *event){    /// Otherwise we get SegFault after adding an item and selecting Linemode before clicking once to the graphicsview    if (_handScrolling) {        QPoint delta = event->pos() - _handScrollingOrigin;        horizontalScrollBar()->setValue(_handScrollingValueX - delta.x());        verticalScrollBar()->setValue(_handScrollingValueY - delta.y());        event->accept();        return;    }else if (myMode == InsertLine && line != 0) {        QLineF newLine(line->line().p1(), mapToScene(event->pos()));        line->setLine(newLine);    } else if (myMode == DragItem) {        QGraphicsView::mouseMoveEvent(event);    } else{        event->setAccepted(false);    }}
开发者ID:6opb6a,项目名称:rxdeveloper-ros-pkg,代码行数:26,


示例28: Q_UNUSED

void AMScanThumbnailGridView::scrollTo(const QModelIndex &index, QAbstractItemView::ScrollHint hint){    // Note: currently ignores the scroll hint. Places the corresponding scan as close to the top of    // the view as is possible    Q_UNUSED(hint);    if(!index.isValid())        return;    // If the passed index refers to a thumbnail (i.e. its parent is valid) then we need to    // scrollTo the index of the parent scan    if(index.parent().isValid()) {        scrollTo(index.parent(), hint);        return;    }    // Obtian the geometry of the index    int itemCellIndex = index.row();    QRect indexCellGeometry = geometryManager_->cellGeometryAt(itemCellIndex, horizontalOffset(), verticalOffset());    verticalScrollBar()->setValue(indexCellGeometry.y());    horizontalScrollBar()->setValue(indexCellGeometry.x());}
开发者ID:acquaman,项目名称:acquaman,代码行数:23,


示例29: QAbstractItemView

CurveView::CurveView(QWidget *parent) :		QAbstractItemView(parent){	horizontalScrollBar()->setRange(0, 0);	verticalScrollBar()->setRange(0, 0);	/* Sizes */	m_nMargin = 10;	m_nLabelSize[0] = 75;	m_nLabelSize[1] = 15;	m_nTickSize[0] = 64;	m_nTickSize[1] = 2;	m_nDrawAreaMinimum[0] = 256;	m_nDrawAreaMinimum[1] = 100;	m_nAxisArrow[0] = 3;	m_nAxisArrow[1] = 3;	m_nTickSpace[0] = 50;	m_nTickSpace[1] = 20;	m_nBase = -1;	updateGeometries();}
开发者ID:Teybeo,项目名称:GLSL-Debugger,代码行数:23,


示例30: QTreeView

SmartList::SmartList(QWidget *parent) :    QTreeView(parent){    verticalScrollBar()->hide();    connect(this, &QAbstractItemView::entered, [this](const QModelIndex & index) {        auto widget = indexWidget(index);        if (!widget) {            ComBar* bar = new ComBar();            setIndexWidget(index, bar);            connect(bar, &ComBar::btnVideoClicked, this, [=](){ emit btnVideoClicked(); });        }        else if (index.isValid())            indexWidget(index)->setVisible(true);        if(hoveredRow_.isValid() and indexWidget(hoveredRow_))            indexWidget(hoveredRow_)->setVisible(false);        hoveredRow_ = index;    });    setVerticalScrollMode(ScrollPerPixel);}
开发者ID:BenjaminLefoul,项目名称:ring-client-windows,代码行数:23,



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


C++ vexRT函数代码示例
C++ verticalHeader函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。