// The ctor. QsciScintillaBase::QsciScintillaBase(QWidget *parent) : QAbstractScrollArea(parent), preeditPos(-1), preeditNrBytes(0) #if QT_VERSION >= 0x050000 , clickCausedFocus(false) #endif { connect(verticalScrollBar(), SIGNAL(valueChanged(int)), SLOT(handleVSb(int))); connect(horizontalScrollBar(), SIGNAL(valueChanged(int)), SLOT(handleHSb(int))); setAcceptDrops(true); setFocusPolicy(Qt::WheelFocus); setAttribute(Qt::WA_KeyCompression); setAttribute(Qt::WA_InputMethodEnabled); #if QT_VERSION >= 0x050100 setInputMethodHints( Qt::ImhNoAutoUppercase|Qt::ImhNoPredictiveText|Qt::ImhMultiLine); #elif QT_VERSION >= 0x040600 setInputMethodHints(Qt::ImhNoAutoUppercase|Qt::ImhNoPredictiveText); #endif viewport()->setBackgroundRole(QPalette::Base); viewport()->setMouseTracking(true); //viewport()->setAttribute(Qt::WA_NoSystemBackground); //viewport()->setAutoFillBackground(false); //viewport()->setAttribute(Qt::WA_OpaquePaintEvent); // QPainter p( viewport() ); // p.setCompositionMode( QPainter::CompositionMode_Clear ); // p.fillRect( viewport()->rect(), Qt::transparent ); triple_click.setSingleShot(true); #if (QT_VERSION >= 0x040200 && QT_VERSION < 0x050000 && defined(Q_OS_MAC)) || (QT_VERSION >= 0x050200 && defined(Q_OS_OSX)) initialiseRectangularPasteboardMime(); #endif sci = new QsciScintillaQt(this); SendScintilla(SCI_SETCARETPERIOD, QApplication::cursorFlashTime() / 2); // Make sure the lexers are linked in. if (!lexersLinked) { Scintilla_LinkLexers(); lexersLinked = true; } QClipboard *cb = QApplication::clipboard(); if (cb->supportsSelection()) connect(cb, SIGNAL(selectionChanged()), SLOT(handleSelection())); // Add it to the pool. poolList.append(this); }
QKeyEdit::QKeyEdit(QWidget *parent) : QLineEdit(parent) { m_wKeyValue = 0x00; setAlignment( Qt::AlignVCenter ); setInputMethodHints(Qt::ImhLatinOnly); setToNone(); }
ULongLongSpinBox::ULongLongSpinBox(QWidget * parent) : QAbstractSpinBox(parent) , m_min(std::numeric_limits<qulonglong>::lowest()) , m_max(std::numeric_limits<qulonglong>::max()) , m_step(1) , m_value(m_min) { setInputMethodHints(Qt::ImhDigitsOnly); connect(this, &QAbstractSpinBox::editingFinished, this, &ULongLongSpinBox::onEditingFinished); }
void QDeclarativeTextInput::setEchoMode(QDeclarativeTextInput::EchoMode echo) { Q_D(QDeclarativeTextInput); if (echoMode() == echo) return; Qt::InputMethodHints imHints = inputMethodHints(); if (echo == Password || echo == NoEcho) imHints |= Qt::ImhHiddenText; else imHints &= ~Qt::ImhHiddenText; if (echo != Normal) imHints |= (Qt::ImhNoAutoUppercase | Qt::ImhNoPredictiveText); else imHints &= ~(Qt::ImhNoAutoUppercase | Qt::ImhNoPredictiveText); setInputMethodHints(imHints); d->control->setEchoMode((uint)echo); update(); emit echoModeChanged(echoMode()); }
int QWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QObject::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 23) qt_static_metacall(this, _c, _id, _a); _id -= 23; } #ifndef QT_NO_PROPERTIES else if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< bool*>(_v) = isModal(); break; case 1: *reinterpret_cast< Qt::WindowModality*>(_v) = windowModality(); break; case 2: *reinterpret_cast< bool*>(_v) = isEnabled(); break; case 3: *reinterpret_cast< QRect*>(_v) = geometry(); break; case 4: *reinterpret_cast< QRect*>(_v) = frameGeometry(); break; case 5: *reinterpret_cast< QRect*>(_v) = normalGeometry(); break; case 6: *reinterpret_cast< int*>(_v) = x(); break; case 7: *reinterpret_cast< int*>(_v) = y(); break; case 8: *reinterpret_cast< QPoint*>(_v) = pos(); break; case 9: *reinterpret_cast< QSize*>(_v) = frameSize(); break; case 10: *reinterpret_cast< QSize*>(_v) = size(); break; case 11: *reinterpret_cast< int*>(_v) = width(); break; case 12: *reinterpret_cast< int*>(_v) = height(); break; case 13: *reinterpret_cast< QRect*>(_v) = rect(); break; case 14: *reinterpret_cast< QRect*>(_v) = childrenRect(); break; case 15: *reinterpret_cast< QRegion*>(_v) = childrenRegion(); break; case 16: *reinterpret_cast< QSizePolicy*>(_v) = sizePolicy(); break; case 17: *reinterpret_cast< QSize*>(_v) = minimumSize(); break; case 18: *reinterpret_cast< QSize*>(_v) = maximumSize(); break; case 19: *reinterpret_cast< int*>(_v) = minimumWidth(); break; case 20: *reinterpret_cast< int*>(_v) = minimumHeight(); break; case 21: *reinterpret_cast< int*>(_v) = maximumWidth(); break; case 22: *reinterpret_cast< int*>(_v) = maximumHeight(); break; case 23: *reinterpret_cast< QSize*>(_v) = sizeIncrement(); break; case 24: *reinterpret_cast< QSize*>(_v) = baseSize(); break; case 25: *reinterpret_cast< QPalette*>(_v) = palette(); break; case 26: *reinterpret_cast< QFont*>(_v) = font(); break; case 27: *reinterpret_cast< QCursor*>(_v) = cursor(); break; case 28: *reinterpret_cast< bool*>(_v) = hasMouseTracking(); break; case 29: *reinterpret_cast< bool*>(_v) = isActiveWindow(); break; case 30: *reinterpret_cast< Qt::FocusPolicy*>(_v) = focusPolicy(); break; case 31: *reinterpret_cast< bool*>(_v) = hasFocus(); break; case 32: *reinterpret_cast< Qt::ContextMenuPolicy*>(_v) = contextMenuPolicy(); break; case 33: *reinterpret_cast< bool*>(_v) = updatesEnabled(); break; case 34: *reinterpret_cast< bool*>(_v) = isVisible(); break; case 35: *reinterpret_cast< bool*>(_v) = isMinimized(); break; case 36: *reinterpret_cast< bool*>(_v) = isMaximized(); break; case 37: *reinterpret_cast< bool*>(_v) = isFullScreen(); break; case 38: *reinterpret_cast< QSize*>(_v) = sizeHint(); break; case 39: *reinterpret_cast< QSize*>(_v) = minimumSizeHint(); break; case 40: *reinterpret_cast< bool*>(_v) = acceptDrops(); break; case 41: *reinterpret_cast< QString*>(_v) = windowTitle(); break; case 42: *reinterpret_cast< QIcon*>(_v) = windowIcon(); break; case 43: *reinterpret_cast< QString*>(_v) = windowIconText(); break; case 44: *reinterpret_cast< double*>(_v) = windowOpacity(); break; case 45: *reinterpret_cast< bool*>(_v) = isWindowModified(); break; case 46: *reinterpret_cast< QString*>(_v) = toolTip(); break; case 47: *reinterpret_cast< QString*>(_v) = statusTip(); break; case 48: *reinterpret_cast< QString*>(_v) = whatsThis(); break; case 49: *reinterpret_cast< QString*>(_v) = accessibleName(); break; case 50: *reinterpret_cast< QString*>(_v) = accessibleDescription(); break; case 51: *reinterpret_cast< Qt::LayoutDirection*>(_v) = layoutDirection(); break; case 52: *reinterpret_cast< bool*>(_v) = autoFillBackground(); break; case 53: *reinterpret_cast< QString*>(_v) = styleSheet(); break; case 54: *reinterpret_cast< QLocale*>(_v) = locale(); break; case 55: *reinterpret_cast< QString*>(_v) = windowFilePath(); break; case 56: *reinterpret_cast< Qt::InputMethodHints*>(_v) = inputMethodHints(); break; } _id -= 57; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 1: setWindowModality(*reinterpret_cast< Qt::WindowModality*>(_v)); break; case 2: setEnabled(*reinterpret_cast< bool*>(_v)); break; case 3: setGeometry(*reinterpret_cast< QRect*>(_v)); break; case 8: move(*reinterpret_cast< QPoint*>(_v)); break; case 10: resize(*reinterpret_cast< QSize*>(_v)); break; case 16: setSizePolicy(*reinterpret_cast< QSizePolicy*>(_v)); break; case 17: setMinimumSize(*reinterpret_cast< QSize*>(_v)); break; case 18: setMaximumSize(*reinterpret_cast< QSize*>(_v)); break; case 19: setMinimumWidth(*reinterpret_cast< int*>(_v)); break; case 20: setMinimumHeight(*reinterpret_cast< int*>(_v)); break; case 21: setMaximumWidth(*reinterpret_cast< int*>(_v)); break; case 22: setMaximumHeight(*reinterpret_cast< int*>(_v)); break; case 23: setSizeIncrement(*reinterpret_cast< QSize*>(_v)); break; case 24: setBaseSize(*reinterpret_cast< QSize*>(_v)); break; case 25: setPalette(*reinterpret_cast< QPalette*>(_v)); break; case 26: setFont(*reinterpret_cast< QFont*>(_v)); break; case 27: setCursor(*reinterpret_cast< QCursor*>(_v)); break; case 28: setMouseTracking(*reinterpret_cast< bool*>(_v)); break; case 30: setFocusPolicy(*reinterpret_cast< Qt::FocusPolicy*>(_v)); break; case 32: setContextMenuPolicy(*reinterpret_cast< Qt::ContextMenuPolicy*>(_v)); break; case 33: setUpdatesEnabled(*reinterpret_cast< bool*>(_v)); break; case 34: setVisible(*reinterpret_cast< bool*>(_v)); break; case 40: setAcceptDrops(*reinterpret_cast< bool*>(_v)); break; case 41: setWindowTitle(*reinterpret_cast< QString*>(_v)); break; case 42: setWindowIcon(*reinterpret_cast< QIcon*>(_v)); break; case 43: setWindowIconText(*reinterpret_cast< QString*>(_v)); break; case 44: setWindowOpacity(*reinterpret_cast< double*>(_v)); break; case 45: setWindowModified(*reinterpret_cast< bool*>(_v)); break; case 46: setToolTip(*reinterpret_cast< QString*>(_v)); break; case 47: setStatusTip(*reinterpret_cast< QString*>(_v)); break; case 48: setWhatsThis(*reinterpret_cast< QString*>(_v)); break; case 49: setAccessibleName(*reinterpret_cast< QString*>(_v)); break; case 50: setAccessibleDescription(*reinterpret_cast< QString*>(_v)); break; case 51: setLayoutDirection(*reinterpret_cast< Qt::LayoutDirection*>(_v)); break; case 52: setAutoFillBackground(*reinterpret_cast< bool*>(_v)); break; case 53: setStyleSheet(*reinterpret_cast< QString*>(_v)); break; case 54: setLocale(*reinterpret_cast< QLocale*>(_v)); break; case 55: setWindowFilePath(*reinterpret_cast< QString*>(_v)); break; case 56: setInputMethodHints(*reinterpret_cast< Qt::InputMethodHints*>(_v)); break; } _id -= 57; } else if (_c == QMetaObject::ResetProperty) { switch (_id) { case 27: unsetCursor(); break; case 51: unsetLayoutDirection(); break; case 54: unsetLocale(); break; } _id -= 57; } else if (_c == QMetaObject::QueryPropertyDesignable) { bool *_b = reinterpret_cast<bool*>(_a[0]); switch (_id) { case 41: *_b = isWindow(); break; case 42: *_b = isWindow(); break; case 43: *_b = isWindow(); break; case 44: *_b = isWindow(); break; case 45: *_b = isWindow(); break; case 55: *_b = isWindow(); break; } _id -= 57; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 57; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 57; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 57; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 57; } #endif // QT_NO_PROPERTIES return _id; }
CCEGLView::CCEGLView(QWidget* parent): QWidget(parent), m_bCaptured(false), m_bOrientationReverted(false), m_bOrientationInitVertical(false), m_pDelegate(NULL), bIsInit(false), m_eInitOrientation(CCDeviceOrientationPortrait), m_eOrientation(CCDeviceOrientationPortrait), m_fScreenScaleFactor(1.0f), m_eglDisplay(NULL), m_eglConfig(NULL), m_eglSurface(NULL), m_eglContext(NULL) { m_sSizeInPoint.width = m_sSizeInPoint.height = 0; setAutoFillBackground(false); setAttribute(Qt::WA_OpaquePaintEvent); setAttribute(Qt::WA_NoSystemBackground); setAttribute(Qt::WA_NativeWindow); setAttribute(Qt::WA_PaintOnScreen, true); setAttribute(Qt::WA_StyledBackground, false); setAttribute(Qt::WA_PaintUnclipped); setAttribute(Qt::WA_InputMethodEnabled, true); setAttribute(Qt::WA_KeyboardFocusChange, true); setInputMethodHints(Qt::ImhNoPredictiveText); qApp->installEventFilter(this); #ifdef MS_USE_TOUCH_EVENTS setAttribute(Qt::WA_AcceptTouchEvents); for(int i = 0; i < MAX_TOUCH_POINTS; i++) m_pTouch[i] = NULL; #else m_pTouch = NULL; #endif #ifdef MEEGO_EDITION_HARMATTAN QMeeGoGraphicsSystemHelper::setSwitchPolicy(QMeeGoGraphicsSystemHelper::NoSwitch); QInputContext *ic = QInputContextFactory::create("MInputContext", 0); if (ic) { qApp->setInputContext(ic); } #endif // MEEGO_EDITION_HARMATTAN #if defined(Q_OS_SYMBIAN) CAknAppUiBase::TAppUiOrientation uiOrientation; switch(m_eInitOrientation) { case kCCDeviceOrientationPortrait: case kCCDeviceOrientationPortraitUpsideDown: uiOrientation = CAknAppUi::EAppUiOrientationPortrait; m_eOrientation = kCCDeviceOrientationPortrait; break; case kCCDeviceOrientationLandscapeLeft: case kCCDeviceOrientationLandscapeRight: uiOrientation = CAknAppUi::EAppUiOrientationLandscape; m_eOrientation = kCCDeviceOrientationLandscapeLeft; break; default: uiOrientation = CAknAppUi::EAppUiOrientationPortrait; m_eOrientation = kCCDeviceOrientationPortrait; } CAknAppUi *ui = dynamic_cast<CAknAppUi *>(CEikonEnv::Static()->AppUi()); TRAPD(error, if(ui) { ui->SetOrientationL(uiOrientation); } );
int QDeclarativeTextEdit::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QDeclarativeImplicitSizePaintedItem::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 47) qt_static_metacall(this, _c, _id, _a); _id -= 47; } #ifndef QT_NO_PROPERTIES else if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< QString*>(_v) = text(); break; case 1: *reinterpret_cast< QColor*>(_v) = color(); break; case 2: *reinterpret_cast< QColor*>(_v) = selectionColor(); break; case 3: *reinterpret_cast< QColor*>(_v) = selectedTextColor(); break; case 4: *reinterpret_cast< QFont*>(_v) = font(); break; case 5: *reinterpret_cast< HAlignment*>(_v) = hAlign(); break; case 6: *reinterpret_cast< VAlignment*>(_v) = vAlign(); break; case 7: *reinterpret_cast< WrapMode*>(_v) = wrapMode(); break; case 8: *reinterpret_cast< int*>(_v) = lineCount(); break; case 9: *reinterpret_cast< qreal*>(_v) = paintedWidth(); break; case 10: *reinterpret_cast< qreal*>(_v) = paintedHeight(); break; case 11: *reinterpret_cast< TextFormat*>(_v) = textFormat(); break; case 12: *reinterpret_cast< bool*>(_v) = isReadOnly(); break; case 13: *reinterpret_cast< bool*>(_v) = isCursorVisible(); break; case 14: *reinterpret_cast< int*>(_v) = cursorPosition(); break; case 15: *reinterpret_cast< QRect*>(_v) = cursorRectangle(); break; case 16: *reinterpret_cast< QDeclarativeComponent**>(_v) = cursorDelegate(); break; case 17: *reinterpret_cast< int*>(_v) = selectionStart(); break; case 18: *reinterpret_cast< int*>(_v) = selectionEnd(); break; case 19: *reinterpret_cast< QString*>(_v) = selectedText(); break; case 20: *reinterpret_cast< bool*>(_v) = focusOnPress(); break; case 21: *reinterpret_cast< bool*>(_v) = persistentSelection(); break; case 22: *reinterpret_cast< qreal*>(_v) = textMargin(); break; case 23: *reinterpret_cast< Qt::InputMethodHints*>(_v) = inputMethodHints(); break; case 24: *reinterpret_cast< bool*>(_v) = selectByMouse(); break; case 25: *reinterpret_cast< SelectionMode*>(_v) = mouseSelectionMode(); break; case 26: *reinterpret_cast< bool*>(_v) = canPaste(); break; case 27: *reinterpret_cast< bool*>(_v) = isInputMethodComposing(); break; } _id -= 28; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 0: setText(*reinterpret_cast< QString*>(_v)); break; case 1: setColor(*reinterpret_cast< QColor*>(_v)); break; case 2: setSelectionColor(*reinterpret_cast< QColor*>(_v)); break; case 3: setSelectedTextColor(*reinterpret_cast< QColor*>(_v)); break; case 4: setFont(*reinterpret_cast< QFont*>(_v)); break; case 5: setHAlign(*reinterpret_cast< HAlignment*>(_v)); break; case 6: setVAlign(*reinterpret_cast< VAlignment*>(_v)); break; case 7: setWrapMode(*reinterpret_cast< WrapMode*>(_v)); break; case 11: setTextFormat(*reinterpret_cast< TextFormat*>(_v)); break; case 12: setReadOnly(*reinterpret_cast< bool*>(_v)); break; case 13: setCursorVisible(*reinterpret_cast< bool*>(_v)); break; case 14: setCursorPosition(*reinterpret_cast< int*>(_v)); break; case 16: setCursorDelegate(*reinterpret_cast< QDeclarativeComponent**>(_v)); break; case 20: setFocusOnPress(*reinterpret_cast< bool*>(_v)); break; case 21: setPersistentSelection(*reinterpret_cast< bool*>(_v)); break; case 22: setTextMargin(*reinterpret_cast< qreal*>(_v)); break; case 23: setInputMethodHints(*reinterpret_cast< Qt::InputMethodHints*>(_v)); break; case 24: setSelectByMouse(*reinterpret_cast< bool*>(_v)); break; case 25: setMouseSelectionMode(*reinterpret_cast< SelectionMode*>(_v)); break; } _id -= 28; } else if (_c == QMetaObject::ResetProperty) { switch (_id) { case 5: resetHAlign(); break; } _id -= 28; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 28; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 28; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 28; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 28; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 28; } #endif // QT_NO_PROPERTIES return _id; }