@Santosh Reddy:
I am a little bit confused with
some_class
* some_function
(QString some_string
)
some_class * some_function(QString some_string)
To copy to clipboard, switch view to plain text mode
in your example.
@Lesilok: The whole code I had in the beginning. Compiler says: "Fehler:C2664: 'MultiReturn::MultiReturn(const MultiReturn &)': converting parameter 1 from 'MultiReturn *' to 'const MultiReturn &' not possible"
MultiReturn read_in
(QString incoming_string
) {
MultiReturn string_collection;
if (incoming_string.isEmpty()) {
string_collection = new MultiReturn("Warning", "Error", "Mind");
}
else {
string_collection = new MultiReturn("Warning1", "Error1", "Mind1");
}
return string_collection; }
MultiReturn read_in(QString incoming_string) {
MultiReturn string_collection;
if (incoming_string.isEmpty()) {
string_collection = new MultiReturn("Warning", "Error", "Mind");
}
else {
string_collection = new MultiReturn("Warning1", "Error1", "Mind1");
}
return string_collection; }
To copy to clipboard, switch view to plain text mode
When I do it like this, it compiles, but crashes instantly (thats what I made from Santosh Reddy's advice):
MultiReturn read_in
(QString incoming_string
) {
MultiReturn *string_collection = 0;
if (incoming_string.isEmpty()) {
string_collection = new MultiReturn("Warning", "Error", "Mind");
}
else {
string_collection = new MultiReturn("Warning1", "Error1", "Mind1");
}
return *string_collection; }
MultiReturn read_in(QString incoming_string) {
MultiReturn *string_collection = 0;
if (incoming_string.isEmpty()) {
string_collection = new MultiReturn("Warning", "Error", "Mind");
}
else {
string_collection = new MultiReturn("Warning1", "Error1", "Mind1");
}
return *string_collection; }
To copy to clipboard, switch view to plain text mode
Bookmarks