• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ setHeaderData函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中setHeaderData函数的典型用法代码示例。如果您正苦于以下问题:C++ setHeaderData函数的具体用法?C++ setHeaderData怎么用?C++ setHeaderData使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了setHeaderData函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: setQuery

//! [0]
void DeviceModel::refresh()
{
    setQuery("SELECT * FROM tab_devices ORDER BY d_typeID, d_producer, d_name");
    setHeaderData(0, Qt::Horizontal, QObject::tr("ID"));
    setHeaderData(1, Qt::Horizontal, QObject::tr("First name"));
    setHeaderData(2, Qt::Horizontal, QObject::tr("Last name"));
}/*
开发者ID:dmnk,项目名称:harbour-smscontrol,代码行数:8,代码来源:devicemodel.cpp


示例2: orderString

void SmlAllModel::refresh(int orderColumn, int orderMode)
{
    QString orderString("");
    switch (orderColumn) {
    case 0: {
        if(orderMode) orderString = "ORDER by sml.smlid DESC";
        else orderString = "ORDER by sml.smlid ASC";
    }
    break;
    case 1: {
        if(orderMode) orderString = "ORDER by smla.author DESC";
        else orderString = "ORDER by smla.author ASC";
    }
    break;
    case 2: {
        if(orderMode) orderString = "ORDER by sml.title DESC";
        else orderString = "ORDER by sml.title ASC";
    }
    break;
    case 3: {
        if(orderMode) orderString = "ORDER by smlp.publisher DESC";
        else orderString = "ORDER by smlp.publisher ASC";
    }
    break;
    }

    QSqlQuery query("SELECT sml.smlid, smla.author, sml.title, smlp.publisher FROM sheetmusiclibrary sml, smlauthor smla, smlpublisher smlp WHERE smla.smlauthorid=sml.author AND smlp.smlpublisherid=sml.publisher "+orderString, *myW->getMyDb()->getMyPupilDb());
    setQuery(query);
    if (query.lastError().isValid()) qDebug() << "DB Error: 148 - " << query.lastError();

    setHeaderData(0, Qt::Horizontal, QObject::tr("Index"));
    setHeaderData(1, Qt::Horizontal, QObject::tr("Komponist / Author"));
    setHeaderData(2, Qt::Horizontal, QObject::tr("Titel"));
    setHeaderData(3, Qt::Horizontal, QObject::tr("Verlag"));
}
开发者ID:doitux,项目名称:qupil,代码行数:35,代码来源:smlallmodel.cpp


示例3: setQuery

void EditableSqlModel::refresh()
{
    setQuery("select * from person");
    setHeaderData(0, Qt::Horizontal, QObject::tr("ID"));
    setHeaderData(1, Qt::Horizontal, QObject::tr("First name"));
    setHeaderData(2, Qt::Horizontal, QObject::tr("Last name"));
}
开发者ID:eagafonov,项目名称:qtmoko,代码行数:7,代码来源:editablesqlmodel.cpp


示例4: QStandardItemModel

VcsFileChangesModel::VcsFileChangesModel(QObject *parent, bool allowSelection)
    : QStandardItemModel(parent), d(new VcsFileChangesModelPrivate)
{
    setColumnCount(2);
    setHeaderData(0, Qt::Horizontal, i18n("Filename"));
    setHeaderData(1, Qt::Horizontal, i18n("Status"));
    d->allowSelection = allowSelection;
}
开发者ID:caidongyun,项目名称:kdevplatform,代码行数:8,代码来源:vcsfilechangesmodel.cpp


示例5: QSqlTableModel

MEstablecimiento::MEstablecimiento( QObject *parent )
 : QSqlTableModel( parent )
{
 setTable( "car_establecimientos" );
 setHeaderData( 0, Qt::Horizontal, "#ID" );
 setHeaderData( 1, Qt::Horizontal, "Nombre" );
 setHeaderData( 2, Qt::Horizontal, "#RESMPA" );
}
开发者ID:chungote,项目名称:gestotux,代码行数:8,代码来源:mestablecimiento.cpp


示例6: clear

void EmployeeTableModel::refresh()
{
    clear();
    setQuery(selectQ, QSqlDatabase::database("KarbowyDb"));
    setHeaderData(EMPLOYEE_COLUMN_LOGIN, Qt::Horizontal, "Login");
    setHeaderData(EMPLOYEE_COLUMN_PASSWORD, Qt::Horizontal, "Hasło");
    setHeaderData(EMPLOYEE_COLUMN_NAME, Qt::Horizontal, "Imię i nazwisko");
}
开发者ID:Meehanick,项目名称:-TIN-Karbowy,代码行数:8,代码来源:employeetablemodel.cpp


示例7: fieldIndex

void BaseSqlTableModel::setHeaderProperties(
        ColumnCache::Column column, QString title, int defaultWidth) {
    int fi = fieldIndex(column);
    setHeaderData(fi, Qt::Horizontal, m_tableColumnCache.columnName(column),
                  TrackModel::kHeaderNameRole);
    setHeaderData(fi, Qt::Horizontal, title, Qt::DisplayRole);
    setHeaderData(fi, Qt::Horizontal, defaultWidth, TrackModel::kHeaderWidthRole);
}
开发者ID:amoghpc,项目名称:mixxx,代码行数:8,代码来源:basesqltablemodel.cpp


示例8: QSqlTableModel

MPrefCategorias::MPrefCategorias(QObject *parent)
 : QSqlTableModel(parent)
{
 setTable( "car_categorias" );
 setHeaderData( 0, Qt::Horizontal, "#id_db" );
 setHeaderData( 1, Qt::Horizontal, "Categoria" );
 setHeaderData( 2, Qt::Horizontal, "Especial" );
 setEditStrategy( QSqlTableModel::OnManualSubmit );
}
开发者ID:chungote,项目名称:gestotux,代码行数:9,代码来源:mprefcategorias.cpp


示例9: setQuery

void OrderLineModel::setToEmptyModel()
{
	//! TODO : verify
    setQuery("");

    setHeaderData(OrderLineField_id, Qt::Horizontal, tr("EMPTY"));
    setHeaderData(OrderLineField_name, Qt::Horizontal, tr("EMPTY"));
    setHeaderData(OrderLineField_price, Qt::Horizontal, tr("EMPTY"));
}
开发者ID:julianandreou,项目名称:pos,代码行数:9,代码来源:OrderLineModel.cpp


示例10: QAbstractTableModel

MCaravanaDueno::MCaravanaDueno(QObject *parent)
 : QAbstractTableModel(parent)
{
 setHeaderData( 0, Qt::Horizontal, "#ID" );
 setHeaderData( 1, Qt::Horizontal, "Codigo de Caravana" );
#ifdef GESTOTUX_CARAVANAS_TIENEN_DUENOS
 setHeaderData( 2, Qt::Horizontal, "Dueño" );
#endif
}
开发者ID:chungote,项目名称:gestotux,代码行数:9,代码来源:mcaravanadueno.cpp


示例11: QSqlRelationalTableModel

MVPresupuestos::MVPresupuestos(QObject *parent) :
    QSqlRelationalTableModel(parent)
{
    setTable( "v_presupuestos" );
    setHeaderData( 0, Qt::Horizontal, "#ID" );
    setHeaderData( 1, Qt::Horizontal, "#Presupuesto" );
    setHeaderData( 2, Qt::Horizontal, "Destinatario" );
    setHeaderData( 3, Qt::Horizontal, "Fecha" );
    setHeaderData( 4, Qt::Horizontal, "Total" );
}
开发者ID:chungote,项目名称:gestotux,代码行数:10,代码来源:mvpresupuestos.cpp


示例12: setTable

ReferTableModel::ReferTableModel(QObject *parent)
{
    setTable("referNode");
    setSort(1, Qt::AscendingOrder);
    setHeaderData(1, Qt::Horizontal, tr("NetID"));
    setHeaderData(2, Qt::Horizontal, tr("Floor"));
    setHeaderData(3, Qt::Horizontal, tr("Number"));
    setHeaderData(4, Qt::Horizontal, tr("TMP_Period"));
    select();
}
开发者ID:zhongming2013,项目名称:dynamicLocation,代码行数:10,代码来源:refertablemodel.cpp


示例13: QSqlRelationalTableModel

MCompraProducto::MCompraProducto(QObject *parent)
 : QSqlRelationalTableModel(parent)
{
 setTable( "compras_productos" );
 setHeaderData( 0, Qt::Horizontal, "#item" );
 setHeaderData( 1, Qt::Horizontal, "#Compra" );
 setHeaderData( 2, Qt::Horizontal, "#Producto" );
 setHeaderData( 3, Qt::Horizontal, "Precio Compra" );
 setHeaderData( 4, Qt::Horizontal, "Cantidad" );
}
开发者ID:chungote,项目名称:gestotux,代码行数:10,代码来源:mcompraproducto.cpp


示例14: QSqlRelationalTableModel

MMascota::MMascota( QObject *parent )
 : QSqlRelationalTableModel( parent )
{
 setTable( "mascota" );
 setHeaderData( 0, Qt::Horizontal, "#ID" );
 setHeaderData( 1, Qt::Horizontal, "Dueño" );
   setRelation( 1, QSqlRelation( "dueno", "id", "apellido" ) );
 setHeaderData( 2, Qt::Horizontal, "Nombre" );
 setHeaderData( 3, Qt::Horizontal, "Raza" );
 setHeaderData( 4, Qt::Horizontal, "Genero" );
}
开发者ID:chungote,项目名称:gestotux,代码行数:11,代码来源:mmascota.cpp


示例15: QSqlTableModel

AboCommentsModel::AboCommentsModel(const QString &telA, QObject *parent)
  : QSqlTableModel(parent)
{
  setTable("tb_abonentNotes");
  setFilter(QString("telA=%1").arg(telA));
  select();
  
  setHeaderData(TelA, Qt::Horizontal, trUtf8("Телефон"));
  setHeaderData(Date, Qt::Horizontal, trUtf8("Дата"));
  setHeaderData(Text, Qt::Horizontal, trUtf8("Примечание"));
}
开发者ID:ukv626,项目名称:abonent2,代码行数:11,代码来源:AboCommentsDialog.cpp


示例16: setTable

MobileTableModel::MobileTableModel(QObject *parent)
{
    setTable("mobileConfig");
    setSort(1, Qt::AscendingOrder);
    setHeaderData(1, Qt::Horizontal, tr("FixID"));
    setHeaderData(2, Qt::Horizontal, tr("Mode"));
    setHeaderData(3, Qt::Horizontal, tr("DST Address"));
    setHeaderData(4, Qt::Horizontal, tr("Period"));
    setHeaderData(5, Qt::Horizontal, tr("Self Address"));
    select();
}
开发者ID:zhongming2013,项目名称:dynamicLocation,代码行数:11,代码来源:mobileTableModel.cpp


示例17: setHeaderData

/**
 * Allows to set the text of the headerView
 */
void QSearchItemModel::setHeader(QString vocName)
{
	QStringList tokens = (vocName).split("__");
	QString lang1 = tokens.value(0);
	QString lang2 = tokens.value(1);

	//set the header data
	setHeaderData(0, Qt::Horizontal, lang1);
	setHeaderData(1, Qt::Horizontal, lang2);

	m_vocName = vocName;
}
开发者ID:arntanguy,项目名称:Vokabb,代码行数:15,代码来源:mdl_searchitemmodel.cpp


示例18: QSqlQueryModel

ResumenComprasPorProductos::ResumenComprasPorProductos(QObject *parent) :
    QSqlQueryModel(parent)
{
    _metodo_temporal = PorMes;
    consultas.insert( "QSQLITE", "SELECT cp.id_producto as id_producto, SUM( cp.cantidad ), p.nombre AS proveedor, MAX( c.fecha ) as ultima_compra FROM compras_productos AS cp, compras AS c, proveedor AS p WHERE p.id = c.id_proveedor AND cp.id_compra = c.id " );
    //consultas.insert( "QMYSQL", "SELECT COUNT( id ) as cantidad, MAX( fecha ) as fecha, strftime( \"%m\" , fecha ) as mes, strftime( \"%Y\", fecha ) as ano, SUM( total ) as total, id_proveedor FROM compras " );
    setQuery( consultas.value( QSqlDatabase::database().driverName() ) );
    setHeaderData( 0, Qt::Horizontal, "Producto" );
    setHeaderData( 1, Qt::Horizontal, "Cantidad Total" );
    setHeaderData( 2, Qt::Horizontal, "Proveedor" );
    setHeaderData( 3, Qt::Horizontal, QString::fromUtf8( "Fecha última" ) );
    _id_producto = -1;
}
开发者ID:tranfuga25s,项目名称:gestotux,代码行数:13,代码来源:resumencomprasporproductos.cpp


示例19: setQuery

void Datenmodell::AbfrageStarten(QString welche)
{
	QSqlDatabase DB=QSqlDatabase::database(DBVERBINDUNG,false);
	if(!DB.isOpen())
		return;
	setQuery(welche,DB);
	if(lastError().isValid())
	{
		FehlerAufgetreten(lastError().text());
		return;
	}
	setHeaderData(0,Qt::Horizontal,tr("Zeichen"));
	setHeaderData(1,Qt::Horizontal,tr("Wort"));
}
开发者ID:tuxmaster,项目名称:Funkalphabet,代码行数:14,代码来源:Datenmodell.cpp


示例20: retranslate

void KNMusicPlaylistModel::initialHeader()
{
    //Using retranslate to update the header text.
    retranslate();
    //Set header size hint.
    setHeaderData(0, Qt::Horizontal, QSize(10,23), Qt::SizeHintRole);
    //Set header alignment
    for(int i=0;i<MusicDataCount;i++)
    {
        setHeaderData(i, Qt::Horizontal, Qt::AlignVCenter, Qt::TextAlignmentRole);
    }
    //Set sort flag.
    setHeaderSortFlag();
}
开发者ID:loki1412,项目名称:Mu,代码行数:14,代码来源:knmusicplaylistmodel.cpp



注:本文中的setHeaderData函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ setHeaderHidden函数代码示例发布时间:2022-05-30
下一篇:
C++ setHeader函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap