コード例 #1
0
void GGoogleChat::PopulateDeviceWidget(GDeviceWidget* theDeviceWidget )
{
	// a form layout
 	QBoxLayout* pLay = new QVBoxLayout();
	theDeviceWidget->AddSubLayout(pLay);
	GoogleChatWidget* pWid = new GoogleChatWidget(this, theDeviceWidget);
	pLay->addWidget(pWid);

	// connects so that on failure we re-try
	connect(pWid, SIGNAL(FailedLogin()), this, SLOT(LatterInitialization()));
}
コード例 #2
0
GDevice::GDevice(QString uniqueIdentifierName, QObject *parent)
	: QThread(parent)
	, GSerializable(uniqueIdentifierName)
{
	AddToDeviceManager();
	// note that this ReName() call will be overwritten when the device is created through the device manager (see G_REGISTER_HARD_DEVICE_CLASS), 
	// but not if it is created manually or by another device, like in the SrYbExe::DevicesToShelf() or in GPhidgetAdvancedServoModule::CreateSubDevicesServos().
	ReName(uniqueIdentifierName);

	// warn if parent = 0. Added to a cleanup list to insure will be destroyed.
	if(!parent) {
		DeviceManagerInstance()->m_CleanUpDevices.add(this);
//		qDebug() << "device" << metaObject()->className() << UniqueSystemID() << "Created with parent = 0.";
	}
	connect(this, SIGNAL(PrivateTriggerLatterInitialization()), this, SLOT(LatterInitialization()), Qt::QueuedConnection);
	emit PrivateTriggerLatterInitialization();
	disconnect(this, SIGNAL(PrivateTriggerLatterInitialization()));

	m_Color = QColor(
		(qrand() * 255) / RAND_MAX, 
		(qrand() * 255) / RAND_MAX, 
		(qrand() * 255) / RAND_MAX);

}