Skip to content
  • 0 Votes
    1 Posts
    224 Views
    No one has replied
  • 0 Votes
    3 Posts
    390 Views
    LorenDBL

    @sierdzio Hmm, looks like I did forget that.

  • 0 Votes
    5 Posts
    1k Views
    JKSHJ

    Choose a different mirror: https://wiki.qt.io/Online_Installer_4.x#Selecting_a_mirror_for_opensource

  • 0 Votes
    31 Posts
    15k Views
    T

    @kshegunov said in Function after setupUi():

    Probably flooding the main thread's event loop.

    Okey I optimized a code little bit:

    QtConcurrent::run([=]() { int i; int value; double dResult = 1; for(i = 0;i < 20000000;i++) { dResult = qExp(qCos(qTan(qSin(qPow(qSqrt(((((i * 1337) / 7) * 73) * 1329) % 1937),7) * dResult)) / qAsin(qPow(qSin(dResult * i * qTan(1337 * i)), 29)))); if((i % 200000) == 0) { value = i / 200000; emit showResult(QString::number(dResult)); emit pBarSetValue(value); } } emit showResult(QString::number(dResult)); emit pBarSetValue(100); });

    It tooks few seconds for my CPU, but yea UI is responsible and progressbar is changing in realtime

    Problem was because

    emit showResult(QString::number(dResult)); emit pBarSetValue(i);

    runs 5000000 times

    I don't follow. Add a stop signal where? You run a function imperatively with the proposed QtConcurent::run (as C++ is an imperative language), you can't just break in the middle of it ...

    I dont know, maybe that Quit Application signal will tell to OS scheduler that scheduler has to kill worker thread

    So only disadvantage of that method is that I cannot stop worker thread in middle of operation?

    //EDIT, thanks for help :)

  • 0 Votes
    7 Posts
    12k Views
    J

    @mrjj No I don't have a .pro file so I am opening using a .qbs file
    @Bagavathi I have done as you said, and that has worked. (i.e. Upgrading gcc/g++ )

    In the meantime I also discovered ( I am on Ubuntu ), that using command-line and 'make' works fine for all projects. So I am sorted.
    Thanks very much for your help.
    :-)
    John Montgomery, Glassel, Scotland.

  • 0 Votes
    5 Posts
    5k Views
    M

    Some added notes from the trenches:

    Above, I describe a small stub setup that downloads a larger payload. However, if your payload is large from the server, you're going to be looking at the screen stuck at the "Running package scripts..." notice and a jammed progress bar while it continues to download over Curl your larger payload. One solution to that in your preinstall Bash script is to do this:

    osascript -e 'tell application "System Events" to set visible of process "Installer" to false'

    That super neat trick hides the installer so that you can show something else. That way, the customer doesn't think your installer just jammed.

    Then, build yourself a simplistic ObjectiveC application that looks just like that Installer but shows a more active progress bar (use a timer) and then displays a few messages like "Downloading..." and "Finishing download..." and stuff like that. Of course, you can do it in Qt, but even the most minimum Mac-based Qt widget app (not statically compiled) is 8.9MB zipped, whereas in ObjectiveC you can make an app that does the same thing in a mere 32K (unzipped). (Oh, and for you QML die-hards out there, a widget-based app has you topped on file size. I was seeing 12.1MB zipped for something comparable in QML.)

    Once that Curl has finished, it can then kill the ObjectiveC process and reverse the osascript to get the installer to show you the Finish page.

    If deploying a large commercial application, and especially if you need to hook up special high-permission items and require script control, then you may not want to use either the .pkg or .dmg formats at all. This is because, psychologically, customers are not likely to want to download a huge honking 200MB+ DMG or PKG file. Instead, they would be more likely to download a smaller file, run it, and then when it says Installing, it does the rest of the download steps. (I know it's the same wait time, but psychology is important in product marketing.) Take a look at Norton's Antivirus for the Mac. (There's a free trial on their website.) They basically made an ObjectiveC / Cocoa application and then zipped it. However, it's a stub setup that's very small. When you run it, it then shows the typical EULA and then starts downloading components from the web, and putting things into the appropriate places.
  • 0 Votes
    1 Posts
    613 Views
    No one has replied
  • 0 Votes
    3 Posts
    3k Views
    SGaistS

    Hi and welcome to devnet,

    You can use QtSdkRepoChooser to try another mirror.

    Hope it helps