vollkorn hat geschrieben:hast du
Ich kann mir, wie upsala schon sagte, nicht vorstellen das es funktioniert, obwohl dein Einwand, das so eine Methode nicht aus spaß da ist, schon berechtigt ist. Aber belehr mich eines besseren...
Na... scheinbar ist es doch zum spass da.... und somit habe ich die erste QT class gefunden die nicht dass macht wass sie sollte ...
Auf linux hat man wenigstens einen /proc/ den man auslesen kann..
Richtig setzen kann ich nur ueber
QNetworkInterface::interfaceFromName(OsInterfacesName);
aber wenn die eths down sind kommt nichts in der liste....
obwohl ...
http://lists.trolltech.com/qt-interest/ ... 569-0.html
http://lists.trolltech.com/qt-interest/ ... 155-0.html
dass gegenteil verspricht....
melde doch ein bug ....
Code: Alles auswählen
void Load_Position( int netpos )
{
const QString OsInterfacesName = net->itemData(netpos).toString();
if (OsInterfacesName.size() < 1) {
return;
}
QNetworkInterface hop = QNetworkInterface::interfaceFromName(OsInterfacesName);
int ddi = hop.flags();
qDebug() << "hop.flags() >>> " << ddi;
QList<QNetworkAddressEntry> allhop = hop.addressEntries();
foreach(QNetworkAddressEntry eth, allhop) {
if (allhop.size() == 1 ) {
/* window os on name --- linux eth0:1 eth0:1 ecc... virtual ip */
actual = eth;
}
wbroad->setText(eth.broadcast().toString());
wmask->setText(eth.netmask().toString());
wip->setText(eth.ip().toString());
}
if ( wip->text().size() > 0 || wmask->text().size() > 0 || hop.isValid() ) {
/* have it */
qDebug() << " valid config && running ";
/* enable button to chance ip */
wset->setEnabled(true);
} else {
wset->setEnabled(false);
}
}
Schade... dann mache es einfach primitiv.... wie upsala meinte....
alle window kommen irgendann ins museum ....

### backup ip config
netsh -c interface dump>c:\today.txt
### put other data... to today.txt
### load ip config
netsh -f c:\today.txt
Of topic....
Die OS Mac ip config ist richtig luxus gegenueber window... mit applescripts
.........................
speack português italiano deutsch english castellà qt