/* Compose the tree to pick the item from adressess */
void Shop_Main::Compose_Addo()
{
/* addo_tree->clear(); QTreeView QMouseEvent #include <QTreeView><QTreeWidget> */
AddoLoad.clear();
bool attrib;
current_addo_item->setText("");
addo_tree->setMouseTracking(true);
addo_tree->clear();
QStringList countrys
= Query_List_Unique
(QString( "SELECT DISTINCT land_code FROM %1 order by land_code" ).
arg( TABLE_ADDO
));
QStringListIterator i(countrys);
while (i.hasNext()) {
QString coustr
= i.
next().
toLocal8Bit().
constData();
cou->setText(0,coustr);
cou->setToolTip (0,tr("Open to Browse."));
addo_tree->expandItem(cou);
QStringList paese
= Query_List_Unique
(QString( "SELECT DISTINCT ort FROM %1 WHERE land_code='%2' order by ort" ).
arg( TABLE_ADDO , coustr
));
QStringListIterator o(paese);
while (o.hasNext()) {
QString pas
= o.
next().
toLocal8Bit().
constData();
paeort->setText(0,pas);
paeort->setToolTip (0,tr("Open to Browse."));
paeort
->setIcon
(0,
QIcon(QString::fromUtf8(":/img/img/folder.png")));
resultMap relist
= Query_Qmap_Report
(QString( "SELECT firma, name, id FROM %1 WHERE ort='%2' and land_code='%3' order by name" ).
arg( TABLE_ADDO , pas , coustr
));
resultMap::Iterator it;
for ( it = relist.begin(); it != relist.end(); ++it ) {
int dbid;
QString na
= roxe.
at(0).
toLocal8Bit().
constData();
QString nb
= roxe.
at(1).
toLocal8Bit().
constData();
QString inte
= roxe.
at(2).
toLocal8Bit().
constData();
if (is_numeric(inte)) {
bool ok;
dbid = inte.toInt(&ok);
} else {
dbid = 0;
}
int clientid = CLIENT_BASE + dbid;
attrib = CheckAttributes(dbid);
if (attrib) {
daten
=QString("[%3] %1 %2 -si" ).
arg(na , nb ,
QString::number(clientid
) );
} else {
daten
=QString("[%3] %1 %2 -no" ).
arg(na , nb ,
QString::number(clientid
) );
}
AddoLoad.append(daten);
sigle->setText(0,daten);
sigle
->setIcon
(0,
QIcon(QString::fromUtf8(":/img/img/ooo-calc.png")));
connect(addo_tree,
SIGNAL(itemClicked
(QTreeWidgetItem*,
int)),
this,
SLOT(Safari
()));
}
}
}
}
/* this is a slot to get value ... */
/* Discovery actived item to grab on db */
void Shop_Main::Safari()
{
int xcol = addo_tree->currentColumn();
QString findertree
= addo_tree
->currentItem
()->text
(xcol
);
int total = AddoLoad.size();
if (total > 0) {
QStringListIterator i(AddoLoad);
while (i.hasNext()) {
QString itemtext
= i.
next().
toLocal8Bit().
constData();
if (itemtext == findertree) {
current_addo_item->setText(itemtext);
}
}
}
}
/* Compose the tree to pick the item from adressess */
void Shop_Main::Compose_Addo()
{
/* addo_tree->clear(); QTreeView QMouseEvent #include <QTreeView><QTreeWidget> */
AddoLoad.clear();
bool attrib;
QString daten;
current_addo_item->setText("");
addo_tree->setMouseTracking(true);
addo_tree->clear();
QStringList countrys = Query_List_Unique(QString( "SELECT DISTINCT land_code FROM %1 order by land_code" ).arg( TABLE_ADDO ));
QStringListIterator i(countrys);
while (i.hasNext()) {
QString coustr = i.next().toLocal8Bit().constData();
QTreeWidgetItem *cou = new QTreeWidgetItem(addo_tree);
cou->setText(0,coustr);
cou->setToolTip (0,tr("Open to Browse."));
addo_tree->expandItem(cou);
QStringList paese = Query_List_Unique(QString( "SELECT DISTINCT ort FROM %1 WHERE land_code='%2' order by ort" ).arg( TABLE_ADDO , coustr));
QStringListIterator o(paese);
while (o.hasNext()) {
QString pas = o.next().toLocal8Bit().constData();
QTreeWidgetItem *paeort = new QTreeWidgetItem(cou);
paeort->setText(0,pas);
paeort->setToolTip (0,tr("Open to Browse."));
paeort->setIcon(0, QIcon(QString::fromUtf8(":/img/img/folder.png")));
resultMap relist = Query_Qmap_Report(QString( "SELECT firma, name, id FROM %1 WHERE ort='%2' and land_code='%3' order by name" ).arg( TABLE_ADDO , pas , coustr));
resultMap::Iterator it;
for ( it = relist.begin(); it != relist.end(); ++it ) {
QStringList roxe = it.value();
int dbid;
QString na = roxe.at(0).toLocal8Bit().constData();
QString nb = roxe.at(1).toLocal8Bit().constData();
QString inte = roxe.at(2).toLocal8Bit().constData();
if (is_numeric(inte)) {
bool ok;
dbid = inte.toInt(&ok);
} else {
dbid = 0;
}
int clientid = CLIENT_BASE + dbid;
attrib = CheckAttributes(dbid);
if (attrib) {
daten =QString("[%3] %1 %2 -si" ).arg(na , nb , QString::number(clientid) );
} else {
daten =QString("[%3] %1 %2 -no" ).arg(na , nb , QString::number(clientid) );
}
QTreeWidgetItem *sigle = new QTreeWidgetItem(paeort);
AddoLoad.append(daten);
sigle->setText(0,daten);
sigle->setIcon(0,QIcon(QString::fromUtf8(":/img/img/ooo-calc.png")));
connect(addo_tree, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(Safari()));
QApplication::processEvents();
}
}
}
}
/* this is a slot to get value ... */
/* Discovery actived item to grab on db */
void Shop_Main::Safari()
{
int xcol = addo_tree->currentColumn();
QString findertree = addo_tree->currentItem()->text(xcol);
int total = AddoLoad.size();
if (total > 0) {
QStringListIterator i(AddoLoad);
while (i.hasNext()) {
QString itemtext = i.next().toLocal8Bit().constData();
if (itemtext == findertree) {
current_addo_item->setText(itemtext);
}
}
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks