예제 #1
0
void ActiveLabel::showActiveWithAnimation()
{
    if (m_loopCount != 0)
        return;
    m_loopCount = 0;
    setFixedSize(28, 13);
    emit sizeChange();
    setVisible(true);
    m_iconPath = m_openingIndicatorIcon;
    QPropertyAnimation *animation = new QPropertyAnimation(this, "opacity");
    animation->setDuration(500);
    animation->setStartValue(0);
    animation->setEndValue(1);
    animation->start();
    connect(animation, &QPropertyAnimation::finished, [=]{
        ++ m_loopCount;
        if (m_loopCount == 4){
            m_loopCount = 0;
            emit showAnimationFinish();
        }
        else{
            if (m_loopCount % 2 == 0){
                animation->setStartValue(0);
                animation->setEndValue(1);
                animation->start();
            }
            else{
                animation->setStartValue(1);
                animation->setEndValue(0);
                animation->start();
            }
        }
    });

}
예제 #2
0
void Board::setSize(int x, int y) {
  if(x == x_tiles() && y == y_tiles())
    return;

  if(field != 0)
    free(field);

  field = (int*)malloc(sizeof(int) * x * y);
  _x_tiles = x;
  _y_tiles = y;
  for(int i = 0; i < x; i++)
    for(int j = 0; j < y; j++)
      setField(i, j, EMPTY);

  loadTiles();
  double scaler = 1.0;
  while(sizeHint().width() > kapp->desktop()->width() - 2*XBORDER ||
     sizeHint().height() > kapp->desktop()->height() - 2*YBORDER) {
    scaler -= 0.2;
    loadTiles(scaler);
  }

  newGame();
  emit changed();
  emit sizeChange();
}
예제 #3
0
void ActiveLabel::show()
{
    QLabel::show();
    setFixedSize(24, 5);
    setOpacity(1);
    m_iconPath = m_openIndicatorIcon;
    update();
    emit sizeChange();
}
예제 #4
0
void cUIControl::Size( const eeSize& Size ) {
	if ( Size != mSize ) {
		eeVector2i sizeChange( Size.x - mSize.x, Size.y - mSize.y );

		mSize = Size;

		OnSizeChange();

		if ( mFlags & UI_REPORT_SIZE_CHANGE_TO_CHILDS ) {
			SendParentSizeChange( sizeChange );
		}
	}
}
예제 #5
0
void MsgView::resizeEvent(QResizeEvent *e)
{
  QScrollBar *s = verticalScrollBar();
  int ow = header()->sectionSize(1);
  int nw = width() - 200 - s->width();
  QListView::resizeEvent(e);
  if (ow != nw)
  {
    header()->resizeSection(1, nw);
    emit sizeChange(1, ow, nw);
  }
  SetEventLines();
}
예제 #6
0
void ConnectionListWidget::addConnection(ConnectionUnit *cUnit)
{
    ConnectionWidget *cw = new ConnectionWidget(this,cUnit);
    connectionList.append(cw);
    QListWidgetItem *item = new QListWidgetItem;
    listWidget->addItem(item);
    listWidget->setItemWidget(item,cw);
    item->setSizeHint(cw->sizeHint());

    connect(cw,SIGNAL(nameChange()),this,SLOT(nameChanged()));
    connect(cw,SIGNAL(widgetRemoved()),this,SLOT(connectionRemoved()));
    connect(cw,SIGNAL(sizeChange(QSize)),this,SLOT(sizeChanged(QSize)));
    updateList();
}
예제 #7
0
void ConnectionListWidget::newConnection()
{
    ConnectionUnit *connectionUnit = new ConnectionUnit;
    connectionUnit->setName(newConnectionName());
    connections->append(connectionUnit);

    ConnectionWidget *connWidget = new ConnectionWidget(this, connectionUnit);
    connectionList.append(connWidget);

    QListWidgetItem *item = new QListWidgetItem;
    listWidget->addItem(item);
    listWidget->setItemWidget(item,connWidget);
    item->setSizeHint(connWidget->sizeHint());

    connect(connWidget,SIGNAL(nameChange()),this,SLOT(nameChanged()));
    connect(connWidget,SIGNAL(widgetRemoved()),this,SLOT(connectionRemoved()));
    connect(connWidget,SIGNAL(sizeChange(QSize)),this,SLOT(sizeChanged(QSize)));
    updateList();
}
예제 #8
0
void ConnectionListWidget::addConnection(QString name, int connType, QString address, QString port)
{
    ConnectionUnit *cUnit  = new ConnectionUnit;
    cUnit->setName(name);
    cUnit->setType((connectionType) connType);
    cUnit->setAddress_Port(address);
    cUnit->setPort_Baud(port.toLong());
    connections->append(cUnit);

    ConnectionWidget *connWidget = new ConnectionWidget(this,cUnit);
    connectionList.append(connWidget);

    QListWidgetItem *item = new QListWidgetItem;
    listWidget->addItem(item);
    listWidget->setItemWidget(item,connWidget);
    item->setSizeHint(connWidget->sizeHint());

    connect(connWidget,SIGNAL(nameChange()),this,SLOT(nameChanged()));
    connect(connWidget,SIGNAL(widgetRemoved()),this,SLOT(connectionRemoved()));
    connect(connWidget,SIGNAL(sizeChange(QSize)),this,SLOT(sizeChanged(QSize)));
    updateList();
}
예제 #9
0
void GraphicsView::resizeEvent( QResizeEvent *event )
{
	QSize size = event->size();
	emit sizeChange(size.width(), size.height());
}