Beispiel #1
0
void MainWindow::delData()
{
    QMessageBox msgBox;
    msgBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
    msgBox.setDefaultButton(QMessageBox::Ok);

    name = listView->currentIndex().data().toString();
    if(currentPos == 0) {
        msgBox.setText(tr("Do you really want to remove this category?"));
        if(msgBox.exec() == QMessageBox::Ok){
            sql->delCategory(name);
            posChanged();
        }
    } else if(currentPos == 1) {
        msgBox.setText(tr("Do you really want to remove this subcategory?"));
        if(msgBox.exec() == QMessageBox::Ok){
            sql->delSubcategory(name);
            posChanged();
        }
    } else if(currentPos == 2) {
        msgBox.setText(tr("Do you really want to remove this company?"));
        if(msgBox.exec() == QMessageBox::Ok){
            sql->delCompany(name);
            posChanged();
        }
    }
}
Beispiel #2
0
CompassFrame::CompassFrame(EQPlayer* player, QWidget* parent, const char* name)
  : SEQWindow("Compass", "ShowEQ - Compass", parent, name)
{
  QVBoxLayout* layout = new QVBoxLayout(this);
  layout->setAutoAdd(true);
  m_compass = new Compass (this, "compass");
  QHBox* coordsbox = new QHBox(this);
  m_compass->setFixedWidth(120);
  m_compass->setFixedHeight(120);

  for(int a=0;a<2;a++) 
  {
    if((a+showeq_params->retarded_coords)%2 == 0) 
    {
      // Create the x: label
      QLabel *labelx = new QLabel(showeq_params->retarded_coords?"E/W:":"X:",
				  coordsbox);
      labelx->setFixedHeight(labelx->sizeHint().height());
      labelx->setAlignment(QLabel::AlignLeft|QLabel::AlignVCenter);
      
      // Create the xpos label
      m_xPos = new QLabel("----",coordsbox);
      m_xPos->setFixedHeight(m_xPos->sizeHint().height());
      m_xPos->setAlignment(QLabel::AlignRight|QLabel::AlignVCenter);
    } 
    else 
    {
      // Create the y: label
      QLabel *labely = new QLabel(showeq_params->retarded_coords?"N/S:":"Y:",
				  coordsbox);
      labely->setFixedHeight(labely->sizeHint().height());
      labely->setAlignment(QLabel::AlignLeft|QLabel::AlignVCenter);
      
      // Create the ypos label
      m_yPos = new QLabel("----",coordsbox);
      m_yPos->setFixedHeight(m_yPos->sizeHint().height());
      m_yPos->setAlignment(QLabel::AlignRight|QLabel::AlignVCenter);
    }
   }
  
  // Create the z: label
  QLabel *labelz = new QLabel("Z:",coordsbox);
  labelz->setFixedHeight(labelz->sizeHint().height());
  labelz->setAlignment(QLabel::AlignLeft|QLabel::AlignVCenter);
  
  // Create the zpos label
  m_zPos = new QLabel("----",coordsbox);
  m_zPos->setFixedHeight(m_zPos->sizeHint().height());      
  m_zPos->setAlignment(QLabel::AlignRight|QLabel::AlignVCenter);

  // connect
  connect(player, SIGNAL(posChanged(int16_t,int16_t,int16_t,
				    int16_t,int16_t,int16_t,int32_t)), 
	  this, SLOT(posChanged(int16_t,int16_t,int16_t,
				int16_t,int16_t,int16_t,int32_t)));

  // initialize compass
  m_compass->setPos(player->getPlayerX(), player->getPlayerY());
  m_compass->setHeading(player->getPlayerHeading());
}
bool DeclarativeWidgetExtension::eventFilter(QObject *watched, QEvent *event)
{
  Q_ASSERT(watched == parent());
  Q_UNUSED(watched); // release builds

  switch (event->type())
  {
  case QEvent::Move:
    emit posChanged();
    emit geometryChanged();
    break;

  case QEvent::Resize:
    emit sizeChanged();
    emit geometryChanged();
    break;

  case QEvent::Show:
  case QEvent::Hide:
    emit visibleChanged(isVisible());
    break;

  default:
    break;
  }

  return false;
}
Beispiel #4
0
SpawnModel::SpawnModel(Player* player, QObject *parent)
    : QAbstractTableModel(parent), m_player(player)
{
    connect(m_player, SIGNAL(posChanged(int16_t,int16_t,int16_t, int16_t,int16_t,int16_t,int32_t)),
            this, SLOT(updatePosition(int16_t,int16_t,int16_t, int16_t,int16_t,int16_t,int32_t)));
    connect(m_player, SIGNAL(levelChanged(uint8_t)), this, SLOT(updateLevel(uint8_t)));
}
void GuiPart::setAngleDegrees( int angleDegrees )
{
	m_angleDegrees = angleDegrees;
	posChanged();
	if (canvas())
		canvas()->setChanged( boundingRect() );
}
void PlanningProblemDisplayAdapter::addArea(const QPointF &center)
{
    const qreal degrees = 0.001;
    QPointF topLeft = center + QPointF(-1*degrees,degrees);
    QPointF topRight = center + QPointF(degrees,degrees);
    QPointF bottomLeft = center + QPointF(-1*degrees,-1*degrees);
    QPointF bottomRight = center + QPointF(degrees,-1*degrees);
    QPolygonF geoPoly;
    geoPoly << topLeft << topRight << bottomRight << bottomLeft;

    TaskAreaObject * obj = new TaskAreaObject(geoPoly);
    connect(obj,
            SIGNAL(posChanged()),
            this,
            SLOT(handleAreaChanged()));
    connect(obj,
            SIGNAL(destroyed()),
            this,
            SLOT(handleAreaDestroyed()));
    if (!_problem.areas().contains(obj->geoPoly()))
        _problem.addArea(obj->geoPoly());
    _areas.insert(obj,obj->geoPoly());
    _mgScene->addObject(obj);

    this->problemHasChanged(_problem);
}
Beispiel #7
0
OperatorItem::OperatorItem(OperatorModel* model, QGraphicsItem * parent)
  : QGraphicsObject(parent),
    m_model(model)
{
    QPainterPath path;
    path.addRoundedRect(QRectF(-SIZE/2, -SIZE/2, SIZE, SIZE), RADIUS, RADIUS);
    m_opRect = new QGraphicsPathItem(path, this);
    QPen pen = m_opRect->pen();
    pen.setWidthF(WIDTH);
    m_opRect->setPen(pen);
    m_opRect->setBrush(Qt::white);
    setPos(m_model->pos());
    
    m_label = new QGraphicsTextItem(this);
    m_label->setPlainText(QString::fromStdString(m_model->op()->name()));
    m_label->setPos(-m_label->boundingRect().width()/2, SIZE/2 + LABEL_OFFSET);
    
    setFlag(ItemIsMovable, true);
    setFlag(ItemIsSelectable, true);
    setFlag(ItemIsFocusable, true);
    setFlag(ItemSendsScenePositionChanges, true);
    
    setInitialized(model->isInitialized());
    
    connect(m_model, SIGNAL(nameChanged(QString)), this, SLOT(setName(QString)));
    connect(m_model, SIGNAL(initializedChanged(bool)), this, SLOT(setInitialized(bool)));
    connect(m_model, SIGNAL(posChanged(QPointF)), this, SLOT(setOperatorPos(QPointF)));
    connect(m_model, SIGNAL(connectorOccupiedChanged(OperatorModel::ConnectorType,uint,bool)),
            this, SLOT(setConnectorOccupied(OperatorModel::ConnectorType,uint,bool)));
    connect(m_model, SIGNAL(activeChanged(bool)), this, SLOT(resetAllConnectors()));
}
Beispiel #8
0
void KgSound::setPos(const QPointF& pos)
{
	if (d->m_pos == pos)
		return;
	d->m_pos = pos;
	emit posChanged(pos);
}
Beispiel #9
0
void PianoView::leaveEvent(QEvent* event)
      {
      emit pitchChanged(-1);
      pos.setInvalid();
      emit posChanged(pos);
      QGraphicsView::leaveEvent(event);
      }
Beispiel #10
0
Datei: edge.cpp Projekt: KDE/kwin
void WindowBasedEdge::doStopApproaching()
{
    Cursor *cursor = Cursor::self();
    disconnect(cursor, SIGNAL(posChanged(QPoint)), this, SLOT(updateApproaching(QPoint)));
    cursor->stopMousePolling();
    m_approachWindow.map();
}
Beispiel #11
0
Datei: edge.cpp Projekt: KDE/kwin
void WindowBasedEdge::doStartApproaching()
{
    m_approachWindow.unmap();
    Cursor *cursor = Cursor::self();
    connect(cursor, SIGNAL(posChanged(QPoint)), SLOT(updateApproaching(QPoint)));
    cursor->startMousePolling();
}
void GuiPart::slotMoveBy( double dx, double dy )
{
	if ( dx==0 && dy==0 )
		return;
	
	moveBy( dx, dy );
	posChanged();
}
//private
void PrivateQGraphicsObject::setMGObj(MapGraphicsObject * mgObj)
{
    _mgObj = mgObj;

    if (_mgObj == 0)
        return;

    //Connect signals/slots for all of the changes in the MapGraphicsObject that we must be able to handle
    connect(_mgObj,
            SIGNAL(enabledChanged()),
            this,
            SLOT(handleEnabledChanged()));
    connect(_mgObj,
            SIGNAL(opacityChanged()),
            this,
            SLOT(handleOpacityChanged()));
    connect(_mgObj,
            SIGNAL(parentChanged()),
            this,
            SLOT(handleParentChanged()));
    connect(_mgObj,
            SIGNAL(posChanged()),
            this,
            SLOT(handlePosChanged()));
    connect(_mgObj,
            SIGNAL(rotationChanged()),
            this,
            SLOT(handleRotationChanged()));
    connect(_mgObj,
            SIGNAL(visibleChanged()),
            this,
            SLOT(handleVisibleChanged()));
    connect(_mgObj,
            SIGNAL(zValueChanged()),
            this,
            SLOT(handleZValueChanged()));
    connect(_mgObj,
            SIGNAL(selectedChanged()),
            this,
            SLOT(handleMGSelectedChanged()));
    connect(_mgObj,
            SIGNAL(flagsChanged()),
            this,
            SLOT(handleMGFlagsChanged()));
    connect(mgObj,
            SIGNAL(keyFocusRequested()),
            this,
            SLOT(handleKeyFocusRequested()));

    //Get all of the info about the MGObject
    this->updateAllFromMG();

    connect(mgObj,
            SIGNAL(destroyed()),
            this,
            SLOT(deleteLater()));
}
Beispiel #14
0
void PianorollEditor::heartBeat(Seq* seq)
      {
      unsigned tick = seq->getCurTick();
      if (locator[0].tick() != tick) {
            posChanged(POS::CURRENT, tick);
            if (preferences.followSong)
                  gv->ensureVisible(tick);
            }
      }
Beispiel #15
0
void ModelItem::setY(qreal y, bool notify)
{
    if(m_pos.y() != y) {
        m_pos.setY(y);
        if(notify) {
            emit posChanged(false, true);
        }
    }
}
Beispiel #16
0
void ModelItem::setX(qreal x, bool notify)
{
    if(m_pos.x() != x) {
        m_pos.setX(x);
        if(notify) {
            emit posChanged(true, false);
        }
    }
}
Beispiel #17
0
void QWindowCompositor::surfaceCreated(QWaylandSurface *surface)
{
    connect(surface, SIGNAL(destroyed(QObject *)), this, SLOT(surfaceDestroyed(QObject *)));
    connect(surface, SIGNAL(mapped()), this, SLOT(surfaceMapped()));
    connect(surface, SIGNAL(unmapped()), this, SLOT(surfaceUnmapped()));
    connect(surface, SIGNAL(damaged(const QRect &)), this, SLOT(surfaceDamaged(const QRect &)));
    connect(surface, SIGNAL(extendedSurfaceReady()), this, SLOT(sendExpose()));
    connect(surface, SIGNAL(posChanged()), this, SLOT(surfacePosChanged()));
    m_renderScheduler.start(0);
}
void MapGraphicsObject::setPos(const QPointF & nPos)
{
    if (nPos == _pos)
        return;
    _pos = nPos;

    if (_constructed)
        this->posChanged();
    else
        QTimer::singleShot(1, this, SIGNAL(posChanged()));
}
Beispiel #19
0
KFollowWindow::KFollowWindow( KWindowPrivate &dd, QWidget *parent /* = NULL*/ )
:KWindow(dd, parent)
{
	Q_D(KFollowWindow);
	d->init();
	if(parent)
	{
		QObject::connect(parent, SIGNAL(posChanged()), this, SLOT(on_posChanged()));
	}
	viewport()->installEventFilter(this);
}
Beispiel #20
0
void TTimeSlider::onValueChanged(int v) {

	bool dragging = dont_update;
	if (!dragging) {
		if (v != position) {
			emit posChanged(v);
		}
	} else {
        emit draggingPosChanged(v);
	}
}
//BEGIN Class Button
Button::Button( const QString & id, CNItem * parent, bool isToggle, const QRect & r, KtlQCanvas * canvas )
	: Widget( id, parent, r, canvas )
{
	b_isToggle = isToggle;
	m_button = new ToolButton(0l);
	m_button->setUsesTextLabel(false);
	m_button->setToggleButton(b_isToggle);
	connect( m_button, SIGNAL(pressed()), this, SLOT(slotStateChanged()) );
	connect( m_button, SIGNAL(released()), this, SLOT(slotStateChanged()) );
	posChanged();
}
Beispiel #22
0
void ModelItem::setPos(const QPointF &pos, bool notify)
{
    if(m_pos != pos) {
        const qreal &lastX = m_pos.x();
        const qreal &lastY = m_pos.y();

        m_pos = pos;
        if(notify) {
            emit posChanged(x()!=lastX, y()!=lastY);
        }
    }
}
Beispiel #23
0
void check::mouseMoveEvent(QMouseEvent *event)
{
	if(!fixed0)
	{
	if(this->y() + event->globalY()-cur_y < 200 && this->y() + event->globalY()-cur_y > 0 )
	{
		this->move(this->x(),this->y() + event->globalY()-cur_y);
		cur_y = event->globalY();
		emit posChanged(this->y() + event->globalY()-cur_y);
	}
	}
}
Beispiel #24
0
void TimeSlider::valueChanged_slot(int v) {

    // Only to make things clear:
    bool dragging = dont_update;
    if (!dragging) {
        if (v!=position) {
            emit posChanged(v);
        }
    } else {
        emit draggingPos(v);
    }
}
Beispiel #25
0
void check::mouseReleaseEvent(QMouseEvent *event)
{
	if(!fixed0)
	{
	if(event->button() == Qt::LeftButton && this->y() + event->globalY()-cur_y < 200 && this->y() + event->globalY()-cur_y > 0 )
	{
		this->move(this->x(),this->y() + event->globalY()-cur_y);
		cur_y = event->globalY();
		emit posChanged(this->y() + event->globalY()-cur_y);
		emit changed();
	}
	}
}
Beispiel #26
0
void GLWidget::mousePressEvent(QMouseEvent *event) {
	//printf("%d, %d\n", event->x(), event->y());
	std::cout<< "paintGL is called, id:"<< _id << std::endl;
	int realX = std::floor( static_cast<double>(event->x()) * static_cast<double>(_im->_image.cols) / static_cast<double>(this->width()) + 0.5);
	int realY = std::floor(static_cast<double>(event->y()) * static_cast<double>(_im->_image.rows) / static_cast<double>(this->height()) + 0.5);
	_x1 = _y1 = _x2 = _y2 = -1.0;
	makeCurrent();
	display();
	displayClickedPoint(event->x(), event->y());
	swapBuffers();

	emit posChanged(realX, realY, *_im);
}
//BEGIN Class Slider
Slider::Slider( const QString & id, CNItem * parent, const QRect & r, KtlQCanvas * canvas )
	: Widget( id, parent, r, canvas )
{
	m_orientation = Qt::Vertical;
	m_bSliderInverted = false;
	
	m_slider = new SliderWidget(0l);
	m_slider->setPaletteBackgroundColor(Qt::white);
	m_slider->setPaletteForegroundColor(Qt::white);
	m_slider->setEraseColor(Qt::white);
	m_slider->setBackgroundMode( Qt::NoBackground );
	connect( m_slider, SIGNAL(valueChanged(int)), this, SLOT(slotValueChanged(int)) );
	posChanged();
}
Beispiel #28
0
bool KWindow::event(QEvent * e)
{
	if(e->type() == KThemeChangeEvent::EventType)
	{
		themeChange((KThemeChangeEvent*)e);
		return true;
	}
	else if(e->type() == QEvent::Move)
	{
		emit posChanged();
		return true;
	}
	return __super::event(e);
}
Beispiel #29
0
void ModelItem::sendAttributeChanges()
{
    emit valueChanged();

    emit enabledChanged();
    emit selectedChanged();
    emit opacityChanged();
    emit visibilityChanged();

    emit brushChanged();
    emit fontChanged();
    emit penChanged();

    emit posChanged(true, true);
}
Beispiel #30
0
/*! \brief Seek slider position changed.
 *  \param new_pos The new position in secionds.
 *
 * This slot is triggered when the seek slider position changes. This can
 * either be due to user moving the slider or a new position set via setPos().
 * To prevent the latter from triggering emission of posChanged() the new
 * position is compared to the last one known. If they are equal, the position
 * was set using setPos(). If they are different the position change was a
 * result of user action.
 */
void DockIqPlayer::on_seekSlider_valueChanged(int new_pos)
{
    if (new_pos != d_pos) {
        /* This was a user action */
        d_pos = new_pos;
        emit posChanged(new_pos);
    }

    /* we need to update label in any case */
    QTime zero(0, 0, 0, 0);
    QTime t;

    t = zero.addSecs(d_pos);
    ui->posLabel->setText(t.toString("HH:mm:ss"));
}