Skip to content
QtWS25 Call for Papers
  • 1 Votes
    5 Posts
    2k Views
    SGaistS

    Thanks for the link !

  • 0 Votes
    6 Posts
    4k Views
    SGaistS

    Yes it is, but I just saw I misunderstood how you used it. There's been cases where developer gave the Qt installation QML path.

    Can you share your QML imports ? There might be something there that could be useful to understand why not everything needed was included.

  • OS printing error

    Unsolved General and Desktop
    2
    0 Votes
    2 Posts
    764 Views
    A

    Take a look at QtRPT print report engine and QtRptDesigner. May be it help you.
    You can fint QtRPT at http://www.qtrpt.tk

  • 0 Votes
    1 Posts
    971 Views
    No one has replied
  • 0 Votes
    3 Posts
    1k Views
    Joel BodenmannJ

    @VRonin Thank you for your suggestion!

    Interestingly that doesn't have any effect. The application still uses the unified menubar.
    I set the attribute like this in my main() before I construct and show the QMainWindow:

    QCoreApplication::setAttribute(Qt::AA_DontUseNativeMenuBar, true);

    Interestingly I get the following debug messages in the application output pane when opening and closing the application when the attribute is set to true:

    Menu item is already in a menu, remove it from the other menu first before inserting Menu item is already in a menu, remove it from the other menu first before inserting Menu item is already in a menu, remove it from the other menu first before inserting Menu item is already in a menu, remove it from the other menu first before inserting Item to remove does not belong to this menu Item to remove does not belong to this menu Item to remove does not belong to this menu Item to remove does not belong to this menu

    I also tried QMainWindow::setUnifiedTitleAndToolBarOnMac() but without any success either. The application still uses the unified toolbar.

    I'm using Qt 5.6 on OS X 10.11.4 (El Capitan)

  • 1 Votes
    6 Posts
    6k Views
    Guy GizmoG

    Wasn't expecting this thread to get resurrected! I'm glad to see there's a feature I can vote for to have this ability added to Qt Creator.

    I've dealt with this in the meantime by enabling "run in terminal" in all of my project's run settings and then setting my terminal in Preferences > Environment > System > Terminal to a custom script that uses whichever terminal window is the closest to the lower right corner of my desktop. (That's where I want my program output to go.) This lets me effectively have it be in a separate window from Qt Creator that I can position wherever I like.

    I'm running macOS so my solution only works for that, but in case anyone wants it, here's the script I'm using to do the above in iTerm2:

    #! /bin/bash # ugly escaping: for apple script \ and " need to be escaped, whereas %q takes care of all bash escaping declare -a args mydir=`pwd` mydir=$(printf '%q' "$mydir") mydir="${mydir//\\/\\\\}" args[0]="bribriSaveDir=\`pwd\`; cd ${mydir//\"/\\\"}; " # args[0]="cd ${mydir//\"/\\\"};" for a in "$@" ; do x=$(printf '%q ' "$a") x="${x//\\/\\\\}" args[${#args[@]}]="${x//\"/\\\"}" done args+=('; cd ${bribriSaveDir}') mArgs=${args[@]:0} osascript <<EOF tell application "System Events" to set terminalRunning to exists process "iTerm2" if not terminalRunning then tell application "iTerm" activate repeat while the (count of the windows) = 0 delay 0.1 end repeat end tell end if set exec to "$mArgs" tell application "iTerm" set theWindows to {} repeat with i from 1 to the count of the windows if (is hotkey window of window i) = false and (is at shell prompt of current session of window i) = true then copy window i to the end of theWindows end if end repeat if (count of theWindows) = 0 then set newWindow to create window with default profile tell current session of newWindow to write text exec with newline else set currentWin to window 1 set currentDistance to 0 repeat with i from 1 to the count of theWindows set theWindow to item i of theWindows set bb to bounds of theWindow set x to (item 3 of bb) set y to (item 4 of bb) set dist to x * x + y * y if dist > currentDistance then set currentWin to theWindow set currentDistance to dist end if end repeat tell current session of currentWin to write text exec with newline end if end tell EOF

    The criteria for which window it selects can be adjusted by changing the interior of the repeat with i from 1 to the count of theWindows loop. Whichever window currentWin gets assigned to will be the one that Qt Creator runs the app in.

    I also got annoyed with the way that you have to press enter in the terminal window after the program I'm running in Qt Creator exits, since that doesn't really make sense to do if you're reusing the same terminal window over and over again. So I downloaded the source to Qt Creator and made a small modification to the qtcreator_process_stub tool it includes (which is the little executable that communicates with Qt Creator and manages running your app in a terminal window) so that it doesn't do that any longer, and it prints the return code of my program since I find it's useful to know precisely when it's terminated and how. Each time I update Qt Creator I just copy my version of qtcreator_process_stub into its application bundle to get the behavior I want. So far there hasn't been any changes to qtcreator_process_stub in several versions so it's been fine to just keep copying in my version of it.

    Here's a diff of the changes I made to it, at least for the unix / macOS side of things. I imagine it'd be easy to do something similar on Windows:

    --- a/src/libs/utils/process_stub_unix.c +++ b/src/libs/utils/process_stub_unix.c @@ -70,8 +70,8 @@ static volatile int chldPid; static void __attribute__((noreturn)) doExit(int code) { tcsetpgrp(0, getpid()); - puts(sleepMsg); - fgets(sleepMsg, 2, stdin); /* Minimal size to make it wait */ + //puts(sleepMsg); + //fgets(sleepMsg, 2, stdin); /* Minimal size to make it wait */ exit(code); } @@ -163,9 +163,11 @@ static void sigchldHandler(int sig) } } sendMsg("exit %d\n", WEXITSTATUS(chldStatus)); + printf("\nExited with status %d\n", chldStatus >> 8); doExit(0); } else { sendMsg("crash %d\n", WTERMSIG(chldStatus)); + printf("\nExited with status %d\n", chldStatus >> 8); doExit(0); } } @@ -180,7 +182,8 @@ int main(int argc, char *argv[]) char **env = 0; struct sockaddr_un sau; struct sigaction act; + printf("\n"); memset(&act, 0, sizeof(act)); if (argc < ArgEnv) {

    I figured I'd post all that stuff just in case someone else finds it useful. I definitely appreciate that Qt Creator is open source so I can make little modifications to it like this.

  • 1 Votes
    3 Posts
    2k Views
    M

    @pavel_abr Did you solve this? Please let me know the solution.

  • 0 Votes
    3 Posts
    1k Views
    K

    @patrikd
    Thank your suggestion worked fine for my framework too.
    Wish I could give you a cartload of reps for that :-).

  • 0 Votes
    12 Posts
    5k Views
    N

    Hello,

    That not the problem here.
    If i understand correctly, the OSX Application Menu is translated by Qt, not my application.
    The problem occurs only with QtQuick and on a OSX no-english.

    So why i must do give a translated file created by me for QtQuick and not for QtWidgets ? (And not the translated files qt)

    Regards,

    nelbok

  • 0 Votes
    5 Posts
    2k Views
    SGaistS

    Please have some patience, this forum is community driven and not all users live in the same timezone as you.

    The picture you are linking to doesn't show a hovered button but a checked button. You will have that visual effect if you set the checkable property of the action to corresponding to the button as true and you check it.

  • 0 Votes
    4 Posts
    2k Views
    L

    Thank you for the hint about 'solved'.

  • 0 Votes
    10 Posts
    3k Views
    D

    @DRivkin anyone interested can send an email to jobs@next.audio and I can take it from there.

  • 0 Votes
    4 Posts
    3k Views
    XandlX

    Update: I managed to get a QWindow involved into the code, yet the toolbar is messed up.
    Screenshot

    New code:

    void Test::createFancyMacWindow() { QWindow* w = new QWindow(); NSView* mainWindowNSView = (NSView*) w->winId(); NSWindow* window = [mainWindowNSView window]; NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; // move toolbar where the titlebar used to be [window setTitleVisibility: NSWindowTitleHidden]; // Adjust Cocoa layouts NSView *contentView = [window contentView]; [contentView setAutoresizesSubviews:YES]; QMacNativeWidget *nativeWidget = new QMacNativeWidget(contentView); //nativeWidget->move(0, 0); nativeWidget->setPalette(QPalette(Qt::red)); nativeWidget->setAutoFillBackground(true); NSView *nativeWidgetView = nativeWidget->nativeView(); [contentView addSubview:nativeWidgetView positioned:NSWindowAbove relativeTo:nil]; [nativeWidgetView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; [nativeWidgetView setAutoresizesSubviews:YES]; nativeWidget->show(); // Show the window. [window makeKeyAndOrderFront:window]; [pool release]; QMacToolBar *toolBar = new QMacToolBar(); toolBar->addItem(QIcon(), QStringLiteral("Helloooo")); toolBar->attachToWindow(w); [window setToolbar: toolBar->nativeToolbar()]; w->show(); }
  • 0 Votes
    1 Posts
    640 Views
    No one has replied
  • 0 Votes
    1 Posts
    583 Views
    No one has replied
  • error in qglobal.h

    Solved General and Desktop
    2
    0 Votes
    2 Posts
    3k Views
    clogwogC

    nevermind, i saw someone had a different error but adding

    QMAKE_MAC_SDK = macosx10.11

    in the pro file also fixes this.

  • 0 Votes
    20 Posts
    9k Views
    jsulmJ

    Core i5 is for sure x86_64 and it can execute i386 binaries as well.
    Because x86_64 was invented by AMD and later implemented by Intel as well it is often called AMD x86_64.

  • 0 Votes
    4 Posts
    2k Views
    SGaistS

    Sounds good :)