QWebKit, QDataStream, QList
Hallo I have 2 problems:
1. I do WebBrowser and when I set Application name
Code:
a.setApplicationName("MyBrowser");
Window w;
or
now signal iconChanged() never emit but when i don't set Application name all work good
2. I take all history items to QList<QAction *> history;
save function:
Code:
QFile historyFile
("/History.bin");
{
return;
}
out << allHistoryAction;
historyFile.flush();
historyFile.close();
all work but in load:
Code:
QFile historyFile
("/History.bin");
{
return;
}
in >> allHistoryAction;
historyFile.close();
this don't work error:
Quote:
error: no match for 'operator>>' in 's >> t'
Re: QWebKit, QDataStream, QList
Please I need it. The most important is second question i can't save history
Re: QWebKit, QDataStream, QList
The answer is in the docs: link
Re: QWebKit, QDataStream, QList
??? i don' understand I use QDatastream operator>> but i have error if i do something bad pls post me some code
Re: QWebKit, QDataStream, QList
From the linked page:
Quote:
This function requires the value type to implement operator>>()
QAction does not have operator>>() or operator()<< implemented so you have to implement them.
Something like the following:
Code:
outputStream << act->text() << act->shortcut(); // any properties you want to store
return outputStream;
}
inputStream >> text >> seq;
action->setText(text);
action->setShortcut(seq);
return inputStream;
}
Re: QWebKit, QDataStream, QList
ok thanks but i don't know why operator << work and operator >> not
Re: QWebKit, QDataStream, QList
and one else question i don't know how save connect or how connect all actions in list again