本文整理汇总了C++中IAccount::GetQObject方法的典型用法代码示例。如果您正苦于以下问题:C++ IAccount::GetQObject方法的具体用法?C++ IAccount::GetQObject怎么用?C++ IAccount::GetQObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAccount
的用法示例。
在下文中一共展示了IAccount::GetQObject方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleAccountValidated
void AccountsListWidget::handleAccountValidated (QObject *accObj, bool validated)
{
IAccount *acc = qobject_cast<IAccount*> (accObj);
if (!acc)
{
qWarning () << Q_FUNC_INFO
<< accObj
<< "is not an IAccount";
return;
}
if (!Account2Item_.contains (acc))
{
qWarning () << Q_FUNC_INFO
<< "account"
<< acc->GetAccountName ()
<< acc->GetQObject ()
<< "from"
<< sender ()
<< "not found here";
return;
}
QStandardItem *item = Account2Item_ [acc];
AccountsModel_->item (item->row (), Columns::IsValidated)->setText (validated ?
tr ("Validated") :
tr ("Not validated"));
Ui_.Accounts_->header ()->setResizeMode (QHeaderView::ResizeToContents);
}
示例2: on_Delete__released
void AccountsListWidget::on_Delete__released ()
{
auto index = Ui_.Accounts_->selectionModel ()->currentIndex ();
index = index.sibling (index.row (), Columns::Name);
if (!index.isValid ())
return;
QStandardItem *item = AccountsModel_->itemFromIndex (index);
IAccount *acc = 0;
if (item &&
Item2Account_.contains (item))
acc = Item2Account_ [item];
else
return;
if (QMessageBox::question (this,
"LeechCraft",
tr ("Are you sure you want to remove the account %1?")
.arg ("<em>" + acc->GetAccountName () + "</em>"),
QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes)
return;
QObject *bpObj = acc->GetParentBloggingPlatform ();
IBloggingPlatform *ibp = qobject_cast<IBloggingPlatform*> (bpObj);
if (!ibp)
{
qWarning () << Q_FUNC_INFO
<< "parent blogging platform for"
<< acc->GetAccountID ()
<< "doesn't implement IBloggingPlatform";
return;
}
ibp->RemoveAccount (acc->GetQObject ());
}
示例3: joinAccountConfFromBM
void AccountActionsManager::joinAccountConfFromBM ()
{
IAccount *account = GetAccountFromSender (sender (), Q_FUNC_INFO);
if (!account)
return;
const QVariant& bmData = sender ()->property ("Azoth/BMData");
if (bmData.isNull ())
return;
const auto proto = qobject_cast<IMUCProtocol*> (account->GetParentProtocol ());
if (!proto)
{
qWarning () << Q_FUNC_INFO
<< account->GetAccountName ()
<< "parent protocol does not implement IMUCProtocol";
return;
}
auto jWidget = proto->GetMUCJoinWidget ();
IMUCJoinWidget *imjw = qobject_cast<IMUCJoinWidget*> (jWidget);
imjw->SetIdentifyingData (bmData.toMap ());
imjw->Join (account->GetQObject ());
jWidget->deleteLater ();
}
示例4: handleAccountSD
void AccountActionsManager::handleAccountSD ()
{
IAccount *account = GetAccountFromSender (sender (), Q_FUNC_INFO);
if (!account)
return;
auto w = new ServiceDiscoveryWidget ();
w->SetAccount (account->GetQObject ());
emit gotSDWidget (w);
}
示例5: handleAccountValidated
void LocalBloggingPlatform::handleAccountValidated (bool valid)
{
IAccount *acc = qobject_cast<IAccount*> (sender ());
if (!acc)
{
qWarning () << Q_FUNC_INFO
<< sender ()
<< "is not an IAccount";;
return;
}
emit accountValidated (acc->GetQObject (), valid);
}
示例6: handleAccountConsole
void AccountActionsManager::handleAccountConsole ()
{
IAccount *account = GetAccountFromSender (sender (), Q_FUNC_INFO);
if (!account)
return;
if (!Account2CW_.contains (account))
{
ConsoleWidget *cw = new ConsoleWidget (account->GetQObject ());
Account2CW_ [account] = cw;
connect (cw,
SIGNAL (removeTab (QWidget*)),
this,
SLOT (consoleRemoved (QWidget*)));
}
示例7: handleAccountValidated
void LJBloggingPlatform::handleAccountValidated (bool validated)
{
IAccount *acc = qobject_cast<IAccount*> (sender ());
if (!acc)
{
qWarning () << Q_FUNC_INFO
<< sender ()
<< "is not an IAccount";;
return;
}
emit accountValidated (acc->GetQObject (), validated);
if (validated &&
XmlSettingsManager::Instance ().Property ("CheckingInboxEnabled", true).toBool ())
checkForMessages ();;
}
示例8: Save
void BookmarksManagerDialog::Save ()
{
QVariantList datas;
for (int i = 0; i < BMModel_->rowCount (); ++i)
datas << BMModel_->item (i)->data ();
const int index = Ui_.AccountBox_->currentIndex ();
IAccount *account = Ui_.AccountBox_->itemData (index).value<IAccount*> ();
if (!account)
{
qWarning () << Q_FUNC_INFO
<< "no account available for index"
<< index;
return;
}
qobject_cast<ISupportBookmarks*> (account->GetQObject ())->SetBookmarkedMUCs (datas);
on_AccountBox__currentIndexChanged (index);
}
示例9: handleAccountSetLocation
void AccountActionsManager::handleAccountSetLocation ()
{
IAccount *account = GetAccountFromSender (sender (), Q_FUNC_INFO);
if (!account)
return;
QObject *obj = account->GetQObject ();
ISupportGeolocation *loc = qobject_cast<ISupportGeolocation*> (obj);
if (!loc)
{
qWarning () << Q_FUNC_INFO
<< obj
<< "doesn't support geolocation";
return;
}
LocationDialog dia (MW_);
if (dia.exec () != QDialog::Accepted)
return;
loc->SetGeolocationInfo (dia.GetInfo ());
}