I have a question about using the QlistWidget Function where to use it to check if it is listed before and if not it should written into the listwdget.
I have prepared some code but it doesnt work properly. Can someone look and correct if possible ?
Thanks in advance,
The part of the code (also included as txt file)
-----------------------------------------------------------------------------
Code:
//der Slot für das Laden der Seite
void MainWindow::on_webView_loadFinished(bool ok)
{
int n;
//für die HistoryListe
QWebHistory *meineHistory = ui->webView->history();
QListWidget *meineListe = new QListWidget(this);
n=ui->listWidget->count();
//war das Laden erfolgreich?
if (ok)
{
{
if ((ui->webView->url().toString()).isEmpty()==false)
{
for (int i=0; i<= n;i++)
// Prüfen ob die geladene Seite schon vorhanden ist
ui->listWidget->findItems(ui->webView->url().toString(),Qt::MatchFixedString);
// wenn die Seite noch nicht vorhanden ist
if (Qt::MatchFixedString ==8)
// die URL in das Listenfeld schreiben
ui->listWidget->addItem(ui->webView->url().toString());
}
else
{
//und auch in das Eingabefeld
adressFeld->setText(ui->webView->url().toString());
//den Titel setzen
this->setWindowTitle("Minibrowser - " + ui->webView->title());
if (meineHistory->canGoBack())
ui->action_R_ckw_rts->setEnabled(true);
else
ui->action_R_ckw_rts->setEnabled(false);
if (meineHistory->canGoForward())
ui->action_Vorw_rts->setEnabled(true);
else
ui->action_Vorw_rts->setEnabled(false);
}
}
}
//die Fortschrittsanzeige ausblenden
fortschrittBalken->setVisible(false);
//den Text ändern
fortschrittLabel->setText("Seite geladen");
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.