Esempio n. 1
0
int main(){
  int x = 0;
  int y = 1;

  int& r = x; // r = &x;
  r = y; // *r = y;

  int *p2 = &x;
  p2 = &y;

  point p;

  point *ptp = &p;
  ptp->x = 1; // (*ptp).x = 1;
  ptp->y = 2;

  point& rp = p;
  rp.x = 1;
  rp.y = 2;

  changePointer(p2);
  std::cout << "x: " << x << "\n";
  changeReference(x);
  std::cout << "x: " << x << "\n";

  return 0;
}
Esempio n. 2
0
void ViWaveWidgetGroup::updateBindings()
{
	ViWaveWidget *widget;
	ViWaveWidgetGroup::Action action;
	foreach(widget, mWidgets)
	{
		widget->disconnect(this);
		foreach(action, mActions)
		{
			if(action == ViWaveWidgetGroup::Zoom)
			{
				QObject::connect(widget, SIGNAL(zoomChanged(qint16)), this, SLOT(changeZoom(qint16)));
			}
			else if(action == ViWaveWidgetGroup::Pointer)
			{
				QObject::connect(widget, SIGNAL(pointerChanged(qint32)), this, SLOT(changePointer(qint32)));
			}
			else if(action == ViWaveWidgetGroup::Position)
			{
				QObject::connect(widget, SIGNAL(positionChanged(ViAudioPosition)), this, SLOT(changePosition(ViAudioPosition)));
			}
			else if(action == ViWaveWidgetGroup::Toolbars)
			{
				QObject::connect(widget, SIGNAL(toolbarsShown()), this, SLOT(showToolbars()));
				QObject::connect(widget, SIGNAL(toolbarsHidden()), this, SLOT(hideToolbars()));
			}
		}
	}