Examples: Remove unnecessary Q_INIT_RESOURCE calls

Explicit calls to Q_INIT_RESOURCE are only needed for
resources embedded in static libraries. See also

  https://doc.qt.io/qt-6/resources.html#explicit-loading-and-unloading-of-embedded-resources

Pick-to: 6.5 6.6
Change-Id: I06a24d1c04369eedc78ca60a6ca02ce33907d9e7
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
Kai Köhne 2023-05-22 14:19:39 +02:00
parent 7626736a5f
commit eed17b3634
46 changed files with 0 additions and 90 deletions

View File

@ -342,8 +342,6 @@ private:
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
Q_INIT_RESOURCE(flightinfo);
QApplication app(argc, argv); QApplication app(argc, argv);
FlightInfo w; FlightInfo w;

View File

@ -7,7 +7,6 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
QApplication app(argc, argv); QApplication app(argc, argv);
Q_INIT_RESOURCE(styleexample);
app.setApplicationName("style"); app.setApplicationName("style");
app.setOrganizationName("QtProject"); app.setOrganizationName("QtProject");

View File

@ -11,8 +11,6 @@ QT_REQUIRE_CONFIG(ssl);
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
Q_INIT_RESOURCE(securesocketclient);
QApplication app(argc, argv); QApplication app(argc, argv);
if (!QSslSocket::supportsSsl()) { if (!QSslSocket::supportsSsl()) {

View File

@ -9,8 +9,6 @@ int main(int argc, char *argv[])
{ {
QApplication app(argc, argv); QApplication app(argc, argv);
Q_INIT_RESOURCE(icons);
MainWindow window; MainWindow window;
window.show(); window.show();

View File

@ -8,8 +8,6 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
Q_INIT_RESOURCE(textures);
QApplication app(argc, argv); QApplication app(argc, argv);
QSurfaceFormat format; QSurfaceFormat format;

View File

@ -7,8 +7,6 @@
int main(int argc, char * argv[]) int main(int argc, char * argv[])
{ {
Q_INIT_RESOURCE(books);
QApplication app(argc, argv); QApplication app(argc, argv);
BookWindow win; BookWindow win;

View File

@ -11,8 +11,6 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
Q_INIT_RESOURCE(drilldown);
QApplication app(argc, argv); QApplication app(argc, argv);
if (!createConnection()) if (!createConnection())

View File

@ -11,8 +11,6 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
Q_INIT_RESOURCE(masterdetail);
QApplication app(argc, argv); QApplication app(argc, argv);
if (!createConnection()) if (!createConnection())

View File

@ -6,7 +6,6 @@
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
Q_INIT_RESOURCE(easing);
QApplication app(argc, argv); QApplication app(argc, argv);
Window w; Window w;

View File

@ -10,8 +10,6 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
Q_INIT_RESOURCE(systray);
QApplication app(argc, argv); QApplication app(argc, argv);
if (!QSystemTrayIcon::isSystemTrayAvailable()) { if (!QSystemTrayIcon::isSystemTrayAvailable()) {

View File

@ -10,8 +10,6 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
Q_INIT_RESOURCE(licensewizard);
QApplication app(argc, argv); QApplication app(argc, argv);
#ifndef QT_NO_TRANSLATION #ifndef QT_NO_TRANSLATION

View File

@ -8,8 +8,6 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
Q_INIT_RESOURCE(draggableicons);
QApplication app(argc, argv); QApplication app(argc, argv);
QWidget mainWidget; QWidget mainWidget;

View File

@ -7,8 +7,6 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
Q_INIT_RESOURCE(draggabletext);
QApplication app(argc, argv); QApplication app(argc, argv);
DragWidget window; DragWidget window;
window.show(); window.show();

View File

@ -7,8 +7,6 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
Q_INIT_RESOURCE(fridgemagnets);
QApplication app(argc, argv); QApplication app(argc, argv);
#ifdef QT_KEYPAD_NAVIGATION #ifdef QT_KEYPAD_NAVIGATION
QApplication::setNavigationMode(Qt::NavigationModeCursorAuto); QApplication::setNavigationMode(Qt::NavigationModeCursorAuto);

View File

@ -7,8 +7,6 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
Q_INIT_RESOURCE(puzzle);
QApplication app(argc, argv); QApplication app(argc, argv);
MainWindow window; MainWindow window;
window.loadImage(QStringLiteral(":/images/example.jpg")); window.loadImage(QStringLiteral(":/images/example.jpg"));

View File

@ -7,8 +7,6 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
Q_INIT_RESOURCE(images);
QApplication app(argc, argv); QApplication app(argc, argv);
app.setAttribute(Qt::AA_DontCreateNativeWidgetSiblings); app.setAttribute(Qt::AA_DontCreateNativeWidgetSiblings);

View File

@ -7,8 +7,6 @@
int main(int argv, char *args[]) int main(int argv, char *args[])
{ {
Q_INIT_RESOURCE(diagramscene);
QApplication app(argv, args); QApplication app(argv, args);
MainWindow mainWindow; MainWindow mainWindow;
mainWindow.setGeometry(100, 100, 800, 500); mainWindow.setGeometry(100, 100, 800, 500);

View File

@ -10,7 +10,6 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
Q_INIT_RESOURCE(embeddeddialogs);
QApplication app(argc, argv); QApplication app(argc, argv);
QGraphicsScene scene; QGraphicsScene scene;

View File

@ -7,8 +7,6 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
Q_INIT_RESOURCE(chart);
QApplication app(argc, argv); QApplication app(argc, argv);
MainWindow window; MainWindow window;
window.show(); window.show();

View File

@ -7,8 +7,6 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
Q_INIT_RESOURCE(editabletreemodel);
QApplication app(argc, argv); QApplication app(argc, argv);
MainWindow window; MainWindow window;
window.show(); window.show();

View File

@ -10,8 +10,6 @@
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
Q_INIT_RESOURCE(grades);
QApplication app( argc, argv ); QApplication app( argc, argv );
QStandardItemModel *model=new QStandardItemModel(); QStandardItemModel *model=new QStandardItemModel();
@ -46,4 +44,3 @@ int main(int argc, char* argv[])
tableView->show(); tableView->show();
return app.exec(); return app.exec();
} }

View File

@ -12,8 +12,6 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
Q_INIT_RESOURCE(interview);
QApplication app(argc, argv); QApplication app(argc, argv);
QSplitter page; QSplitter page;

View File

@ -7,8 +7,6 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
Q_INIT_RESOURCE(images);
QApplication app(argc, argv); QApplication app(argc, argv);
MainWindow window; MainWindow window;
window.show(); window.show();

View File

@ -7,8 +7,6 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
Q_INIT_RESOURCE(puzzle);
QApplication app(argc, argv); QApplication app(argc, argv);
MainWindow window; MainWindow window;
window.loadImage(QStringLiteral(":/images/example.jpg")); window.loadImage(QStringLiteral(":/images/example.jpg"));

View File

@ -9,8 +9,6 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
Q_INIT_RESOURCE(simpletreemodel);
QApplication app(argc, argv); QApplication app(argc, argv);
QFile file(":/default.txt"); QFile file(":/default.txt");

View File

@ -8,8 +8,6 @@
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
Q_INIT_RESOURCE(spreadsheet);
QApplication app(argc, argv); QApplication app(argc, argv);
SpreadSheet sheet(10, 6); SpreadSheet sheet(10, 6);
sheet.setWindowIcon(QPixmap(":/images/interview.png")); sheet.setWindowIcon(QPixmap(":/images/interview.png"));
@ -17,5 +15,3 @@ int main(int argc, char **argv)
sheet.layout()->setSizeConstraint(QLayout::SetFixedSize); sheet.layout()->setSizeConstraint(QLayout::SetFixedSize);
return app.exec(); return app.exec();
} }

View File

@ -8,7 +8,6 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
QApplication app(argc, argv); QApplication app(argc, argv);
Q_INIT_RESOURCE(dockwidgets);
MainWindow mainWin; MainWindow mainWin;
mainWin.show(); mainWin.show();
return app.exec(); return app.exec();

View File

@ -9,8 +9,6 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
Q_INIT_RESOURCE(mdi);
QApplication app(argc, argv); QApplication app(argc, argv);
QCoreApplication::setApplicationName("MDI Example"); QCoreApplication::setApplicationName("MDI Example");
QCoreApplication::setOrganizationName("QtProject"); QCoreApplication::setOrganizationName("QtProject");

View File

@ -7,8 +7,6 @@
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
Q_INIT_RESOURCE(affine);
QApplication app(argc, argv); QApplication app(argc, argv);
XFormWidget xformWidget(nullptr); XFormWidget xformWidget(nullptr);

View File

@ -7,8 +7,6 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
Q_INIT_RESOURCE(basicdrawing);
QApplication app(argc, argv); QApplication app(argc, argv);
Window window; Window window;
window.show(); window.show();

View File

@ -7,8 +7,6 @@
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
Q_INIT_RESOURCE(deform);
QApplication app(argc, argv); QApplication app(argc, argv);
bool smallScreen = QApplication::arguments().contains("-small-screen"); bool smallScreen = QApplication::arguments().contains("-small-screen");

View File

@ -7,8 +7,6 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
Q_INIT_RESOURCE(gradients);
QApplication app(argc, argv); QApplication app(argc, argv);
GradientWidget gradientWidget; GradientWidget gradientWidget;

View File

@ -8,8 +8,6 @@
//! [0] //! [0]
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
Q_INIT_RESOURCE(imagecomposition);
QApplication app(argc, argv); QApplication app(argc, argv);
ImageComposer composer; ImageComposer composer;
composer.show(); composer.show();

View File

@ -7,8 +7,6 @@
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
Q_INIT_RESOURCE(pathstroke);
QApplication app(argc, argv); QApplication app(argc, argv);
bool smallScreen = QApplication::arguments().contains("-small-screen"); bool smallScreen = QApplication::arguments().contains("-small-screen");

View File

@ -10,8 +10,6 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
Q_INIT_RESOURCE(textedit);
QApplication a(argc, argv); QApplication a(argc, argv);
QCoreApplication::setOrganizationName("QtProject"); QCoreApplication::setOrganizationName("QtProject");
QCoreApplication::setApplicationName("Rich Text"); QCoreApplication::setApplicationName("Rich Text");

View File

@ -7,8 +7,6 @@
//! [0] //! [0]
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
Q_INIT_RESOURCE(completer);
QApplication app(argc, argv); QApplication app(argc, argv);
MainWindow window; MainWindow window;
window.show(); window.show();

View File

@ -7,8 +7,6 @@
//! [0] //! [0]
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
Q_INIT_RESOURCE(customcompleter);
QApplication app(argc, argv); QApplication app(argc, argv);
MainWindow window; MainWindow window;
window.show(); window.show();

View File

@ -7,8 +7,6 @@
//! [0] //! [0]
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
Q_INIT_RESOURCE(treemodelcompleter);
QApplication app(argc, argv); QApplication app(argc, argv);
MainWindow window; MainWindow window;
window.show(); window.show();

View File

@ -8,8 +8,6 @@
//! [0] //! [0]
int main(int argv, char *args[]) int main(int argv, char *args[])
{ {
Q_INIT_RESOURCE(undoframework);
QApplication app(argv, args); QApplication app(argv, args);
MainWindow mainWindow; MainWindow mainWindow;

View File

@ -8,8 +8,6 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
Q_INIT_RESOURCE(styles);
QApplication::setStyle(new NorwegianWoodStyle); QApplication::setStyle(new NorwegianWoodStyle);
QApplication app(argc, argv); QApplication app(argc, argv);

View File

@ -7,8 +7,6 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
Q_INIT_RESOURCE(stylesheet);
QApplication app(argc, argv); QApplication app(argc, argv);
MainWindow window; MainWindow window;
window.show(); window.show();

View File

@ -7,8 +7,6 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
Q_INIT_RESOURCE(tooltips);
QApplication app(argc, argv); QApplication app(argc, argv);
SortingBox sortingBox; SortingBox sortingBox;
sortingBox.show(); sortingBox.show();

View File

@ -7,8 +7,6 @@
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
Q_INIT_RESOURCE(validators);
QApplication app(argc, argv); QApplication app(argc, argv);
ValidatorWidget w; ValidatorWidget w;

View File

@ -11,7 +11,6 @@
int main( int argc, char ** argv ) int main( int argc, char ** argv )
{ {
Q_INIT_RESOURCE(texture);
QApplication a( argc, argv ); QApplication a( argc, argv );
QCoreApplication::setApplicationName("Qt QOpenGLWidget Example"); QCoreApplication::setApplicationName("Qt QOpenGLWidget Example");

View File

@ -9,8 +9,6 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
Q_INIT_RESOURCE(application);
QApplication app(argc, argv); QApplication app(argc, argv);
QCoreApplication::setOrganizationName("QtProject"); QCoreApplication::setOrganizationName("QtProject");
QCoreApplication::setApplicationName("Application Example"); QCoreApplication::setApplicationName("Application Example");

View File

@ -10,8 +10,6 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
Q_INIT_RESOURCE(classwizard);
QApplication app(argc, argv); QApplication app(argc, argv);
#ifndef QT_NO_TRANSLATION #ifndef QT_NO_TRANSLATION