PopupWindow* PopupWindowsStack::newWindow()
{
	qDebug() << Q_FUNC_INFO << "{";
	PopupWindow* p = new PopupWindow(newCoords());
	connect(p, SIGNAL(closePopupWindow()), this, SLOT(windowClosed()));
	connect(p, SIGNAL(mouseEntered()), this, SIGNAL(mouseEntered()));
	connect(p, SIGNAL(mouseLeaved()), this, SIGNAL(mouseLeaved()));
	existingWindows.append(p);
	shownWindows.append(p);	
	qDebug() << Q_FUNC_INFO << "}";
	return p;
}
Exemple #2
0
// 返回TRUE表示已经处理。
BOOL HCtrl::OnMouseMove( UINT nFlags, const CPoint &point )
{
	int n = m_arChildren.GetCount();
	for( int i = 0; i < n; i++)		// 先查子控件
	{
		if( m_arChildren[i]->OnMouseMove( nFlags, point ) )
			return TRUE;	// 如果子控件处理,不再处理
	}

	if( !m_bEnabled || m_nID == -1 || !m_rcWnd.PtInRect( point ) )	// 如果禁止 或 m_nID==-1 或 鼠标不在控件中
		return FALSE;

	//#pragma message("********测试第一次启动有没有move事件") 有
	if( m_pctrMouseEnter != this )
	{
		if( m_pctrMouseEnter )
			m_pctrMouseEnter->mouseLeave();

		m_pctrMouseEnter = this;
		mouseEntered( nFlags, point );
	}

	mouseMove( nFlags, point );
	return TRUE;
}
Exemple #3
0
TextEditor::TextEditor(TextContent *textContent, QWidget *parent)
        : NoteEditor(textContent), m_textContent(textContent)
{
    FocusedTextEdit *textEdit = new FocusedTextEdit(/*disableUpdatesOnKeyPress=*/true,parent);
    textEdit->setLineWidth(0);
    textEdit->setMidLineWidth(0);
    textEdit->setFrameStyle(QFrame::Box);
    QPalette palette;
    palette.setColor(textEdit->backgroundRole(), note()->backgroundColor());
    palette.setColor(textEdit->foregroundRole(), note()->textColor());
    textEdit->setPalette(palette);

    textEdit->setFont(note()->font());
    textEdit->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);

    if (Settings::spellCheckTextNotes())
        textEdit->setCheckSpellingEnabled(true);
    textEdit->setPlainText(m_textContent->text());

    // Not sure if the following comment is still true
    // FIXME: Sometimes, the cursor flicker at ends before being positionned where clicked (because kapp->processEvents() I think)
    textEdit->moveCursor(QTextCursor::End);
    textEdit->verticalScrollBar()->setCursor(Qt::ArrowCursor);
    setInlineEditor(textEdit);
    connect(textEdit, SIGNAL(escapePressed()), this, SIGNAL(askValidation()));
    connect(textEdit, SIGNAL(mouseEntered()),  this, SIGNAL(mouseEnteredEditorWidget()));

    connect(textEdit, SIGNAL(cursorPositionChanged()), textContent->note()->basket(), SLOT(editorCursorPositionChanged()));
    // In case it is a very big note, the top is displayed and Enter is pressed: the cursor is on bottom, we should enure it visible:
    QTimer::singleShot(0, textContent->note()->basket(), SLOT(editorCursorPositionChanged()));
}
void SceneViewWidget::enterEvent(QEvent* e)
{
	if (isActiveWindow())
	{
		setFocus();
	}
	emit mouseEntered();
}
void NavigationWidget::enterEvent(QEvent *e)
{
    QWidget::enterEvent(e);

    QPropertyAnimation * ani = new QPropertyAnimation(this, "zoomLevel");
    ani->setDuration(300);
    ani->setStartValue(zoomLevel());
    ani->setEndValue(1.2);
    ani->start(QPropertyAnimation::DeleteWhenStopped);

    emit mouseEntered();
}
bool TransparentButton::event(QEvent *e)
{
    if (e->type()==QEvent::Enter)
    {
        emit mouseEntered();
    }

    if (e->type()==QEvent::Leave)
    {
        emit mouseLeave();
    }
    return QWidget::event(e);
}
TransparentButton::TransparentButton(QIcon icon,QWidget *parent,int size) :
    QWidget(parent)
{
    icon_=icon.pixmap(size,size).toImage();
    this->setMinimumSize(size,size);
    this->setOpacity(0.0);

    showStartState = new QState;
    showFinishState = new QState;

    enterState = new QState;

    closeStartState = new QState;
    closeFinishState = new QState;
    finalState = new QFinalState;

    QPropertyAnimation *opacityAmination = new QPropertyAnimation (this, "opacity_");
    opacityAmination->setDuration (200);

    showStartState->assignProperty (this, "opacity_", 0.0);
    showFinishState->assignProperty (this, "opacity_", 0.6);
    closeStartState->assignProperty (this, "opacity_", 0.6);
    closeFinishState->assignProperty (this, "opacity_", 0.0);
    enterState->assignProperty(this, "opacity_", 1.0);

    showStartState->addTransition (showFinishState);

    showFinishState->addTransition (this,
    SIGNAL (initiateHide ()), closeStartState);

    showFinishState->addTransition (this,
    SIGNAL (mouseEntered()), enterState);

    enterState->addTransition(this,SIGNAL(mouseLeave()),showFinishState);

    closeStartState->addTransition (closeFinishState);
    //closeFinishState->addTransition(finalState);
    closeFinishState->addTransition (closeFinishState,
    SIGNAL (propertiesAssigned ()), finalState);

    Machine_.addState (showStartState);
    Machine_.addState (showFinishState);
    Machine_.addState (enterState);
    Machine_.addState (closeStartState);
    Machine_.addState (closeFinishState);
    Machine_.addState (finalState);

    Machine_.addDefaultAnimation (opacityAmination);
    Machine_.setInitialState (showStartState);
}
 void Label::mouseMoveEvent(QMouseEvent* event) {
     if (m_mousePosition) {
         Point2i oldMousePosition = *m_mousePosition;
         *m_mousePosition = Point2i(event->pos().x(), event->pos().y());
         Vector2i displacement = *m_mousePosition - oldMousePosition;
         if (sqrLength(displacement) > 0) {
             emit mouseMoved(*m_mousePosition, displacement);
         }
     } else {
         m_mousePosition = new Point2i(event->pos().x(), event->pos().y());
         emit mouseEntered(*m_mousePosition);
     }
     event->accept();
 }
    std::queue<Event> SFMLInputBackend::fetchEvents()
    {
        sf::Event event;
        std::queue<Event> result;

        while (mWindow.pollEvent(event))
        {
            if(event.type == sf::Event::Closed)
                result.push(closed());
            else if(event.type == sf::Event::Resized)
                result.push(resized(event));
            else if(event.type == sf::Event::LostFocus)
                result.push(lostFocus());
            else if(event.type == sf::Event::GainedFocus)
                result.push(gainedFocus());
            else if(event.type == sf::Event::TextEntered)
                result.push(textEntered(event));
            else if(event.type == sf::Event::KeyPressed)
                result.push(keyPressed(event));
            else if(event.type == sf::Event::KeyReleased)
                result.push(keyReleased(event));
            else if(event.type == sf::Event::MouseWheelMoved)
                result.push(mouseWheelMoved(event));
            else if(event.type == sf::Event::MouseButtonPressed)
                result.push(mouseButtonPressed(event));
            else if(event.type == sf::Event::MouseButtonReleased)
                result.push(mouseButtonReleased(event));
            else if(event.type == sf::Event::MouseMoved)
                result.push(mouseMoved(event));
            else if(event.type == sf::Event::MouseEntered)
                result.push(mouseEntered());
            else if(event.type == sf::Event::MouseLeft)
                result.push(mouseLeft());
            else if(event.type == sf::Event::JoystickButtonPressed)
                result.push(gamepadButtonPressed(event));
            else if(event.type == sf::Event::JoystickButtonReleased)
                result.push(gamepadButtonReleased(event));
            else if(event.type == sf::Event::JoystickMoved)
                result.push(gamepadMoved(event));
            else if(event.type == sf::Event::JoystickConnected)
                result.push(gamepadConnected(event));
            else if(event.type == sf::Event::JoystickDisconnected)
                result.push(gamepadDisconnected(event));
        }

        return result;
    }
Exemple #10
0
void AbstractMargin::mouseMoveEvent( QMouseEvent* event )
{
    QWidget::mouseMoveEvent( event );
    
    const int line = d->lineAt( event->pos() );
    
    if ( line == d->line ) {
        return;
    }
    
    if ( d->line != -1 ) {
        emit mouseLeft( d->line );
    }
    
    d->line = line;
    
    if ( d->line != -1 ) {
        emit mouseEntered( d->line );
    }
}
Exemple #11
0
FileEditor::FileEditor(FileContent *fileContent, QWidget *parent)
        : NoteEditor(fileContent), m_fileContent(fileContent)
{
    KLineEdit *lineEdit = new KLineEdit(parent);
    FocusWidgetFilter *filter = new FocusWidgetFilter(lineEdit);

    QPalette palette;
    palette.setColor(lineEdit->backgroundRole(), note()->backgroundColor());
    palette.setColor(lineEdit->foregroundRole(), note()->textColor());
    lineEdit->setPalette(palette);

    lineEdit->setFont(note()->font());
    lineEdit->setText(m_fileContent->fileName());
    lineEdit->selectAll();
    setInlineEditor(lineEdit);
    connect(filter, SIGNAL(returnPressed()),
            this, SIGNAL(askValidation()));
    connect(filter, SIGNAL(escapePressed()),
            this, SIGNAL(askValidation()));
    connect(filter, SIGNAL(mouseEntered()),
            this, SIGNAL(mouseEnteredEditorWidget()));
}
Exemple #12
0
bool FocusWidgetFilter::eventFilter(QObject *, QEvent *e)
{
    switch (e->type()) {
    case QEvent::KeyPress: {
        QKeyEvent *ke = static_cast<QKeyEvent*>(e);
        switch (ke->key()) {
        case Qt::Key_Return:
            emit returnPressed();
            return true;
        case Qt::Key_Escape:
            emit escapePressed();
            return true;
        default:
            return false;
        };
    }
    case QEvent::Enter:
        emit mouseEntered();
        // pass through
    default:
        return false;
    };
}
VolumeButton::VolumeButton(ILxQtPanelPlugin *plugin, QWidget* parent):
        QToolButton(parent),
        mPlugin(plugin),
        m_panel(plugin->panel()),
        m_showOnClick(true),
        m_muteOnMiddleClick(true)
{
    // initial icon for button. It will be replaced after devices scan.
    // In the worst case - no soundcard/pulse - is found it remains
    // in the button but at least the button is not blank ("invisible")
    handleStockIconChanged("dialog-error");
    m_volumePopup = new VolumePopup();

    m_popupHideTimer.setInterval(1000);
    connect(this, SIGNAL(clicked()), this, SLOT(toggleVolumeSlider()));
    connect(&m_popupHideTimer, SIGNAL(timeout()), this, SLOT(hideVolumeSlider()));

    connect(m_volumePopup, SIGNAL(mouseEntered()), &m_popupHideTimer, SLOT(stop()));
    connect(m_volumePopup, SIGNAL(mouseLeft()), &m_popupHideTimer, SLOT(start()));

    connect(m_volumePopup, SIGNAL(launchMixer()), this, SLOT(handleMixerLaunch()));
    connect(m_volumePopup, SIGNAL(stockIconChanged(QString)), this, SLOT(handleStockIconChanged(QString)));
}
//--------------------------------------------------------------
// mouse dragged (buttons down)
void mgOSXServices::mouseDrag(
  int x,
  int y,
  int dx,
  int dy)
{
  if (m_theApp == NULL)
    return;
    
  // we don't always get the first entered message
  if (!m_mouseInside)
    mouseEntered(x, y);
  
  if (m_mouseRelative)
  {
    m_theApp->appMouseDrag(dx, dy, m_eventFlags);
  }
  else 
  {
    m_theApp->appMouseDrag(x - m_lastCursorX, y - m_lastCursorY, m_eventFlags);
    m_lastCursorX = x;
    m_lastCursorY = y;
  }
}
Exemple #15
0
void ClickableImage::enterEvent(QEvent* eve)
{
	emit mouseEntered(this);
}
Exemple #16
0
void
Thumbwheel::enterEvent(QEvent *)
{
    emit mouseEntered();
}
Exemple #17
0
HtmlEditor::HtmlEditor(HtmlContent *htmlContent, QWidget *parent)
        : NoteEditor(htmlContent), m_htmlContent(htmlContent)
{
    FocusedTextEdit *textEdit = new FocusedTextEdit(/*disableUpdatesOnKeyPress=*/true,parent);
    textEdit->setLineWidth(0);
    textEdit->setMidLineWidth(0);
    textEdit->setFrameStyle(QFrame::Box);
    textEdit->setAutoFormatting(Settings::autoBullet() ? QTextEdit::AutoAll :
                                QTextEdit::AutoNone);

    QPalette palette;
    palette.setColor(textEdit->backgroundRole(), note()->backgroundColor());
    palette.setColor(textEdit->foregroundRole(), note()->textColor());
    textEdit->setPalette(palette);

    textEdit->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    textEdit->setHtml(Tools::tagCrossReferences(m_htmlContent->html(), /*userLink=*/true));
    textEdit->moveCursor(QTextCursor::End);
    textEdit->verticalScrollBar()->setCursor(Qt::ArrowCursor);
    setInlineEditor(textEdit);

    connect(textEdit,                                    SIGNAL(mouseEntered()),  this, SIGNAL(mouseEnteredEditorWidget()));
    connect(textEdit,                                    SIGNAL(escapePressed()), this, SIGNAL(askValidation()));

    connect(InlineEditors::instance()->richTextFont,     SIGNAL(currentFontChanged(const QFont&)),  this, SLOT(onFontSelectionChanged(const QFont&)));
    connect(InlineEditors::instance()->richTextFontSize, SIGNAL(sizeChanged(qreal)),            textEdit, SLOT(setFontPointSize(qreal)));
    connect(InlineEditors::instance()->richTextColor,    SIGNAL(activated(const QColor&)),    textEdit, SLOT(setTextColor(const QColor&)));

    connect(InlineEditors::instance()->focusWidgetFilter, SIGNAL(escapePressed()),  textEdit, SLOT(setFocus()));
    connect(InlineEditors::instance()->focusWidgetFilter, SIGNAL(returnPressed()), textEdit, SLOT(setFocus()));
    connect(InlineEditors::instance()->richTextFont,     SIGNAL(activated(int)),   textEdit, SLOT(setFocus()));

    connect(InlineEditors::instance()->richTextFontSize, SIGNAL(activated(int)),   textEdit, SLOT(setFocus()));

    connect(textEdit,  SIGNAL(cursorPositionChanged()),  this, SLOT(cursorPositionChanged()));
    connect(textEdit,  SIGNAL(currentCharFormatChanged(const QTextCharFormat&)), this, SLOT(charFormatChanged(const QTextCharFormat&)));
//  connect( textEdit,  SIGNAL(currentVerticalAlignmentChanged(VerticalAlignment)), this, SLOT(slotVerticalAlignmentChanged()) );

    connect(InlineEditors::instance()->richTextBold,      SIGNAL(triggered(bool)),    this, SLOT(setBold(bool)));
    connect(InlineEditors::instance()->richTextItalic,    SIGNAL(triggered(bool)),    textEdit, SLOT(setFontItalic(bool)));
    connect(InlineEditors::instance()->richTextUnderline, SIGNAL(triggered(bool)),    textEdit, SLOT(setFontUnderline(bool)));
    connect(InlineEditors::instance()->richTextLeft,      SIGNAL(triggered()), this, SLOT(setLeft()));
    connect(InlineEditors::instance()->richTextCenter,    SIGNAL(triggered()), this, SLOT(setCentered()));
    connect(InlineEditors::instance()->richTextRight,     SIGNAL(triggered()), this, SLOT(setRight()));
    connect(InlineEditors::instance()->richTextJustified, SIGNAL(triggered()), this, SLOT(setBlock()));

//  InlineEditors::instance()->richTextToolBar()->show();
    cursorPositionChanged();
    charFormatChanged(textEdit->currentCharFormat());
    //QTimer::singleShot( 0, this, SLOT(cursorPositionChanged()) );
    InlineEditors::instance()->enableRichTextToolBar();

    connect(InlineEditors::instance()->richTextUndo,      SIGNAL(triggered()), textEdit, SLOT(undo()));
    connect(InlineEditors::instance()->richTextRedo,      SIGNAL(triggered()), textEdit, SLOT(redo()));
    connect(textEdit, SIGNAL(undoAvailable(bool)), InlineEditors::instance()->richTextUndo, SLOT(setEnabled(bool)));
    connect(textEdit, SIGNAL(redoAvailable(bool)), InlineEditors::instance()->richTextRedo, SLOT(setEnabled(bool)));
    connect(textEdit, SIGNAL(textChanged()), this, SLOT(editTextChanged()));
    InlineEditors::instance()->richTextUndo->setEnabled(false);
    InlineEditors::instance()->richTextRedo->setEnabled(false);

    connect(textEdit, SIGNAL(cursorPositionChanged()), htmlContent->note()->basket(), SLOT(editorCursorPositionChanged()));
    // In case it is a very big note, the top is displayed and Enter is pressed: the cursor is on bottom, we should enure it visible:
    QTimer::singleShot(0, htmlContent->note()->basket(), SLOT(editorCursorPositionChanged()));
}
Exemple #18
0
void
LEDButton::enterEvent(QEvent *)
{
    emit mouseEntered();
}
Exemple #19
0
//VOXOX CHANGE by Rolando - 2009.07.07 - sends a signal to know that mouse had entered into the frame 
void VoxOxFrame::enterEvent ( QEvent * event ){
	setCursor(QCursor(Qt::PointingHandCursor));//VOXOX CHANGE by Rolando - 2009.07.07 
	mouseEntered();//VOXOX CHANGE by Rolando - 2009.07.07 
	QFrame::enterEvent(event);
}
Exemple #20
0
void KNMouseDetectLabel::enterEvent(QEvent *event)
{
    //Do the enter event.
    QLabel::enterEvent(event);
    emit mouseEntered();
}
Exemple #21
0
void FocusedTextEdit::enterEvent(QEvent *event)
{
    emit mouseEntered();
    KTextEdit::enterEvent(event);
}
void UBFloatingPalette::enterEvent(QEvent *event)
{
    Q_UNUSED(event);
    emit mouseEntered();
}
Exemple #23
0
void Column::enterEvent(QEvent *)
{
    emit mouseEntered(m_number);
}
Exemple #24
0
void VolumePopup::enterEvent(QEvent *event)
{
    emit mouseEntered();
}
void
GridToolButton::enterEvent( QEvent* e )
{
    emit mouseEntered();
    QToolButton::enterEvent( e );
}
 void ContactAvatarWidget::enterEvent(QEvent* /*_event*/)
 {
     emit mouseEntered();
     update();
 }
Exemple #27
0
void GLWidget::enterEvent(QEvent * /*event*/)
{
    emit mouseEntered(this);
}