Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. about how to try to new application in code go on

about how to try to new application in code go on

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 2 Posters 762 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    YouHok
    wrote on last edited by
    #1

    new application

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      What do you want to ask us?

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      0
      • Y Offline
        Y Offline
        YouHok
        wrote on last edited by
        #3

        I have qustion, than ,when I try use qt5.11.3,
        step1:I new application A
        step2:delete this aplication A
        step3:new application B,
        in step3, is fail I try to new application in second time segmentation fault
        How I close this question
        my core is
        #include "mainwindow.h"
        #include <QApplication>
        int main(int argc, char *argv[])
        {
        QApplication *a;
        QApplication *b;
        a = new QApplication(argc, argv);
        delete a;
        a = nullptr;
        b = new QApplication(argc, argv);
        delete b;
        b = nullptr;
        return 0;
        }

        1 Reply Last reply
        0
        • Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          You must not create a second Q(Core)Application. It's nonsense.

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          1 Reply Last reply
          2
          • Y Offline
            Y Offline
            YouHok
            wrote on last edited by
            #5

            but is qt5.9.1 the core is ok ,
            why I try to create a second Q(Core)Application,
            is that , i packup qt in so , like mytest.so
            when,I load mytest,so , the so try new application
            when I unload mytest.so the so delete application
            the process, not sure,load and unload mytest.so,times

            1 Reply Last reply
            0
            • Christian EhrlicherC Offline
              Christian EhrlicherC Offline
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Apart from the really strange idea on re-creating a Q(Core)Application for no reason your code works fine for me with Qt5.15. Use a debugger and see where exactly it crashes.

              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
              Visit the Qt Academy at https://academy.qt.io/catalog

              1 Reply Last reply
              0
              • Y Offline
                Y Offline
                YouHok
                wrote on last edited by
                #7

                I try debug core, i see when I new qapplication ,i see it new two thread, one is for xdisplay , two is for qdbus,(i guess) when delete this qapplication , one thread is die, another one is still online ,
                and then , try to if (qApp ==null) to judge application ,is already die, is true ,qapp,is null
                and then ,i try to recreate application , segmentation fault, like this,
                *

                • Thread 1 "123" received signal SIGSEGV, Segmentation fault.
                  0x0000fffff359ddec in deepin_platform_plugin::DHighDpi::logicalDpi(QXcbScreen*) ()
                  from /usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libdxcb.so
                  (gdb) bt
                  #0 0x0000fffff359ddec in deepin_platform_plugin::DHighDpi::logicalDpi(QXcbScreen*) ()
                  at /usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libdxcb.so
                  #1 0x0000fffff359d32c in deepin_platform_plugin::DHighDpi::pixelDensity(QXcbScreen*) ()
                  at /usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libdxcb.so
                  #2 0x0000fffff751aecc in QHighDpiScaling::screenSubfactor(QPlatformScreen const*) () at /lib/aarch64-linux-gnu/libQt5Gui.so.5
                  #3 0x0000fffff751b6ac in QHighDpiScaling::factor(QPlatformScreen const*) () at /lib/aarch64-linux-gnu/libQt5Gui.so.5
                  #4 0x0000fffff74d00d8 in QPlatformScreen::deviceIndependentGeometry() const () at /lib/aarch64-linux-gnu/libQt5Gui.so.5
                  #5 0x0000fffff750cd4c in () at /lib/aarch64-linux-gnu/libQt5Gui.so.5
                  #6 0x0000fffff74cefd0 in QPlatformIntegration::screenAdded(QPlatformScreen*, bool) () at /lib/aarch64-linux-gnu/libQt5Gui.so.5
                  #7 0x0000fffff34047a4 in QXcbConnection::initializeScreens() () at /lib/aarch64-linux-gnu/libQt5XcbQpa.so.5
                  #8 0x0000fffff3405164 in QXcbConnection::QXcbConnection(QXcbNativeInterface*, bool, unsigned int, char const*) ()
                  at /lib/aarch64-linux-gnu/libQt5XcbQpa.so.5
                  #9 0x0000fffff34093b8 in QXcbIntegration::QXcbIntegration(QStringList const&, int&, char**) ()
                  at /lib/aarch64-linux-gnu/libQt5XcbQpa.so.5
                  #10 0x0000fffff3596974 in deepin_platform_plugin::DPlatformIntegration::DPlatformIntegration(QStringList const&, int&, char**) ()
                  at /usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libdxcb.so
                  #11 0x0000fffff3595f4c in DPlatformIntegrationPlugin::create(QString const&, QStringList const&, int&, char**) ()
                  at /usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libdxcb.so
                  #12 0x0000fffff74d125c in QPlatformIntegrationFactory::create(QString const&, QStringList const&, int&, char**, QString const&) ()
                  at /lib/aarch64-linux-gnu/libQt5Gui.so.5
                  #13 0x0000fffff74df7c8 in QGuiApplicationPrivate::createPlatformIntegration() () at /lib/aarch64-linux-gnu/libQt5Gui.so.5
                  #14 0x0000fffff74e0658 in QGuiApplicationPrivate::createEventDispatcher() () at /lib/aarch64-linux-gnu/libQt5Gui.so.5
                  #15 0x0000fffff707d6ec in QCoreApplicationPrivate::init() () at /lib/aarch64-linux-gnu/libQt5Core.so.5
                  #16 0x0000fffff74e1898 in QGuiApplicationPrivate::init() () at /lib/aarch64-linux-gnu/libQt5Gui.so.5
                  #17 0x0000fffff7ab554c in QApplicationPrivate::init() () at /lib/aarch64-linux-gnu/libQt5Widgets.so.5
                  #18 0x0000000000402ba4 in main(int, char**) (argc=1, argv=0xffffffffdc98) at ../123/main.cpp:10
                  (gdb)*
                  I think maybe i use error function to delete a qapplictaion.
                Christian EhrlicherC 1 Reply Last reply
                0
                • Y YouHok

                  I try debug core, i see when I new qapplication ,i see it new two thread, one is for xdisplay , two is for qdbus,(i guess) when delete this qapplication , one thread is die, another one is still online ,
                  and then , try to if (qApp ==null) to judge application ,is already die, is true ,qapp,is null
                  and then ,i try to recreate application , segmentation fault, like this,
                  *

                  • Thread 1 "123" received signal SIGSEGV, Segmentation fault.
                    0x0000fffff359ddec in deepin_platform_plugin::DHighDpi::logicalDpi(QXcbScreen*) ()
                    from /usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libdxcb.so
                    (gdb) bt
                    #0 0x0000fffff359ddec in deepin_platform_plugin::DHighDpi::logicalDpi(QXcbScreen*) ()
                    at /usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libdxcb.so
                    #1 0x0000fffff359d32c in deepin_platform_plugin::DHighDpi::pixelDensity(QXcbScreen*) ()
                    at /usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libdxcb.so
                    #2 0x0000fffff751aecc in QHighDpiScaling::screenSubfactor(QPlatformScreen const*) () at /lib/aarch64-linux-gnu/libQt5Gui.so.5
                    #3 0x0000fffff751b6ac in QHighDpiScaling::factor(QPlatformScreen const*) () at /lib/aarch64-linux-gnu/libQt5Gui.so.5
                    #4 0x0000fffff74d00d8 in QPlatformScreen::deviceIndependentGeometry() const () at /lib/aarch64-linux-gnu/libQt5Gui.so.5
                    #5 0x0000fffff750cd4c in () at /lib/aarch64-linux-gnu/libQt5Gui.so.5
                    #6 0x0000fffff74cefd0 in QPlatformIntegration::screenAdded(QPlatformScreen*, bool) () at /lib/aarch64-linux-gnu/libQt5Gui.so.5
                    #7 0x0000fffff34047a4 in QXcbConnection::initializeScreens() () at /lib/aarch64-linux-gnu/libQt5XcbQpa.so.5
                    #8 0x0000fffff3405164 in QXcbConnection::QXcbConnection(QXcbNativeInterface*, bool, unsigned int, char const*) ()
                    at /lib/aarch64-linux-gnu/libQt5XcbQpa.so.5
                    #9 0x0000fffff34093b8 in QXcbIntegration::QXcbIntegration(QStringList const&, int&, char**) ()
                    at /lib/aarch64-linux-gnu/libQt5XcbQpa.so.5
                    #10 0x0000fffff3596974 in deepin_platform_plugin::DPlatformIntegration::DPlatformIntegration(QStringList const&, int&, char**) ()
                    at /usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libdxcb.so
                    #11 0x0000fffff3595f4c in DPlatformIntegrationPlugin::create(QString const&, QStringList const&, int&, char**) ()
                    at /usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libdxcb.so
                    #12 0x0000fffff74d125c in QPlatformIntegrationFactory::create(QString const&, QStringList const&, int&, char**, QString const&) ()
                    at /lib/aarch64-linux-gnu/libQt5Gui.so.5
                    #13 0x0000fffff74df7c8 in QGuiApplicationPrivate::createPlatformIntegration() () at /lib/aarch64-linux-gnu/libQt5Gui.so.5
                    #14 0x0000fffff74e0658 in QGuiApplicationPrivate::createEventDispatcher() () at /lib/aarch64-linux-gnu/libQt5Gui.so.5
                    #15 0x0000fffff707d6ec in QCoreApplicationPrivate::init() () at /lib/aarch64-linux-gnu/libQt5Core.so.5
                    #16 0x0000fffff74e1898 in QGuiApplicationPrivate::init() () at /lib/aarch64-linux-gnu/libQt5Gui.so.5
                    #17 0x0000fffff7ab554c in QApplicationPrivate::init() () at /lib/aarch64-linux-gnu/libQt5Widgets.so.5
                    #18 0x0000000000402ba4 in main(int, char**) (argc=1, argv=0xffffffffdc98) at ../123/main.cpp:10
                    (gdb)*
                    I think maybe i use error function to delete a qapplictaion.
                  Christian EhrlicherC Offline
                  Christian EhrlicherC Offline
                  Christian Ehrlicher
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @YouHok said in about how to try to new application in code go on:

                  I think maybe i use error function to delete a qapplictaion.

                  As I said - it's not really supported and not needed at all.

                  Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                  Visit the Qt Academy at https://academy.qt.io/catalog

                  Y 1 Reply Last reply
                  0
                  • Christian EhrlicherC Christian Ehrlicher

                    @YouHok said in about how to try to new application in code go on:

                    I think maybe i use error function to delete a qapplictaion.

                    As I said - it's not really supported and not needed at all.

                    Y Offline
                    Y Offline
                    YouHok
                    wrote on last edited by
                    #9

                    @Christian-Ehrlicher
                    so any solution you can suggest,in my business application,
                    whice i use so library package qt, in this way I only need to provide so and sdk for customer。
                    this so mayber ,Load or unload by customer,
                    how can i protect the one Q(core)Applicaction in this environment

                    1 Reply Last reply
                    0

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved