playing around.
This commit is contained in:
60
src/main.cpp
60
src/main.cpp
@@ -211,29 +211,36 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
int main(int argc, char *argv[])
|
class Interface
|
||||||
{
|
{
|
||||||
|
|
||||||
QApplication app(argc, argv);
|
virtual int moo() = 0;
|
||||||
|
|
||||||
// hat am wenigsten darstellungfehler (alternative: fusion)
|
|
||||||
QQuickStyle::setStyle("Imagine");
|
|
||||||
|
|
||||||
|
|
||||||
XQMainWindow window;
|
};
|
||||||
window.show();
|
|
||||||
|
|
||||||
return app.exec();
|
|
||||||
|
|
||||||
|
class Aspect
|
||||||
|
{
|
||||||
|
|
||||||
|
virtual int moo()
|
||||||
|
{
|
||||||
|
qDebug() << " --- Aspect moo";
|
||||||
|
return 42;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class DoWork : public Interface, public Aspect
|
||||||
|
{
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int firz(int argc, char *argv[])
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
|
||||||
{
|
{
|
||||||
QApplication app(argc, argv);
|
QApplication app(argc, argv);
|
||||||
|
|
||||||
@@ -241,8 +248,10 @@ int main(int argc, char *argv[])
|
|||||||
QQuickStyle::setStyle("Imagine");
|
QQuickStyle::setStyle("Imagine");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
XQMainWindow window;
|
XQMainWindow window;
|
||||||
|
|
||||||
|
|
||||||
// 1. Baum erstellen
|
// 1. Baum erstellen
|
||||||
// Der Benutzer erstellt den Wurzelknoten direkt.
|
// Der Benutzer erstellt den Wurzelknoten direkt.
|
||||||
Tree<std::string> root("Root");
|
Tree<std::string> root("Root");
|
||||||
@@ -300,13 +309,16 @@ int main(int argc, char *argv[])
|
|||||||
if (found_it != root.cend()) {
|
if (found_it != root.cend()) {
|
||||||
// *found_it gibt den Wert (std::string) zurück
|
// *found_it gibt den Wert (std::string) zurück
|
||||||
std::cout << "Gefunden: " << *found_it << std::endl;
|
std::cout << "Gefunden: " << *found_it << std::endl;
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
std::cout << "Nicht gefunden." << std::endl;
|
std::cout << "Nicht gefunden." << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 4. Verwendung mit <numeric> (z.B. std::count_if)
|
// 4. Verwendung mit <numeric> (z.B. std::count_if)
|
||||||
std::cout << "\n--- STL std::count_if ---" << std::endl;
|
std::cout << "\n--- STL std::count_if ---" << std::endl;
|
||||||
int count = std::count_if(root.cbegin(), root.cend(), [](const std::string& val) {
|
int count = std::count_if(root.cbegin(), root.cend(), [](const std::string& val)
|
||||||
|
{
|
||||||
return val.length() > 5; // Zähle alle Strings mit mehr als 5 Zeichen
|
return val.length() > 5; // Zähle alle Strings mit mehr als 5 Zeichen
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -315,3 +327,21 @@ int main(int argc, char *argv[])
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
|
||||||
|
QApplication app(argc, argv);
|
||||||
|
|
||||||
|
// hat am wenigsten darstellungfehler (alternative: fusion)
|
||||||
|
QQuickStyle::setStyle("Imagine");
|
||||||
|
|
||||||
|
|
||||||
|
XQMainWindow window;
|
||||||
|
window.show();
|
||||||
|
|
||||||
|
return app.exec();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user