本文整理汇总了C++中QueryResult::getField方法的典型用法代码示例。如果您正苦于以下问题:C++ QueryResult::getField方法的具体用法?C++ QueryResult::getField怎么用?C++ QueryResult::getField使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QueryResult
的用法示例。
在下文中一共展示了QueryResult::getField方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fillFavoriteInfo
void BookmarkGui::fillFavoriteInfo( const QString& id , const QString& Id_f )
{
this->fillFavoriteInfo( id ) ;
this->current_favorite_id = Id_f ;
Bookmark bk ;
QueryResult res ;
bk.getComment( res , Id_f ) ;
if ( res.empty() )
ui->Comments->setHtml( "" ) ;
else
ui->Comments->setHtml( res.getField(0,0) ) ;
ui->SaveComment->setDisabled( true );
res.clear() ;
bk.getState( res , Id_f ) ;
if ( !res.empty() )
{
int index = ui->State->findText( res.getField(0,0) ) ;
ui->State->setCurrentIndex( index );
}
else
ui->State->setCurrentIndex( 0 );
res.clear() ;
bk.getEvaluation( res , Id_f ) ;
if ( !res.empty() )
{
int index = ui->Evaluation->findData( res.getField(0,0) ) ;
ui->Evaluation->setCurrentIndex( index );
}
else
ui->Evaluation->setCurrentIndex( 0 );
}
示例2: getStateId
QString Bookmark::getStateId( QString name )
{
QString query = "select Id from UserStates where StateName like \'" ;
query += name ;
query += "\' " ;
QueryResult qr ;
this->execQuery( query , qr );
if ( qr.size() == 0 )
return QString() ;
else
return qr.getField(0,0) ;
}
示例3: setArticleItemDecorations
void BookmarkGui::setArticleItemDecorations( QTreeWidgetItem* item , const QString& id_articolo , const QString& id )
{
QueryResult article ;
Bookmark bk ;
bk.getFavoriteFullData( article , id_articolo ) ;
QIcon doc_icon(":/icons/crystal/doc-icon.png") ;
item->setIcon( 0 , doc_icon );
if ( article.size() == 0 ) return ;
item->setText( 0 , article.getField( "Titolo" , article.begin() ) );
item->setText( 1 , id_articolo ) ;
item->setText( 2 , id ) ;
}
示例4:
bool LeScienze500::fillQListWidget( QListWidget *w_list , QueryResult &r_list )
{
if ( r_list.empty() )
return false ;
w_list->clear();
QString col_name = r_list.getFirstColumnName() ;
QueryResult::iterator it;
for( it = r_list.begin() ; it < r_list.end() ; it++ )
{
w_list->addItem( r_list.getField( col_name , it ) );
}
return true ;
}
示例5: removeEvaluation
bool BookmarkGui::removeEvaluation()
{
Bookmark bk ;
QueryResult favorite ;
QTreeWidgetItem *item ;
bk.getFavoriteFullData( favorite , this->current_favorite );
QList<QTreeWidgetItem *> list =
ui->treeEvaluations->findItems ( favorite.getField( "Id" , favorite.begin() ) , Qt::MatchExactly|Qt::MatchRecursive , 1 ) ;
if ( list.size() > 1 || list.isEmpty() ) return false ;
item = list.first() ;
if ( item->type() != BookmarkGui::item_article ) return false ;
QTreeWidgetItem *parent = item->parent() ;
parent->removeChild( item ); ;
return true ;
}
示例6: changeState
bool BookmarkGui::changeState( QString new_state )
{
Bookmark bk ;
QueryResult favorite ;
QTreeWidgetItem *item ;
bk.getFavoriteFullData( favorite , this->current_favorite );
QList<QTreeWidgetItem *> list =
ui->treeStates->findItems ( favorite.getField( "Titolo" , favorite.begin() ) , Qt::MatchExactly|Qt::MatchRecursive ) ;
if ( list.size() > 1 ) return false ;
QList<QTreeWidgetItem *> list_state =
ui->treeStates->findItems ( new_state , Qt::MatchExactly ) ;
if ( list_state.isEmpty() || list_state.size() > 1 ) return false ;
QTreeWidgetItem *state = list_state.first() ;
if ( state->type() != BookmarkGui::item_state ) return false ;
item = list.first() ;
if ( item->type() != BookmarkGui::item_article ) return false ;
int index = item->parent()->indexOfChild( item ) ;
item = item->parent()->takeChild( index ) ;
state->addChild( item );
state->setExpanded( true );
ui->treeStates->setCurrentItem( item );
return true ;
}
示例7: changeEvaluation
bool BookmarkGui::changeEvaluation( QString stars )
{
Bookmark bk ;
QueryResult favorite ;
QTreeWidgetItem *item ;
bk.getFavoriteFullData( favorite , this->current_favorite );
QList<QTreeWidgetItem *> list =
ui->treeEvaluations->findItems ( favorite.getField( "Titolo" , favorite.begin() ) , Qt::MatchExactly|Qt::MatchRecursive ) ;
if ( list.size() > 1 ) return false ;
QList<QTreeWidgetItem *> list_evaluations =
ui->treeEvaluations->findItems ( stars , Qt::MatchExactly , 1 ) ;
if ( list_evaluations.isEmpty() || list_evaluations.size() > 1 ) return false ;
QTreeWidgetItem *evaluation = list_evaluations.first() ;
if ( evaluation->type() != BookmarkGui::item_evaluation ) return false ;
item = list.first() ;
if ( item->type() != BookmarkGui::item_article ) return false ;
int index = item->parent()->indexOfChild( item ) ;
item = item->parent()->takeChild( index ) ;
evaluation->addChild( item );
evaluation->setExpanded( true );
ui->treeEvaluations->setCurrentItem( item );
return true ;
}