Skip to content
QtWS25 Call for Papers
  • 0 Votes
    2 Posts
    217 Views
    G

    Same here. I didn't see these issues with Qt 6.4.1, but with 6.7+ building for iOS (sim and device) takes around 2 minutes after all the warnings are logged.
    Any progress on this?

  • 0 Votes
    2 Posts
    180 Views
    S

    @Sammasas
    I didn't find a universal way, but with an QJNIObject and objective c it works now. Java with JNiObject:

    package Klingelball; import android.content.Context; import android.content.res.Configuration; import android.util.DisplayMetrics; import android.view.WindowManager; public class AndroidSettings { public static float getFontScale(Context context) { //return getResources().getConfiguration().fontScale; Configuration configuration = context.getResources().getConfiguration(); // Get the font scale from the configuration float fontScale = configuration.fontScale; return fontScale; } }

    It's important that the file is under src/mypackage.

    .cpp file:

    #ifdef Q_OS_ANDROID QJniObject context = QNativeInterface::QAndroidApplication::context(); if(QJniObject::isClassAvailable("Klingelball/AndroidSettings")) { QJniObject androidSettingsJavaObject = QJniObject("Klingelball/AndroidSettings"); fontScale = new float(androidSettingsJavaObject.callStaticMethod<jfloat>("Klingelball/AndroidSettings", "getFontScale", "(Landroid/content/Context;)F", context.object<jobject>())); qDebug() <<"Font scale:" << *fontScale; setup_fontAndroid(*fontScale); } else { qDebug() << "JAVA CLASS UNAVAIABLE!"; fontScale = new float(1); setup_fontAndroid(*fontScale); } #endif

    iOs with objective-c:
    .mm file:

    include "iOSSettings.h" #include <UIKit/UIKit.h> int iOSSettings::getPrefferedFont() { return [UIFont preferredFontForTextStyle:UIFontTextStyleBody].pointSize; }

    .h file:

    class iOSSettings { public: static int getPrefferedFont(); };

    .cpp file:

    #ifdef Q_OS_IOS fontScale = new float(getfontScalefrompointSize(iOSSettings::getPrefferedFont())); setup_fontiOS(iOSSettings::getPrefferedFont()); #endif

    iOS returns the preffered Fontsize, I implemented a function that returns a factor based on the fontsize because I had to scale the Icons too.
    Hope this helps somebody :)

  • 0 Votes
    13 Posts
    576 Views
    Axel SpoerlA

    @astoffregen

    we included this already

    Oh, my bad, I overlooked that. Furthermore, "not installed" points more at deployment being the issue.

    What I don't find explicitly in the CMake file, is main.qml.
    So I guess it is sort of implicitly added as a resource and main.cppknows how to find it.

    => Is a qmldirdirectory in the resource tree?
    Something along the lines of this might help:

    install(FILES ${CMAKE_CURRENT_BINARY_DIR}/qmldir DESTINATION "${INSTALL_DIR}"
  • 0 Votes
    3 Posts
    182 Views
    K

    I just realized that Qt6 is not tested against tvOS specifically and is built against iOS. The latter has wider selection of available frameworks.

    I guess I'll need to manually Qt for tvOS.

  • 0 Votes
    2 Posts
    328 Views
    T

    I must answer my own question. Sometimes I miss the obvious. A Settings.bundle is simply a resource and must be copied to the Resources. Since Apple changed the directory chirarchy in the app bundle, all Resources are files or directories in the root directory. After I realized this, it was simple. Here is a small excerpt of my CMakeLists.txt file:

    set(settings_bundle "Settings.bundle") qt_add_executable(tpanel MANUAL_FINALIZATION ${PROJECT_SOURCES} "${settings_bundle}" ) target_sources(tpanel PRIVATE "${settings_bundle}") set_source_files_properties(${settings_bundle} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)

    The above code assume, that the Settings.bundle is in the root of the distribution. If this is not the case, then the relative path must be defined as part of the variable settings_bundle.

    That's it!

  • 0 Votes
    2 Posts
    328 Views
    T

    I must answer my own question. Sometimes I miss the obvious. A Settings.bundle is simply a resource and must be copied to the Resources. Since Apple changed the directory chirarchy in the app bundle, all Resources are files or directories in the root directory. After I realized this, it was simple. Here is a small excerpt of my CMakeLists.txt file:

    set(settings_bundle "Settings.bundle") qt_add_executable(tpanel MANUAL_FINALIZATION ${PROJECT_SOURCES} "${settings_bundle}" ) target_sources(tpanel PRIVATE "${settings_bundle}") set_source_files_properties(${settings_bundle} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)

    The above code assume, that the Settings.bundle is in the root of the distribution. If this is not the case, then the relative path must be defined as part of the variable settings_bundle.

    That's it!

  • 2 Votes
    8 Posts
    404 Views
    ekkescornerE

    @SGaist did some more tests. removed some lines with errors from .pro and got some more output from qmake2cmake. but only for the easy parts ;-)

    android or ios - specific parts are missed.
    ATM I'm learning from CMakeLists.txt provided by Qt example apps, other projects and documentation.

    what's really missed: official guides for mobile (android and ios) apps (including translations, native code, custom info.plist, Android Manifest, openSSL) from build to deploy and publish to stores using CMake.

    of course I'll blog about my findings in some weeks.

  • 0 Votes
    2 Posts
    350 Views
    H

    Also here is the stacktrace if it helps:

    0 ??? 0x10a1029a8 ??? 1 <translation info unavailable> 0x10c7d5e24 ??? 2 libsystem_pthread.dylib 0x115b91ee6 pthread_kill + 263 3 libsystem_c.dylib 0x114e06e58 abort + 130 4 test5 0x104c96839 qAbort() + 9 (qglobal.cpp:161) 5 test5 0x104c9b6b8 qt_message_fatal(QtMsgType, QMessageLogContext const&, QString const&) + 24 (qlogging.cpp:2048) 6 test5 0x10510d7b6 QMessageLogger::fatal(char const*, ...) const + 246 (qlogging.cpp:934) 7 test5 0x10510d08a qt_assert(char const*, char const*, int) + 74 (qassert.cpp:68) 8 test5 0x1041c7e45 QGles2TextureRenderTarget::create() + 981 (qrhigles2.cpp:5462) 9 test5 0x103580e82 QQuickWidget::createFramebufferObject() + 1890 (qquickwidget.cpp:1137) 10 test5 0x103585ad1 QQuickWidget::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) + 225 (moc_qquickwidget.cpp:295) 11 test5 0x104da0579 void doActivate<false>(QObject*, int, void**) + 2313 (qobject.cpp:4004) 12 test5 0x104d9f039 QMetaObject::activate(QObject*, QMetaObject const*, int, void**) + 121 (qobject.cpp:4052) 13 test5 0x103607465 QQuickWindow::sceneGraphInitialized() + 37 (moc_qquickwindow.cpp:829) 14 test5 0x10360665d QQuickWindow::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) + 109 (moc_qquickwindow.cpp:570) 15 test5 0x104da0579 void doActivate<false>(QObject*, int, void**) + 2313 (qobject.cpp:4004) 16 test5 0x104d9f039 QMetaObject::activate(QObject*, QMetaObject const*, int, void**) + 121 (qobject.cpp:4052) 17 test5 0x1036b52d2 QSGRenderContext::initialized() + 34 (moc_qsgcontext_p.cpp:289) 18 test5 0x1036c7b67 QSGDefaultRenderContext::initialize(QSGRenderContext::InitParams const*) + 295 (qsgdefaultrendercontext.cpp:57) 19 test5 0x1035f1a1a QQuickRenderControl::initialize() + 378 (qquickrendercontrol.cpp:309) 20 test5 0x1035806d3 QQuickWidgetPrivate::initializeWithRhi() + 867 (qquickwidget.cpp:1058) 21 test5 0x1035837aa QQuickWidget::resizeEvent(QResizeEvent*) + 474 (qquickwidget.cpp:1404) 22 test5 0x1038782cb QWidget::event(QEvent*) + 2683 (qwidget.cpp:9076) 23 test5 0x103584fb9 QQuickWidget::event(QEvent*) + 1321 (qquickwidget.cpp:1719) 24 test5 0x1037ea0ba QApplicationPrivate::notify_helper(QObject*, QEvent*) + 458 (qapplication.cpp:3284) 25 test5 0x1037ee456 QApplication::notify(QObject*, QEvent*) + 11974 (qapplication.cpp:3231) 26 test5 0x104d2212a QCoreApplication::notifyInternal2(QObject*, QEvent*) + 282 (qcoreapplication.cpp:1115) 27 test5 0x104d22df3 QCoreApplication::sendEvent(QObject*, QEvent*) + 131 (qcoreapplication.cpp:1533) 28 test5 0x10386f721 QWidgetPrivate::sendPendingMoveAndResizeEvents(bool, bool) + 353 (qwidget.cpp:7944) 29 test5 0x103875ff0 QWidgetPrivate::show_helper() + 64 (qwidget.cpp:7995) 30 test5 0x10387707f QWidgetPrivate::setVisible(bool) + 943 (qwidget.cpp:8344) 31 test5 0x103876cc0 QWidget::setVisible(bool) + 144 (qwidget.cpp:8276) 32 test5 0x10386871e QWidget::showMaximized() + 126 (qwidget.cpp:3057) 33 test5 0x103875e94 QWidget::show() + 100 (qwidget.cpp:7900) 34 test5 0x102e70702 MyOpenGLWidget::mousePressEvent(QMouseEvent*) + 82 (main.cpp:16) 35 test5 0x103877a73 QWidget::event(QEvent*) + 547 (qwidget.cpp:8902) 36 test5 0x1037ac198 QOpenGLWidget::event(QEvent*) + 712 (qopenglwidget.cpp:1698) 37 test5 0x1037ea0ba QApplicationPrivate::notify_helper(QObject*, QEvent*) + 458 (qapplication.cpp:3284) 38 test5 0x1037ec11c QApplication::notify(QObject*, QEvent*) + 2956 (qapplication.cpp:2772) 39 test5 0x104d2212a QCoreApplication::notifyInternal2(QObject*, QEvent*) + 282 (qcoreapplication.cpp:1115) 40 test5 0x104d22e83 QCoreApplication::sendSpontaneousEvent(QObject*, QEvent*) + 131 (qcoreapplication.cpp:1547) 41 test5 0x1037eabd0 QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool, bool) + 1216 (qapplication.cpp:2356) 42 test5 0x1038a44a5 QWidgetWindow::handleMouseEvent(QMouseEvent*) + 4485 (qwidgetwindow.cpp:623) 43 test5 0x1038a2849 QWidgetWindow::event(QEvent*) + 361 (qwidgetwindow.cpp:241) 44 test5 0x1037ea0ba QApplicationPrivate::notify_helper(QObject*, QEvent*) + 458 (qapplication.cpp:3284) 45 test5 0x1037ee474 QApplication::notify(QObject*, QEvent*) + 12004 (qapplication.cpp:3235) 46 test5 0x104d2212a QCoreApplication::notifyInternal2(QObject*, QEvent*) + 282 (qcoreapplication.cpp:1115) 47 test5 0x104d22e83 QCoreApplication::sendSpontaneousEvent(QObject*, QEvent*) + 131 (qcoreapplication.cpp:1547) 48 test5 0x103e0f2b0 QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) + 2384 (qguiapplication.cpp:2277) 49 test5 0x103e0ec51 QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) + 753 (qguiapplication.cpp:2187) 50 test5 0x103e110b4 QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::TouchEvent*) + 5412 (qguiapplication.cpp:3081) 51 test5 0x103e0e2de QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) + 110 (qguiapplication.cpp:2035) 52 test5 0x103e74a5e QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 190 (qwindowsysteminterface.cpp:1094) 53 test5 0x102e7af11 QIOSEventDispatcher::processPostedEvents() + 545 (qioseventdispatcher.mm:443) 54 test5 0x104f9bf3b RunLoopSource<QEventDispatcherCoreFoundation>::process(void*) + 107 (qeventdispatcher_cf_p.h:111) 55 CoreFoundation 0x113e56b8f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17 56 CoreFoundation 0x113e56ad1 __CFRunLoopDoSource0 + 157 57 CoreFoundation 0x113e5632b __CFRunLoopDoSources0 + 311 58 CoreFoundation 0x113e509ba __CFRunLoopRun + 889 59 CoreFoundation 0x113e50264 CFRunLoopRunSpecific + 560 60 GraphicsServices 0x1225e324e GSEventRunModal + 139 61 UIKitCore 0x13abc47bf -[UIApplication _run] + 994 62 UIKitCore 0x13abc95de UIApplicationMain + 123 63 test5 0x102e79161 qt_main_wrapper + 705 (qioseventdispatcher.mm:206) 64 dyld_sim 0x112701384 start_sim + 10 65 dyld 0x20a3db41f start + 1903
  • 0 Votes
    1 Posts
    214 Views
    No one has replied
  • 0 Votes
    2 Posts
    154 Views
    I

    @Paul-Colby if you have any insights, can you please help me with this

  • 0 Votes
    1 Posts
    188 Views
    No one has replied
  • 0 Votes
    6 Posts
    721 Views
    JonBJ

    @inkfil
    At Qt6 all(?) enumerated types have been moved from from a "general, high-level" class/namespace --- like Qt::AlignLeft or QVideoFrame::WriteOnly --- down into a more "specific, low-level" class/namespace --- like Qt::AlignmentFlag::AlignLeft or QVideoFrame::MapMode::WriteOnly. You need to change all your code accordingly. There isn't a definitive list, you just have to find out and do it as necessary.

    In https://stackoverflow.com/questions/72086632/migrating-to-qt6-pyqt6-what-are-all-the-deprecated-short-form-names-in-qt5 and/or https://pypi.org/project/PyQtEnumConverter/ somebody wrote some kind of converter for Python/PyQt6 for this, maybe it will give you inspiration to understand what has changed.

  • 0 Votes
    1 Posts
    212 Views
    No one has replied
  • 0 Votes
    1 Posts
    247 Views
    No one has replied
  • 0 Votes
    1 Posts
    233 Views
    No one has replied
  • 0 Votes
    2 Posts
    281 Views
    D

    @Dmitriano It is probably not a trivial question because, as far as I see, setting window width and height to Screen.width and Screen.height is not a solution, because there can be task bar and something else (I do not know what can it be on iOS) that partially occupies the screen.

  • 0 Votes
    6 Posts
    498 Views
    SGaistS

    Great ! Thank you very much.