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


C++ ChatViewSettings::showWebPreview方法代码示例

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


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

示例1: viewSettings

ChatScene::ChatScene(QAbstractItemModel *model, const QString &idString, qreal width, ChatView *parent)
  : QGraphicsScene(0, 0, width, 0, (QObject *)parent),
    _chatView(parent),
    _idString(idString),
    _model(model),
    _singleBufferId(BufferId()),
    _sceneRect(0, 0, width, 0),
    _firstLineRow(-1),
    _viewportHeight(0),
    _markerLine(new MarkerLineItem(width)),
    _markerLineVisible(false),
    _markerLineValid(false),
    _markerLineJumpPending(false),
    _cutoffMode(CutoffRight),
    _selectingItem(0),
    _selectionStart(-1),
    _isSelecting(false),
    _clickMode(NoClick),
    _clickHandled(true),
    _leftButtonPressed(false)
{
  MessageFilter *filter = qobject_cast<MessageFilter*>(model);
  if(filter && filter->isSingleBufferFilter()) {
    _singleBufferId = filter->singleBufferId();
  }

  addItem(_markerLine);
  connect(this, SIGNAL(sceneRectChanged(const QRectF &)), _markerLine, SLOT(sceneRectChanged(const QRectF &)));

  ChatViewSettings defaultSettings;
  int defaultFirstColHandlePos = defaultSettings.value("FirstColumnHandlePos", 80).toInt();
  int defaultSecondColHandlePos = defaultSettings.value("SecondColumnHandlePos", 200).toInt();

  ChatViewSettings viewSettings(this);
  _firstColHandlePos = viewSettings.value("FirstColumnHandlePos", defaultFirstColHandlePos).toInt();
  _secondColHandlePos = viewSettings.value("SecondColumnHandlePos", defaultSecondColHandlePos).toInt();

  _firstColHandle = new ColumnHandleItem(QtUi::style()->firstColumnSeparator());
  addItem(_firstColHandle);
  _firstColHandle->setXPos(_firstColHandlePos);
  connect(_firstColHandle, SIGNAL(positionChanged(qreal)), this, SLOT(firstHandlePositionChanged(qreal)));
  connect(this, SIGNAL(sceneRectChanged(const QRectF &)), _firstColHandle, SLOT(sceneRectChanged(const QRectF &)));

  _secondColHandle = new ColumnHandleItem(QtUi::style()->secondColumnSeparator());
  addItem(_secondColHandle);
  _secondColHandle->setXPos(_secondColHandlePos);
  connect(_secondColHandle, SIGNAL(positionChanged(qreal)), this, SLOT(secondHandlePositionChanged(qreal)));

  connect(this, SIGNAL(sceneRectChanged(const QRectF &)), _secondColHandle, SLOT(sceneRectChanged(const QRectF &)));

  setHandleXLimits();

  if(model->rowCount() > 0)
    rowsInserted(QModelIndex(), 0, model->rowCount() - 1);

  connect(model, SIGNAL(rowsInserted(const QModelIndex &, int, int)),
          this, SLOT(rowsInserted(const QModelIndex &, int, int)));
  connect(model, SIGNAL(rowsAboutToBeRemoved(const QModelIndex &, int, int)),
          this, SLOT(rowsAboutToBeRemoved(const QModelIndex &, int, int)));
  connect(model, SIGNAL(rowsRemoved(QModelIndex,int,int)),
          this, SLOT(rowsRemoved()));
  connect(model, SIGNAL(dataChanged(QModelIndex, QModelIndex)), SLOT(dataChanged(QModelIndex, QModelIndex)));

#ifdef HAVE_WEBKIT
  webPreview.timer.setSingleShot(true);
  connect(&webPreview.timer, SIGNAL(timeout()), this, SLOT(webPreviewNextStep()));
#endif
  _showWebPreview = defaultSettings.showWebPreview();
  defaultSettings.notify("ShowWebPreview", this, SLOT(showWebPreviewChanged()));

  _clickTimer.setInterval(QApplication::doubleClickInterval());
  _clickTimer.setSingleShot(true);
  connect(&_clickTimer, SIGNAL(timeout()), SLOT(clickTimeout()));

  setItemIndexMethod(QGraphicsScene::NoIndex);
}
开发者ID:ginggs,项目名称:quassel2go,代码行数:76,代码来源:chatscene.cpp

示例2: showWebPreviewChanged

void ChatScene::showWebPreviewChanged() {
  ChatViewSettings settings;
  _showWebPreview = settings.showWebPreview();
}
开发者ID:hades,项目名称:quassel,代码行数:4,代码来源:chatscene.cpp


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