Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. [Solved] Moving to Production from qmlviewer. Why am I so slow?

[Solved] Moving to Production from qmlviewer. Why am I so slow?

Scheduled Pinned Locked Moved QML and Qt Quick
5 Posts 2 Posters 3.6k Views
  • 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.
  • G Offline
    G Offline
    Gary_
    wrote on last edited by
    #1

    We are starting our production code, and writing our own viewer (previously we have been using qmlviewer).

    However, our code is running at about 1/2 the performance of qmlviewer. Note this is Qt 4.7.1.

    QMLVIEWER EXECUTION (This is fast)

    @
    qmlviewer -fullscreen -frameless main.qml
    @

    OUR CODE (This is slow)

    main.cpp

    @
    #include <QApplication>
    #include <QDeclarativeView>

    int main(int argc, char **argv) {

    QApplication app(argc, argv);
    
    QApplication::setGraphicsSystem&#40;"raster"&#41;;
    
    QDeclarativeView *view = new QDeclarativeView;
    
    view->setAttribute(Qt::WA_OpaquePaintEvent&#41;;
    view->setAttribute(Qt::WA_NoSystemBackground&#41;;
    view->setAttribute(Qt::WA_DeleteOnClose);
    
    view->setFocus();
    
    view->setViewportUpdateMode(QGraphicsView::MinimalViewportUpdate);
    
    view->setSource(QUrl::fromLocalFile&#40;"main.qml"&#41;&#41;;
    view->showFullScreen(&#41;;
    
    return app.exec(&#41;;
    

    }
    @

    project

    @
    TEMPLATE = app
    QT += declarative
    CONFIG += qt uic

    SOURCES +=
    main.cpp
    @

    SDK built from 4.7.1 source:

    @
    ./configure -release -qt-sql-sqlite -qt-gif -qt-libtiff -qt-libpng -qt-libmng -qt-libjpeg -silent
    @

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mbrasser
      wrote on last edited by
      #2

      Hi Gary,

      What platform are you running on? Were you setting any other viewer settings (like -opengl)?

      Note that setGraphicsSystem needs to be called before the QApplication constructor to take effect (http://doc.qt.nokia.com/4.7/qapplication.html#setGraphicsSystem).

      Regards,
      Michael

      1 Reply Last reply
      0
      • G Offline
        G Offline
        Gary_
        wrote on last edited by
        #3

        No additional qmlviewer arguments, just -fullscreen and -frameless. We have yet to tackle OpenGL.

        Platform is standard x86 VIA processor. We build off a Fedora Core 8 box.

        @
        [172.17.128.4: ]# cat /proc/version
        Linux version 2.6.34 (xxxxx@xxxxx) (gcc version 4.1.2 20070925 (Red Hat 4.1.2-33)) #2 SMP PREEMPT Fri Jul 2 16:32:55 PDT 2010

        [172.17.128.4: ]# uname -a
        Linux sm 2.6.34 #2 SMP PREEMPT Fri Jul 2 16:32:55 PDT 2010 i686 GNU/Linux

        [172.17.128.4: ]# cat /proc/cpuinfo
        processor : 0
        vendor_id : CentaurHauls
        cpu family : 6
        model : 9
        model name : VIA Nehemiah
        stepping : 8
        cpu MHz : 798.000
        cache size : 64 KB
        fdiv_bug : no
        hlt_bug : no
        f00f_bug : no
        coma_bug : no
        fpu : yes
        fpu_exception : yes
        cpuid level : 1
        wp : yes
        flags : fpu vme de pse tsc msr cx8 sep mtrr pge cmov pat mmx fxsr sse up rng rng_en ace ace_en
        bogomips : 1600.07
        clflush size : 32
        cache_alignment : 32
        address sizes : 32 bits physical, 32 bits virtual
        power management:

        MemTotal: 489028 kB
        MemFree: 116496 kB
        Buffers: 19276 kB
        Cached: 183664 kB
        SwapCached: 0 kB
        Active: 144976 kB
        Inactive: 59504 kB
        Active(anon): 25208 kB
        Inactive(anon): 7456 kB
        Active(file): 119768 kB
        Inactive(file): 52048 kB
        Unevictable: 20088 kB
        Mlocked: 0 kB
        HighTotal: 0 kB
        HighFree: 0 kB
        LowTotal: 489028 kB
        LowFree: 116496 kB
        SwapTotal: 995992 kB
        SwapFree: 995992 kB
        Dirty: 0 kB
        Writeback: 0 kB
        AnonPages: 21668 kB
        Mapped: 8576 kB
        Shmem: 11036 kB
        Slab: 11724 kB
        SReclaimable: 7728 kB
        SUnreclaim: 3996 kB
        KernelStack: 1072 kB
        PageTables: 1028 kB
        NFS_Unstable: 0 kB
        Bounce: 0 kB
        WritebackTmp: 0 kB
        CommitLimit: 1240504 kB
        Committed_AS: 323928 kB
        VmallocTotal: 528440 kB
        VmallocUsed: 29848 kB
        VmallocChunk: 497652 kB
        DirectMap4k: 151488 kB
        DirectMap4M: 352256 kB

        [172.17.128.4: ]# Xorg -version

        X Window System Version 6.9.0
        Release Date: 21 December 2005
        X Protocol Version 11, Revision 0, Release 6.9
        Build Operating System: Linux 2.6.12-1.1381_FC3smp i686 [ELF]
        Current Operating System: Linux sm 2.6.34 #2 SMP PREEMPT Fri Jul 2 16:32:55 PDT 2010 i686
        Build Date: 29 July 2010
        Before reporting problems, check http://wiki.X.Org
        to make sure that you have the latest version.
        Module Loader present
        @

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mbrasser
          wrote on last edited by
          #4

          I've just added a note about when to call setGraphicsSystem above (looks like I wasn't quite fast enough though:-). Does moving that fix your issue?

          Michael

          1 Reply Last reply
          0
          • G Offline
            G Offline
            Gary_
            wrote on last edited by
            #5

            Fixed! Thank you :)

            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