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)
{
Q_INIT_RESOURCE(flightinfo);
QApplication app(argc, argv);
FlightInfo w;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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