CanvasQt::CanvasQt(QGLParent* parent, uvec2 dim) : QGLWindow(parent) , CanvasGL(dim) , swapBuffersAllowed_(false) #ifndef QT_NO_GESTURES , gestureMode_(false) , lastType_(Qt::CustomGesture) , lastNumFingers_(0) , screenPositionNormalized_(vec2(0.f)) #endif { setFormat(sharedFormat_); if (sharedGLContext_) { this->context()->setShareContext(sharedGLContext_->context()); } create(); setFocusPolicy(Qt::StrongFocus); #ifndef QT_NO_GESTURES grabGesture(Qt::PanGesture); grabGesture(Qt::PinchGesture); #endif QGLWindow::resizeEvent(&QResizeEvent(QSize(dim.x, dim.y), QSize(width(), height()))); if (!sharedGLContext_) { sharedFormat_ = this->format(); sharedGLContext_ = this; sharedCanvas_ = this; } }
EmergencyWindowManager::EmergencyWindowManager(int maxWidth, int maxHeight) : WindowManagerBase(maxWidth, maxHeight) , m_emergencyWindow(0) , m_cornerContainer(0) { memset(m_corners, 0, sizeof(m_corners)); setObjectName("EmergencyWindowManager"); ::memset(m_corners, 0, 4 * sizeof(QGraphicsPixmapItem*)); connect(SystemUiController::instance(), SIGNAL(signalPositiveSpaceChanged(const QRect&)), this, SLOT(slotPositiveSpaceChanged(const QRect&))); connect(SystemService::instance(), SIGNAL(signalIncomingPhoneCall()), this, SLOT(slotIncomingPhoneCall())); connect(SystemUiController::instance(), SIGNAL(signalEmergencyModeHomeButtonPressed()), this, SLOT(slotHomeButtonPressed())); connect(SystemUiController::instance(), SIGNAL(signalEmergencyModeWindowFocusChange(bool)), this, SLOT(slotEmergencyModeWindowFocusChange(bool))); connect(SystemUiController::instance(), SIGNAL(signalUiRotationCompleted()), this, SLOT(slotUiRotationCompleted())); m_winRect.setRect(0, 0, maxWidth, maxHeight); grabGesture(Qt::TapGesture); grabGesture(Qt::TapAndHoldGesture); grabGesture(Qt::PinchGesture); grabGesture((Qt::GestureType) SysMgrGestureFlick); grabGesture((Qt::GestureType) SysMgrGestureSingleClick); setVisible(false); }
AndroidMainWindow::AndroidMainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::AndroidMainWindow) { ui->setupUi(this); t = QTime::currentTime(); t.start(); grabGesture(Qt::TapGesture); grabGesture(Qt::TapAndHoldGesture); grabGesture(Qt::PanGesture); grabGesture(Qt::PinchGesture); grabGesture(Qt::SwipeGesture); connect (ui->actionMdSupportForum, SIGNAL(triggered()), this, SLOT(fireSupportForumIntent()) ); QSettings settings; if ( settings.value("md/md", QVariant ( MDMODE ).toBool() ) == false ) { ui->actionV2_N75_Settings->setVisible(false); ui->actionGearbox_settings->setVisible(false); ui->menuData->setTitle("Digifant 1"); ui->actionMdSupportForum->setText("more information"); } }
CanvasQt::CanvasQt(QGLParent* parent, uvec2 dim) : QGLWindow(sharedFormat_, parent, sharedGLContext_) , CanvasGL(dim) , swapBuffersAllowed_(false) #ifndef QT_NO_GESTURES , gestureMode_(false) , lastType_(Qt::CustomGesture) , lastNumFingers_(0) , screenPositionNormalized_(vec2(0.f)) #endif { //This is our default rendering context //Initialized once. So "THE" first object of this class will not have any shared context (or widget) //But Following objects, will share the context of initial object if (!sharedGLContext_) { sharedFormat_ = this->format(); sharedGLContext_ = this; sharedCanvas_ = this; QGLWindow::glInit(); } setAutoBufferSwap(false); setFocusPolicy(Qt::StrongFocus); #ifndef QT_NO_GESTURES grabGesture(Qt::PanGesture); grabGesture(Qt::PinchGesture); #endif }
/*! \brief Constructor Configures scroll area settings and resets internal stares of widget. Gets the width of device. \param parent The parent of scroll area widget */ CalenDayContentScrollArea::CalenDayContentScrollArea(QGraphicsItem *parent) : HbScrollArea(parent), mPanDayDirection(ECalenPanNotSet), mIsMoving(false), mMoveDirection(ECalenScrollNoDayChange), mDisallowedDirection(ECalenScrollNoDayChange) { #ifdef CALENDAYVIEW_PANNING_ENABLED grabGesture(Qt::PanGesture); ungrabGesture(Qt::SwipeGesture); #else grabGesture(Qt::SwipeGesture); ungrabGesture(Qt::PanGesture); #endif // Get the width of content area and orientation of screen mContentWidth = CalenDayUtils::instance()->contentWidth(); mOrientation = CalenDayUtils::instance()->orientation(); // Fix the width of scroll area setMinimumWidth(mContentWidth); setMaximumWidth(mContentWidth); // Connect to main window's orientationChanged SIGNAL to handle orientation // switching connect(CalenDayUtils::instance()->mainWindow(), SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(orientationChanged(Qt::Orientation))); }
/* ***************************************************************** * Name : CpLockEdit * Parameters : QString&, QGraphicsitem * Return value: None * Description : constructor ***************************************************************** */ CpLockEdit::CpLockEdit(const QString &text, QGraphicsItem *parent /*= 0*/) : HbLineEdit(text,parent) { RDEBUG("0", 0); grabGesture(Qt::TapGesture); grabGesture(Qt::PanGesture); grabGesture(Qt::PinchGesture); grabGesture(Qt::SwipeGesture); }
MyQGraphicsObject::MyQGraphicsObject(QGraphicsItem* parent) : QGraphicsObject(parent) , brush_(Qt::blue) { grabGesture(Qt::PinchGesture); grabGesture(Qt::PanGesture); grabGesture(Qt::SwipeGesture); grabGesture(Qt::TapAndHoldGesture); grabGesture(Qt::TapGesture); setAcceptTouchEvents(true); }
RGraphicsViewQt::RGraphicsViewQt(QWidget* parent, bool showFocus) : QWidget(parent), RGraphicsViewImage(), showFocus(showFocus), focusFrameWidget(NULL), gesturesEnabled(true) { setFocusPolicy(Qt::WheelFocus); setMouseTracking(true); lastButtonState = Qt::NoButton; setAutoFillBackground(false); grabGesture(Qt::PanGesture); grabGesture(Qt::PinchGesture); }
View::View(QWidget *parent) : QGraphicsView(parent) , m_zoomFactor(1.0) { setBackgroundBrush(QBrush(s_backgroundColor)); setCacheMode(QGraphicsView::CacheBackground); setRenderHints(QPainter::Antialiasing); setViewportUpdateMode(QGraphicsView::MinimalViewportUpdate); setTransformationAnchor(QGraphicsView::AnchorUnderMouse); setDragMode(QGraphicsView::RubberBandDrag); setAttribute(Qt::WA_AcceptTouchEvents); grabGesture(Qt::PanGesture); grabGesture(Qt::PinchGesture); }
void ClassificationWidget::grabGestures(const QList<Qt::GestureType> &gestures) { //! [enable gestures] foreach (Qt::GestureType gesture, gestures) grabGesture(gesture); //! [enable gestures] }
SimObjectWidget::SimObjectWidget(SimObject& simObject) : QGLWidget(QGLFormat(QGL::SampleBuffers | QGL::AccumBuffer), 0, Simulation::simulation->renderer.getWidget()), object(dynamic_cast<SimRobot::Object&>(simObject)), objectRenderer(simObject), wkey(false), akey(false), skey(false), dkey(false) { setFocusPolicy(Qt::StrongFocus); grabGesture(Qt::PinchGesture); setAttribute(Qt::WA_AcceptTouchEvents); // load layout settings QSettings* settings = &CoreModule::application->getLayoutSettings(); settings->beginGroup(object.getFullName()); objectRenderer.setSurfaceShadeMode(SimRobotCore2::Renderer::ShadeMode(settings->value("SurfaceShadeMode", int(objectRenderer.getSurfaceShadeMode())).toInt())); objectRenderer.setPhysicsShadeMode(SimRobotCore2::Renderer::ShadeMode(settings->value("PhysicsShadeMode", int(objectRenderer.getPhysicsShadeMode())).toInt())); objectRenderer.setDrawingsShadeMode(SimRobotCore2::Renderer::ShadeMode(settings->value("DrawingsShadeMode", int(objectRenderer.getDrawingsShadeMode())).toInt())); objectRenderer.setCameraMode(SimRobotCore2::Renderer::CameraMode(settings->value("CameraMode", int(objectRenderer.getCameraMode())).toInt())); fovy = settings->value("FovY", objectRenderer.getFovY()).toInt(); objectRenderer.setDragPlane(SimRobotCore2::Renderer::DragAndDropPlane(settings->value("DragPlane", int(objectRenderer.getDragPlane())).toInt())); objectRenderer.setDragMode(SimRobotCore2::Renderer::DragAndDropMode(settings->value("DragMode", int(objectRenderer.getDragMode())).toInt())); objectRenderer.setRenderFlags(settings->value("RenderFlags", objectRenderer.getRenderFlags()).toInt()); float pos[3]; float target[3]; objectRenderer.getCamera(pos, target); pos[0] = settings->value("cameraPosX", pos[0]).toFloat(); pos[1] = settings->value("cameraPosY", pos[1]).toFloat(); pos[2] = settings->value("cameraPosZ", pos[2]).toFloat(); target[0] = settings->value("cameraTargetX", target[0]).toFloat(); target[1] = settings->value("cameraTargetY", target[1]).toFloat(); target[2] = settings->value("cameraTargetZ", target[2]).toFloat(); objectRenderer.setCamera(pos, target); settings->endGroup(); }
Switcher::Switcher(MWidget *parent, SwitcherModel *model) : MWidgetController(model, parent) { // Get the X11 Atoms for closing and activating a window and for other switcher functionalities Display *display = QX11Info::display(); closeWindowAtom = X11Wrapper::XInternAtom(display, "_NET_CLOSE_WINDOW", False); activeWindowAtom = X11Wrapper::XInternAtom(display, "_NET_ACTIVE_WINDOW", False); clientListAtom = X11Wrapper::XInternAtom(display, "_NET_CLIENT_LIST", False); netWindowNameAtom = X11Wrapper::XInternAtom(display, "_NET_WM_NAME", False); windowNameAtom = X11Wrapper::XInternAtom(display, "WM_NAME", False); // Put the atoms for window types that should be excluded from the switcher into a list excludeAtoms.insert(WindowInfo::DesktopAtom); excludeAtoms.insert(WindowInfo::MenuAtom); excludeAtoms.insert(WindowInfo::DockAtom); excludeAtoms.insert(WindowInfo::DialogAtom); excludeAtoms.insert(WindowInfo::NotificationAtom); excludeAtoms.insert(WindowInfo::SkipTaskbarAtom); excludeAtoms.insert(WindowInfo::InputWindowAtom); // Configure the update buttons timer updateButtonsTimer.setSingleShot(true); updateButtonsTimer.setInterval(UPDATE_DELAY_MS); connect(&updateButtonsTimer, SIGNAL(timeout()), this, SLOT(updateButtons())); connect(HomeWindowMonitor::instance(), SIGNAL(windowStackingOrderChanged(QList<WindowInfo>)), this, SLOT(handleWindowInfoList(QList<WindowInfo>))); // This stuff is necessary to receive touch events setAcceptTouchEvents(true); grabGesture(Qt::PinchGesture); }
SlidingStackedWidget::SlidingStackedWidget(QWidget *parent) : QStackedWidget(parent) { if (parent!=0) { m_mainwindow = parent; } else { m_mainwindow = this; qDebug()<<"ATTENTION: untested mainwindow case !"; } //parent should not be 0; not tested for any other case yet !! #ifdef Q_OS_SYMBIAN #ifndef __S60_50__ qDebug()<< "WARNING: ONLY TESTED AND 5TH EDITION"; #endif //__S60_50__ #endif //Q_OS_SYMBIAN //Now, initialize some private variables with default values m_vertical=false; //setVerticalMode(true); m_speed=500; m_animationtype = QEasingCurve::OutBack; //check out the QEasingCurve documentation for different styles m_now=0; m_next=0; m_wrap=false; m_pnow=QPoint(0,0); m_active=false; fingerSwipeGestureType = (Qt::GestureType)0; fingerSwipeGestureType = QGestureRecognizer::registerRecognizer( new FingerSwipeGestureRecognizer() ); grabGesture(fingerSwipeGestureType); }
PageTab::PageTab(const QRectF& pageTabGeometry,const QString& label, PageTabBar * p_belongsTo,Page * p_refersToPage) : ThingPaintable(pageTabGeometry) , m_qp_currentTabBarOwner(p_belongsTo) , m_qp_relatedToPage(p_refersToPage) , m_qp_backgroundShadow(0) , m_currentMode(PageTabDisplayMode::INVALID) , m_savedMode(PageTabDisplayMode::INVALID) , m_interactionsBlocked(false) , m_currentBackgroundPmo(0) , m_showLeftDivider(false) , m_showRightDivider(false) , m_leftDividerPmo(0) , m_rightDividerPmo(0) , m_tabLabel(label) { m_textFont = PageTabBar::staticLabelFontForTabs(); m_selectedColor = LayoutSettings::settings()->tabBarSelectedTabFontColor; m_unselectedColor = LayoutSettings::settings()->tabBarUnSelectedTabFontColor; recalculateLabelBoundsForCurrentGeom(); redoLabelTextLayout(); recalculateLabelPosition(); if (m_qp_currentTabBarOwner) this->setParentItem(m_qp_currentTabBarOwner); grabGesture(Qt::TapGesture); initSignalSlotConnections(); m_backgroundGeom = m_geom; m_backgroundShadowGeom = m_backgroundGeom.adjusted(0.0,0.0, //(left,up,right,down) 0.0,2.0); ThingPaintable::recomputeBoundingRect(m_backgroundShadowGeom); }
VideoDock::VideoDock() : isTouch(false), touchEnded(false), iDW(QMPlay2GUI.grad1, QMPlay2GUI.grad2, QMPlay2GUI.qmpTxt), pixels(0), canPopup(true), is_floating(false), touchZoom(0.0) { setWindowTitle(tr("Video")); popupMenu = new QMenu(this); popupMenu->addMenu(QMPlay2GUI.menuBar->window); popupMenu->addMenu(QMPlay2GUI.menuBar->widgets); popupMenu->addMenu(QMPlay2GUI.menuBar->playlist); popupMenu->addMenu(QMPlay2GUI.menuBar->player); popupMenu->addMenu(QMPlay2GUI.menuBar->playback); popupMenu->addMenu(QMPlay2GUI.menuBar->options); popupMenu->addMenu(QMPlay2GUI.menuBar->help); /* Menu actions which will be available in fullscreen or compact mode */ for (QAction *act : QMPlay2GUI.menuBar->window->actions()) addAction(act); for (QAction *act : QMPlay2GUI.menuBar->playlist->actions()) addAction(act); for (QAction *act : QMPlay2GUI.menuBar->player->actions()) addAction(act); for (QAction *act : QMPlay2GUI.menuBar->playback->actions()) addAction(act); for (QAction *act : QMPlay2GUI.menuBar->options->actions()) addAction(act); for (QAction *act : QMPlay2GUI.menuBar->help->actions()) addAction(act); /**/ setMouseTracking(true); setAcceptDrops(true); grabGesture(Qt::PinchGesture); setContextMenuPolicy(Qt::CustomContextMenu); setWidget(&iDW); hideCursorTim.setSingleShot(true); leftButtonPlayTim.setSingleShot(true); connect(&hideCursorTim, SIGNAL(timeout()), this, SLOT(hideCursor())); connect(&leftButtonPlayTim, SIGNAL(timeout()), QMPlay2GUI.menuBar->player->togglePlay, SLOT(trigger())); connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(popup(const QPoint &))); connect(&iDW, SIGNAL(resized(int, int)), this, SLOT(resizedIDW(int, int))); connect(&iDW, SIGNAL(hasCoverImage(bool)), this, SLOT(hasCoverImage(bool))); connect(this, SIGNAL(visibilityChanged(bool)), this, SLOT(visibilityChanged(bool))); connect(&QMPlay2Core, SIGNAL(dockVideo(QWidget *)), &iDW, SLOT(setWidget(QWidget *))); if ((isBreeze = QApplication::style()->objectName() == "breeze")) setStyle(&commonStyle); canHideIDWCursor = false; doubleClicked = false; }
IrHsWidgetTitleRow::IrHsWidgetTitleRow(QGraphicsItem *aParent, Qt::WindowFlags aFlags) : HbWidget(aParent, aFlags), mStationLogo(NULL), mStationName(NULL) { LOG_METHOD; loadUi(); grabGesture(Qt::TapGesture); }
//! [constructor] ImageWidget::ImageWidget(QWidget *parent) : QWidget(parent), position(0), horizontalOffset(0), verticalOffset(0), rotationAngle(0), scaleFactor(1), currentStepScaleFactor(1) { setMinimumSize(QSize(100,100)); //! [enable gestures] grabGesture(Qt::PanGesture); grabGesture(Qt::PinchGesture); grabGesture(Qt::SwipeGesture); //! [enable gestures] }
ScalableWrapper::ScalableWrapper(QTextEdit* _editor, QWidget* _parent) : QGraphicsView(_parent), m_scene(new QGraphicsScene), m_editor(_editor), m_zoomRange(1), m_gestureZoomInertionBreak(0) { // // Отслеживаем жесты // grabGesture(Qt::PinchGesture); // // Всегда показываем полосы прокрутки // setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn); // // Предварительная настройка редактора текста // // FIXME: непонятно как быть с предком, у встраиваемого виджета не должно быть родителя, // но как в таком случае освобождать память? // m_editor->setParent(0); m_editor->setContextMenuPolicy(Qt::PreventContextMenu); m_editor->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); m_editor->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn); m_editor->installEventFilter(this); // // Настраиваем само представление // m_rect = m_scene->addRect(0, 0, 1, 1, QPen(), Qt::red); m_editorProxy = m_scene->addWidget(m_editor); setScene(m_scene); // // Отключаем действия полос прокрутки, чтобы в дальнейшем проксировать ими // полосы прокрутки самого редактора текста // horizontalScrollBar()->disconnect(); verticalScrollBar()->disconnect(); // // Синхронизация значения ролика в обе стороны // setupScrollingSynchronization(true); // // Добавляем возможность масштабирования при помощи комбинаций Ctrl +/- // QShortcut* zoomInShortcut = new QShortcut(QKeySequence("Ctrl++"), this); connect(zoomInShortcut, SIGNAL(activated()), this, SLOT(zoomIn())); QShortcut* zoomOutShortcut = new QShortcut(QKeySequence("Ctrl+-"), this); connect(zoomOutShortcut, SIGNAL(activated()), this, SLOT(zoomOut())); }
MenuWindowManager::MenuWindowManager(int maxWidth, int maxHeight) : WindowManagerBase(maxWidth, maxHeight) , m_statusBar(0) , m_penDownState(PenDownInvalid) , m_cornerContainer(0) , m_sysMenu(0) , m_systemMenuOpened(false) { setObjectName("MenuWindowManager"); connect(SystemUiController::instance(), SIGNAL(signalPositiveSpaceChanged(const QRect&)), this, SLOT(slotPositiveSpaceChanged(const QRect&))); connect(SystemUiController::instance(), SIGNAL(signalHideMenu()), this, SLOT(closeMenu())); connect(SystemUiController::instance(), SIGNAL(signalCardWindowMaximized()), this, SLOT(closeMenu())); kStatusBarTapMoveTolerance = HostBase::instance()->getInfo().displayHeight; #if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0)) grabGesture(Qt::TapGesture); grabGesture(Qt::TapAndHoldGesture); grabGesture(Qt::PinchGesture); grabGesture((Qt::GestureType) SysMgrGestureFlick); grabGesture((Qt::GestureType) SysMgrGestureSingleClick); #else grabGesture(Qt::TapGesture); grabGesture(WebosTapAndHoldGesture::gestureType()); grabGesture(Qt::PinchGesture); grabGesture(FlickGesture::gestureType()); grabGesture(SingleClickGesture::gestureType()); #endif m_statusBar = new StatusBar(StatusBar::TypeNormal, maxWidth, Settings::LunaSettings()->positiveSpaceTopPadding); if(m_statusBar) { SystemUiController::instance()->setStatusBar(m_statusBar); connect(m_statusBar, SIGNAL(signalSystemMenuStateChanged(bool)), this, SLOT(slotSystemMenuStateChanged(bool))); } m_sysMenu = new SystemMenu(320, 480, false); if(m_sysMenu) { m_sysMenu->setParentItem(this); connect(m_sysMenu, SIGNAL(signalCloseMenu()), this, SLOT(slotCloseSystemMenu())); } }
PixButton::PixButton(const QRectF& buttonGeometry) : ThingPaintable(buttonGeometry) , m_trackingTouch(false) , m_touchCount(0) , m_labelVerticalAdjust(0) { setAcceptTouchEvents(true); grabGesture(Qt::TapGesture); }
smart_plot::smart_plot(QWidget *parent) : QMainWindow(parent) { myUrlHandler *myHandler = new myUrlHandler(); QDesktopServices::setUrlHandler("file", myHandler, "files"); connect(myHandler, SIGNAL(openFile(const QString&)), this, SLOT( iosOpen(const QString &))); setWindowTitle(tr("Smartplot Ver 2.02.001")); QCoreApplication::setOrganizationName("bgodding"); QCoreApplication::setApplicationName("smartplot"); this->setMinimumSize(320,240); this->resize(1024, 600); this->installEventFilter(this); plots.append(new QCustomPlot(this)); //Setup the main menu QMenu *fileMenu = menuBar()->addMenu(tr("&File")); //Data Handlers: Add menu calls here csvHandler.addToSystemMenu(fileMenu, activePlot()); gitClocHandler.addToSystemMenu(fileMenu, activePlot()); //influxdbHandler.addToSystemMenu(fileMenu, activePlot()); fileMenu->addSeparator(); fileMenu->addAction( QIcon(":/graphics/savePlot.png"), tr("&SaveImage"), this, SLOT(savePlotAsImage()) ); activePlot()->setOpenGl(true,16); setCentralWidget(activePlot()); initGraph(activePlot()); initLegend(activePlot()); #ifdef MOBILE setAttribute( Qt::WA_AcceptTouchEvents ); grabGesture( Qt::TapAndHoldGesture ); // //TODO: Only use these on mobile in lou of pinch to zoom on crappy hardware? QPushButton *zoomIn = new QPushButton("+", this); zoomIn->setObjectName("+"); connect(zoomIn, SIGNAL(released()), this, SLOT(zoomInButtonPressed())); QPushButton *zoomOut = new QPushButton("-", this); zoomOut->setObjectName("-"); connect(zoomOut, SIGNAL(released()), this, SLOT(zoomOutButtonPressed())); #endif contextMenu = new QMenu(this); this->installEventFilter(this); }
SQEngine::SQEngine(QWidget *parent) : QGLWidget(parent), _shaderProgram(), _renderTimer(), _puzzleEngine(NULL), _height(-1), _width(-1) { SQPanGestureRecognizer::registerMe(); grabGesture(SQPanGestureRecognizer::recognizerId()); }
MozQWidget::MozQWidget(nsWindow* aReceiver, QGraphicsItem* aParent) : QGraphicsWidget(aParent), mReceiver(aReceiver) { #if (QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)) setFlag(QGraphicsItem::ItemAcceptsInputMethod); setAcceptTouchEvents(true); grabGesture(Qt::PinchGesture); #endif }
PageTabBar::PageTabBar(const QRectF& pageTabBarGeometry,LauncherObject * p_belongsTo) : ThingPaintable(pageTabBarGeometry) , m_maxTabWidth(150) , m_interactionsBlocked(false) , m_qp_currentUIOwner(p_belongsTo) , m_qp_backgroundPmo(0) , m_qp_backgroundShadowPmo(0) { resetTabSpaces(); if (m_qp_currentUIOwner) this->setParentItem(m_qp_currentUIOwner); #if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0)) grabGesture((Qt::GestureType) SysMgrGestureFlick); #else grabGesture(FlickGesture::gestureType()); #endif m_backgroundGeom = m_geom; m_backgroundShadowGeom = m_geom; }
TimelineGL::TimelineGL(QWidget *parent) : GlWidget(QGLFormat(QGL::DoubleBuffer | QGL::DirectRendering | QGL::SampleBuffers), parent) { Global::timelineGL = this; startTimer(20); setMouseTracking(true); setAcceptDrops(true); grabGesture(Qt::PinchGesture); gestureZoomInitial = Global::timeUnitDest; showLegend = 0; showLegendDest = true; connect(&mouseTimer, SIGNAL(timeout()), SLOT(mouseMoveLong())); }
/*! \reimp */ void CSizeGrip::mouseReleaseEvent(QMouseEvent *mouseEvent) { grabGesture(Qt::TapAndHoldGesture); if (mouseEvent->button() == Qt::LeftButton) { gotMousePress = false; p = QPoint(); } else { QWidget::mouseReleaseEvent(mouseEvent); } }
MyScrollArea::MyScrollArea(QWidget *parent) :QScrollArea(parent) { mw = (MainWindow *) parent; #if QT_VERSION >= 0x040600 //grabGesture(Qt::TapGesture, Qt::DontStartGestureOnChildren); //grabGesture(Qt::TapAndHoldGesture, Qt::DontStartGestureOnChildren); //grabGesture(Qt::PanGesture); grabGesture(Qt::PinchGesture); //grabGesture(Qt::SwipeGesture); #endif }
ImageWidget::ImageWidget(ImageView& imageView) : imageView(imageView), dragStart(-1, -1), offset(0, 0) { setFocusPolicy(Qt::StrongFocus); setMouseTracking(true); grabGesture(Qt::PinchGesture); setAttribute(Qt::WA_AcceptTouchEvents); QSettings& settings = RoboCupCtrl::application->getLayoutSettings(); settings.beginGroup(imageView.fullName); zoom = (float)settings.value("Zoom", 1.).toDouble(); offset = settings.value("Offset", QPointF()).toPoint(); settings.endGroup(); }
InDockW::InDockW(const QPixmap &qmp2Pixmap, const QColor &grad1, const QColor &grad2, const QColor &qmpTxt) : grad1(grad1), grad2(grad2), qmpTxt(qmpTxt), qmp2Pixmap(qmp2Pixmap), hasWallpaper(false), loseHeight(0), w(NULL) { connect(&QMPlay2Core, SIGNAL(wallpaperChanged(bool, double)), this, SLOT(wallpaperChanged(bool, double))); setAttribute(Qt::WA_OpaquePaintEvent); setFocusPolicy(Qt::StrongFocus); grabGesture(Qt::PinchGesture); setAutoFillBackground(true); setMouseTracking(true); }
void StelAppGraphicsWidget::init(QSettings* conf) { stelApp->init(conf); Q_ASSERT(viewportEffect==NULL); setViewportEffect(conf->value("video/viewport_effect", "none").toString()); //previousPaintTime needs to be updated after the time zone is set //in StelLocaleMgr::init(), otherwise this causes an invalid value of //deltaT the first time it is calculated in paintPartial(), which in //turn causes Stellarium to start with a wrong time. previousPaintTime = StelApp::getTotalRunTime(); setAcceptTouchEvents(true); grabGesture(Qt::PinchGesture); }