本文整理汇总了C++中setAcceptedMouseButtons函数的典型用法代码示例。如果您正苦于以下问题:C++ setAcceptedMouseButtons函数的具体用法?C++ setAcceptedMouseButtons怎么用?C++ setAcceptedMouseButtons使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setAcceptedMouseButtons函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: switch
bool StelSkyItem::event(QEvent * e)
{
switch (e->type()){
case QEvent::TouchBegin:
case QEvent::TouchUpdate:
case QEvent::TouchEnd:
{
QTouchEvent *touchEvent = static_cast<QTouchEvent *>(e);
QList<QTouchEvent::TouchPoint> touchPoints = touchEvent->touchPoints();
if (touchPoints.count() == 1)
setAcceptedMouseButtons(Qt::LeftButton | Qt::RightButton | Qt::MiddleButton);
return true;
break;
}
case QEvent::Gesture:
setAcceptedMouseButtons(0);
return gestureEvent(static_cast<QGestureEvent*>(e));
break;
default:
return QGraphicsWidget::event(e);
}
}
开发者ID:magnific0,项目名称:stellarium,代码行数:26,代码来源:StelMainView.cpp
示例2: setAcceptHoverEvents
//!
//! Enables or disables the graphics item.
//!
//! \param enabled The new enabled state for the item.
//!
void ConnectionGraphicsItem::setEnabled ( bool enabled )
{
QGraphicsLineItem::setEnabled(enabled);
setAcceptHoverEvents(enabled);
if (enabled)
setAcceptedMouseButtons(Qt::LeftButton | Qt::MidButton | Qt::RightButton | Qt::XButton1 | Qt::XButton2);
else
setAcceptedMouseButtons(0);
}
开发者ID:banduladh,项目名称:levelfour,代码行数:15,代码来源:ConnectionGraphicsItem.cpp
示例3: setAcceptedMouseButtons
void Pin::setActivity(const bool& b)
{
mEnabled = b;
if (mEnabled) {
setAcceptedMouseButtons(Qt::LeftButton);
setCursor(Qt::PointingHandCursor);
} else {
setAcceptedMouseButtons(Qt::NoButton);
setCursor(Qt::ArrowCursor);
}
}
开发者ID:mehdioa,项目名称:qtmind,代码行数:11,代码来源:pin.cpp
示例4: setAcceptsHoverEvents
void Applet::setInteractive(bool interactive)
{
m_interactive = interactive;
if(m_interactive)
{
setAcceptsHoverEvents(true);
setAcceptedMouseButtons(Qt::RightButton | Qt::LeftButton);
}
else
{
setAcceptsHoverEvents(false);
setAcceptedMouseButtons(Qt::RightButton);
}
}
开发者ID:AOSC-Dev,项目名称:qtpanel,代码行数:15,代码来源:applet.cpp
示例5: QGraphicsPathItem
Stripbit::Stripbit(const QPainterPath & path, ConnectorItem * connectorItem, int x, int y, QGraphicsItem * parent = 0)
: QGraphicsPathItem(path, parent)
{
if (SpotFaceCutterCursor == NULL) {
QBitmap bitmap(":resources/images/cursor/spot_face_cutter.bmp");
QBitmap bitmapm(":resources/images/cursor/spot_face_cutter_mask.bmp");
SpotFaceCutterCursor = new QCursor(bitmap, bitmapm, 0, 0);
}
if (MagicWandCursor == NULL) {
QBitmap bitmap(":resources/images/cursor/magic_wand.bmp");
QBitmap bitmapm(":resources/images/cursor/magic_wand_mask.bmp");
MagicWandCursor = new QCursor(bitmap, bitmapm, 0, 0);
}
setZValue(-999); // beneath connectorItems
setPen(Qt::NoPen);
// TODO: don't hardcode this color
setBrush(QColor(0xbc, 0x94, 0x51)); // QColor(0xc4, 0x9c, 0x59)
m_right = NULL;
m_x = x;
m_y = y;
m_connectorItem = connectorItem;
m_inHover = m_removed = false;
setAcceptsHoverEvents(true);
setAcceptedMouseButtons(Qt::LeftButton);
setFlag(QGraphicsItem::ItemIsMovable, true);
setFlag(QGraphicsItem::ItemIsSelectable, false);
}
开发者ID:honsey,项目名称:fztaxedit,代码行数:35,代码来源:stripboard.cpp
示例6: QQuickItem
QDeclarativeGeoMap::QDeclarativeGeoMap(QQuickItem *parent)
: QQuickItem(parent),
m_plugin(0),
m_serviceProvider(0),
m_mappingManager(0),
m_center(51.5073,-0.1277), //London city center
m_activeMapType(0),
m_gestureArea(new QQuickGeoMapGestureArea(this)),
m_map(0),
m_error(QGeoServiceProvider::NoError),
m_zoomLevel(8.0),
m_componentCompleted(false),
m_mappingManagerInitialized(false),
m_color(QColor::fromRgbF(0.9, 0.9, 0.9)),
m_pendingFitViewport(false),
m_validRegion(false)
{
setAcceptHoverEvents(false);
setAcceptedMouseButtons(Qt::LeftButton);
setFlags(QQuickItem::ItemHasContents | QQuickItem::ItemClipsChildrenToShape);
setFiltersChildMouseEvents(true);
connect(this, SIGNAL(childrenChanged()), this, SLOT(onMapChildrenChanged()), Qt::QueuedConnection);
m_activeMapType = new QDeclarativeGeoMapType(QGeoMapType(QGeoMapType::NoMap,
tr("No Map"),
tr("No Map"), false, false, 0), this);
}
开发者ID:2gis,项目名称:2gisqt5android,代码行数:28,代码来源:qdeclarativegeomap.cpp
示例7: Item
SelectedItem::SelectedItem(Item* selectedItem, const StyleType* style) :
Item(nullptr, style), selectedItem_(selectedItem)
{
setFlags(0);
setAcceptedMouseButtons(0);
setZValue(LAYER_SELECTION_Z);
}
开发者ID:Andresbu,项目名称:Envision,代码行数:7,代码来源:SelectedItem.cpp
示例8: QDeclarativeWebViewPrivate
void QDeclarativeWebView::init()
{
d = new QDeclarativeWebViewPrivate(this);
if (QWebSettings::iconDatabasePath().isNull() &&
QWebSettings::globalSettings()->localStoragePath().isNull() &&
QWebSettings::offlineStoragePath().isNull() &&
QWebSettings::offlineWebApplicationCachePath().isNull())
QWebSettings::enablePersistentStorage();
setAcceptedMouseButtons(Qt::LeftButton);
setFlag(QGraphicsItem::ItemHasNoContents, true);
setFlag(QGraphicsItem::ItemIsFocusScope, true);
setClip(true);
d->view = new GraphicsWebView(this);
d->view->setResizesToContents(true);
d->view->setFocus();
QWebPage* wp = new QDeclarativeWebPage(this);
setPage(wp);
if (!preferredWidth())
setPreferredWidth(d->view->preferredWidth());
if (!preferredHeight())
setPreferredHeight(d->view->preferredHeight());
connect(d->view, SIGNAL(geometryChanged()), this, SLOT(updateDeclarativeWebViewSize()));
connect(d->view, SIGNAL(doubleClick(int,int)), this, SIGNAL(doubleClick(int,int)));
connect(d->view, SIGNAL(scaleChanged()), this, SIGNAL(contentsScaleChanged()));
}
开发者ID:RobinWuDev,项目名称:Qt,代码行数:28,代码来源:qdeclarativewebview.cpp
示例9: QQuickPaintedItem
QmlWebViewWidget::QmlWebViewWidget(QQuickItem *parent) :
QQuickPaintedItem(parent)
{
setOpaquePainting(true);
setAcceptHoverEvents(true);
setAcceptedMouseButtons(Qt::AllButtons);
setFlag(QQuickItem::ItemAcceptsDrops, true);
setFlag(QQuickItem::ItemHasContents, true);
m_widget = new QmlWebViewInternalWidget(this);
connect(m_widget, SIGNAL(urlChanged(QUrl)), this, SIGNAL(urlChanged(QUrl)) );
connect(m_widget, SIGNAL(loadStarted()), this, SIGNAL(loadStarted()));
connect(m_widget, SIGNAL(loadFinished(bool)), this, SIGNAL(loadFinished(bool)));
connect(m_widget, SIGNAL(loadProgress(int)), this, SIGNAL(loadProgress(int)));
QObject::connect(this, &QQuickPaintedItem::widthChanged, this, [this]{
QQuickWindow *w = this->window();
if(w){
QObject::connect(w, &QQuickWindow::xChanged,
this, &QmlWebViewWidget::updateGeometry,
(Qt::ConnectionType)(Qt::AutoConnection|Qt::UniqueConnection));
}
});
}
开发者ID:Gawhary,项目名称:QMLWebviewWidget,代码行数:28,代码来源:QmlWebViewWidget.cpp
示例10: setFlag
GraphicObservationPointItem::GraphicObservationPointItem(ObservationPoint * _obsPoint,qreal _posx,qreal _posy,qreal _width,QDateTime _startdate,QDateTime _obsdate,QGraphicsItem * _parent)
:QGraphicsItem(_parent)
{
this->setParentItem(_parent);
this->width=_width;
this->parent=_parent;
this->obsPoint=_obsPoint;
this->setPos(_posx,0);
this->posx=_posx;
this->posy=_posy;
setFlag(QGraphicsItem::ItemIsMovable, true);
setFlag(QGraphicsItem::ItemIsSelectable, true);
setFlag(QGraphicsItem::ItemIsFocusable, true);
setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
setAcceptDrops(true);
setAcceptHoverEvents(true);
setAcceptedMouseButtons(Qt::LeftButton);
qreal parent_h=static_cast<GraphicStoryItem*>(this->parent)->get_rect().height();
qreal parent_y=static_cast<GraphicStoryItem*>(this->parent)->get_rect().y();
this->setAcceptHoverEvents(false);
QPointF point2=QPointF(posx,parent_y+parent_h/2);
this->rect=QRectF(point2-QPointF(10,10),point2+QPointF(10,10));
if (static_cast<GraphicStoryItem*>(parent)->get_isStorySplit()){
this->obsPoint->set_timepoint(_obsdate);
this->setToolTip(translate_second_in_DD_HH_MM_SS(get_seconds_from_date(_startdate,this->obsPoint->get_timepoint())));
}
else{
this->obsPoint->set_timepoint(_obsdate);
this->setToolTip(translate_second_in_DD_HH_MM_SS(get_seconds_from_date(_startdate,this->obsPoint->get_timepoint())));
}
}
开发者ID:cbib,项目名称:XEML-Lab,代码行数:32,代码来源:graphicobservationpointitem.cpp
示例11: QGraphicsTextItem
TimeDisplay::TimeDisplay(QGraphicsItem* parent) : QGraphicsTextItem(parent)
{
setAcceptedMouseButtons(Qt::NoButton);
setAcceptHoverEvents(false);
mFont = QFont("Arial", 18, QFont::Normal, false);
mFont.setStyleHint(QFont::SansSerif);
mFont.setPixelSize(24);
setFont(mFont);
setDefaultTextColor(QColor("#d7d8da"));
mShowTenth = true;
mSs = mLastSs = "";
mHs = "";
mInterval = 50;
mPaused = false;
mStopped = true;
mGameTime = 0;
mTime = 0;
mTimer = new GameTimer(this);
connect(mTimer, SIGNAL(TimeOutSignal(int)), this, SLOT(DisplayTime(int)));
mTimer->Start();
setTextWidth(440);
setTransform(QTransform::fromScale(0.5, 0.5), true);
//scale(0.5, 0.5);
}
开发者ID:vakkov,项目名称:ColorCode,代码行数:29,代码来源:timedisplay.cpp
示例12: QString
Window::Window(const QString &title, const QSizeF &size,
const QString &path/* = QString()*/, bool isModal/* = false*/, bool isShowTitle/* = true*/)
: size(size), keep_when_disappear(false), m_isModal(isModal)
{
setFlags(ItemIsMovable);
setAcceptedMouseButtons(Qt::LeftButton);
setData(0, title);
if (!path.isEmpty()) {
outimg = new QImage(path);
}
else {
outimg = size.width() > size.height()
? new QImage("image/system/tip.png")
: new QImage("image/system/about.png");
}
scaleTransform = new QGraphicsScale(this);
scaleTransform->setXScale(1.05);
scaleTransform->setYScale(0.95);
scaleTransform->setOrigin(QVector3D(boundingRect().width() / 2, boundingRect().height() / 2, 0));
QList<QGraphicsTransform *> transforms;
transforms << scaleTransform;
setTransformations(transforms);
setOpacity(0.0);
if (isShowTitle) {
titleItem = new QGraphicsTextItem(this);
setTitle(title);
}
}
开发者ID:Jia731,项目名称:QSanguosha-Para-tangjs520,代码行数:34,代码来源:window.cpp
示例13: QQuickPaintedItem
QmlMapControl::QmlMapControl (QQuickItem *parent) :
QQuickPaintedItem(parent)
{
setOpaquePainting(true);
setAcceptHoverEvents(true);
setAcceptedMouseButtons(Qt::AllButtons);
layermanager = new LayerManager(this, size);
screen_middle = QPoint(size.width()/2, size.height()/2);
mousepressed = false;
scaleVisible = true;
crosshairsVisible = true;
mymousemode = Panning;
mouse_wheel_events = true;
connect(ImageManager::instance(), SIGNAL(imageReceived()),
this, SLOT(updateRequestNew()));
connect(ImageManager::instance(), SIGNAL(loadingFinished()),
this, SLOT(loadingFinished()));
setWidth(size.width()+1);
setHeight(size.height()+1);
connect( this, SIGNAL(widthChanged()) , SLOT(sizeChanged()) );
connect( this, SIGNAL(heightChanged()), SLOT(sizeChanged()) );
}
开发者ID:sialan-labs,项目名称:kaqaz,代码行数:28,代码来源:qmlmapcontrol.cpp
示例14: QGraphicsRectItem
Square::Square(const QPointF & top_left, const unsigned int square, const square_t type, QGraphicsItem * parent)
: QGraphicsRectItem(top_left.x(), top_left.y(), SQUARE_SIZE, SQUARE_SIZE, parent),
square_(square),
type_(type),
highlighted_(false) {
setAcceptedMouseButtons(0);
}
开发者ID:joca-bt,项目名称:Turska,代码行数:7,代码来源:gui_board_components.cpp
示例15: setToolTip
Peg::Peg(QColor c) : color{c} {
setToolTip(QString("QColor(%1, %2, %3)\n%4")
.arg(color.red()).arg(color.green()).arg(color.blue())
.arg("Click and drag this color onto the board!"));
setCursor(Qt::OpenHandCursor);
setAcceptedMouseButtons(Qt::LeftButton);
}
开发者ID:bmccorvey3,项目名称:Mastermind,代码行数:7,代码来源:peg.cpp
示例16: setFlags
// class ChatWidget -->
ChatWidget::ChatWidget():base_pixmap("image/system/chatface/base.png")
{
setFlags(ItemIsFocusable);
setAcceptHoverEvents(true);
setAcceptedMouseButtons(Qt::LeftButton);
base = new QGraphicsRectItem(QRectF(base_pixmap.rect()), this);
QPushButton *returnButton, *chatfaceButton, *easytextButton;
returnButton=addButton("returnBt",-1);
chatfaceButton=addButton("chatfaceBt",24);
easytextButton=addButton("easytextBt",48+1);
chat_face_board = new MyPixmapItem(QPixmap("image/system/chatface/faceboard.png"),this);
chat_face_board->setSize(160,180);
chat_face_board->setPos(-160 + 74,-180-1);// 24+24+24+2=74
chat_face_board->setZValue(1);
chat_face_board->setVisible(false);
chat_face_board->itemName="faceboard";
easy_text_board=new MyPixmapItem(QPixmap("image/system/chatface/easytextboard.png"),this);
easy_text_board->setSize(180,222);
easy_text_board->setPos(-180 + 74,-222-1);
easy_text_board->setZValue(1);
easy_text_board->setVisible(false);
easy_text_board->itemName="easytextboard";
connect (chat_face_board,SIGNAL(my_pixmap_item_msg(QString)),this,SIGNAL(chat_widget_msg(QString)));
connect (easy_text_board,SIGNAL(my_pixmap_item_msg(QString)),this,SIGNAL(chat_widget_msg(QString)));
connect(chatfaceButton, SIGNAL(clicked()), this, SLOT(showFaceBoard()));
connect(easytextButton, SIGNAL(clicked()), this, SLOT(showEasyTextBoard()));
connect(returnButton, SIGNAL(clicked()), this, SLOT(sendText()));
}
开发者ID:654865468,项目名称:QSanguosha,代码行数:34,代码来源:chatwidget.cpp
示例17: m_panelWindow
Applet::Applet(PanelWindow* panelWindow)
: m_panelWindow(panelWindow), m_highlightIntensity(0.0), m_interactive(false)
{
setZValue(-1.0);
setAcceptedMouseButtons(Qt::RightButton);
setParentItem(m_panelWindow->panelItem());
}
开发者ID:AOSC-Dev,项目名称:qtpanel,代码行数:7,代码来源:applet.cpp
示例18: QQuickPaintedItem
BaseWidget::BaseWidget(QQuickItem *parent)
: QQuickPaintedItem(parent)
{
setWidth(200);
setHeight(200);
setAcceptedMouseButtons(Qt::LeftButton | Qt::RightButton | Qt::MidButton);
}
开发者ID:ThomasGoerttler,项目名称:Volleytactics,代码行数:7,代码来源:BaseWidget.cpp
示例19: Q_D
void KMaskImageItem::setMaskMouse( bool bMask )
{
Q_D(KMaskImageItem);
d->m_bMaskMose = bMask;
setAcceptHoverEvents(d->m_bMaskMose);
setAcceptedMouseButtons(bMask ? (Qt::LeftButton|Qt::RightButton) : 0);
}
开发者ID:kxtry,项目名称:kxfw,代码行数:7,代码来源:kmaskimageitem.cpp
示例20: setAcceptedMouseButtons
void QDeclarative1MouseArea::setAcceptedButtons(Qt::MouseButtons buttons)
{
if (buttons != acceptedMouseButtons()) {
setAcceptedMouseButtons(buttons);
emit acceptedButtonsChanged();
}
}
开发者ID:yinyunqiao,项目名称:qtdeclarative,代码行数:7,代码来源:qdeclarativemousearea.cpp
注:本文中的setAcceptedMouseButtons函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论