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:
parent
7626736a5f
commit
eed17b3634
@ -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;
|
||||||
|
@ -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");
|
||||||
|
@ -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()) {
|
||||||
|
@ -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();
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
@ -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;
|
||||||
|
@ -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())
|
||||||
|
@ -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())
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
@ -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()) {
|
||||||
|
@ -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
|
||||||
|
@ -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;
|
||||||
|
@ -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();
|
||||||
|
@ -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);
|
||||||
|
@ -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"));
|
||||||
|
@ -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);
|
||||||
|
|
||||||
|
@ -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);
|
||||||
|
@ -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;
|
||||||
|
@ -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();
|
||||||
|
@ -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();
|
||||||
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
|
||||||
|
@ -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();
|
||||||
|
@ -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"));
|
||||||
|
@ -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");
|
||||||
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -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();
|
||||||
|
@ -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");
|
||||||
|
@ -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);
|
||||||
|
@ -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();
|
||||||
|
@ -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");
|
||||||
|
@ -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;
|
||||||
|
@ -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();
|
||||||
|
@ -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");
|
||||||
|
@ -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");
|
||||||
|
@ -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();
|
||||||
|
@ -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();
|
||||||
|
@ -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();
|
||||||
|
@ -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;
|
||||||
|
@ -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);
|
||||||
|
@ -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();
|
||||||
|
@ -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();
|
||||||
|
@ -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;
|
||||||
|
@ -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");
|
||||||
|
@ -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");
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user