Esempio n. 1
0
//! [Window constructor start]
Window::Window()
{
    thread = new RenderThread();
//! [Window constructor start] //! [set up widgets and connections]

    label = new QLabel();
    label->setAlignment(Qt::AlignCenter);

    loadButton = new QPushButton(tr("&Load image..."));
    resetButton = new QPushButton(tr("&Stop"));
    resetButton->setEnabled(false);

    connect(loadButton, SIGNAL(clicked()), this, SLOT(loadImage()));
    connect(resetButton, SIGNAL(clicked()), thread, SLOT(stopProcess()));
    connect(thread, SIGNAL(finished()), this, SLOT(resetUi()));
//! [set up widgets and connections] //! [connecting signal with custom type]
    connect(thread, SIGNAL(sendBlock(Block)), this, SLOT(addBlock(Block)));
//! [connecting signal with custom type]

    QHBoxLayout *buttonLayout = new QHBoxLayout();
    buttonLayout->addStretch();
    buttonLayout->addWidget(loadButton);
    buttonLayout->addWidget(resetButton);
    buttonLayout->addStretch();

    QVBoxLayout *layout = new QVBoxLayout(this);
    layout->addWidget(label);
    layout->addLayout(buttonLayout);

//! [Window constructor finish]
    setWindowTitle(tr("Queued Custom Type"));
}
void CSlotGroupBox::updateUi()
{
	std::string curObj = Modules::objView().getCurrentObject();
	if (curObj.empty()) 
	{
		resetUi();
		return;
	}
	CEntity &entity = Modules::objView().getEntity(curObj);
	CSlotInfo slotInfo = entity.getSlotInfo(_numSlot);

	_ui.offsetSpinBox->setValue(slotInfo.Offset * Modules::mainWin().getFrameRate());
	_ui.startBlendSpinBox->setValue(int(slotInfo.StartBlend));
	_ui.endBlendSpinBox->setValue(int(slotInfo.EndBlend));
	_ui.startFrameSpinBox->setValue(int(slotInfo.StartTime * Modules::mainWin().getFrameRate()));
	_ui.endFrameSpinBox->setValue(int(slotInfo.EndTime * Modules::mainWin().getFrameRate()));
	_ui.speedDoubleSpinBox->setValue(slotInfo.SpeedFactor);
	_ui.smoothSpinBox->setValue(int(slotInfo.Smoothness));
	
	if (slotInfo.SkeletonInverted) 
	  _ui.invSkelWeightCheckBox->setCheckState(Qt::Checked); 
	else 
	  _ui.invSkelWeightCheckBox->setCheckState(Qt::Unchecked); 

	if (slotInfo.Enable) 
	  _ui.enableCheckBox->setCheckState(Qt::Checked); 
	else 
	  _ui.enableCheckBox->setCheckState(Qt::Unchecked); 

	switch (slotInfo.ClampMode)
	{
	case 0:
		_ui.clampRadioButton->setChecked(true);
		break;
	case 1:
		_ui.repeatRadioButton->setChecked(true);
		break;
	case 2:
		_ui.disableRadioButton->setChecked(true);
		break;
	}
	
	_animName = QString(slotInfo.Animation.c_str());
	_skelName = QString(slotInfo.Skeleton.c_str());
	QString title = tr("Slot %1 : ").arg(_numSlot) + _animName + " : " + _skelName;
	this->setTitle(title);
}
Esempio n. 3
0
Qtwitter::Qtwitter( QWidget *parent ) : MainWindow( parent )
{
  connect( this, SIGNAL(switchModel(QString)), SLOT(setCurrentModel(QString)) );
  connect( this, SIGNAL(switchToPublicTimelineModel()), SLOT(setPublicTimelineModel()) );

  core = new Core( this );
  connect( this, SIGNAL(updateTweets()), core, SLOT(forceGet()) );
  connect( this, SIGNAL(openBrowser(QUrl)), core, SLOT(openBrowser(QUrl)) );
  connect( this, SIGNAL(post(QString,QString,int)), core, SLOT(post(QString,QString,int)) );
  connect( this, SIGNAL(resizeView(int,int)), core, SIGNAL(resizeData(int,int)));
  connect( this, SIGNAL(shortenUrl(QString)), core, SLOT(shortenUrl(QString)));
  connect( core, SIGNAL(twitterAccountsChanged(QList<TwitterAccount>,bool)), this, SLOT(setupTwitterAccounts(QList<TwitterAccount>,bool)) );
  connect( core, SIGNAL(urlShortened(QString)), this, SLOT(replaceUrl(QString)));
  connect( core, SIGNAL(about()), this, SLOT(about()) );
  connect( core, SIGNAL(addReplyString(QString,int)), this, SIGNAL(addReplyString(QString,int)) );
  connect( core, SIGNAL(addRetweetString(QString)), this, SIGNAL(addRetweetString(QString)) );
  connect( core, SIGNAL(errorMessage(QString)), this, SLOT(popupError(QString)) );
  connect( core, SIGNAL(resetUi()), this, SLOT(resetStatusEdit()) );
  connect( core, SIGNAL(requestStarted()), this, SLOT(showProgressIcon()) );
  if ( QSystemTrayIcon::supportsMessages() )
    connect( core, SIGNAL(sendNewsReport(QString)), this, SLOT(popupMessage(QString)) );

  twitpic = new TwitPicView( this );
  connect( twitpic, SIGNAL(uploadPhoto(QString,QString,QString)), core, SLOT(uploadPhoto(QString,QString,QString)) );
  connect( twitpic, SIGNAL(abortUpload()), core, SLOT(abortUploadPhoto()) );
  connect( this, SIGNAL(openTwitPicDialog()), twitpic, SLOT(show()) );
  connect( core, SIGNAL(twitPicResponseReceived()), twitpic, SLOT(resetForm()) );
  connect( core, SIGNAL(twitPicDataSendProgress(int,int)), twitpic, SLOT(showUploadProgress(int,int)) );

  settingsDialog = new Settings( this, core, twitpic, this );
  connect( this, SIGNAL(settingsDialogRequested()), settingsDialog, SLOT( show() ) );

  QSignalMapper *mapper = new QSignalMapper( this );
  mapper->setMapping( qApp, 1 );
  connect( qApp, SIGNAL(aboutToQuit()), mapper, SLOT(map()) );
  connect( mapper, SIGNAL(mapped(int)), settingsDialog, SLOT(saveConfig(int)) );
}