Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.4k Posts
  • Reporting inappropriate content on the forums

    Pinned Locked spam
    29
    4 Votes
    29 Posts
    35k Views
    A
    Thank you for the report. I have banned the user, which got rid of the spam posting. Not a loss, as this user did not post any other content on the site. Just deleting this one posting was not possible. Thanks for reporting this.
  • class "has not been declared" in moc file though in class include is correct.

    Unsolved
    9
    0 Votes
    9 Posts
    69 Views
    SGaistS
    I would suggest following the cmake getting started guide. There are some hints to simplify the content of your CMakeLists.txt file. One of which is to not include the headers in the file list you pass to qt_add_executable.
  • Can't seem to get shaders to work.

    Unsolved
    1
    0 Votes
    1 Posts
    12 Views
    No one has replied
  • Custom QHeaderView doesn't adjust size

    Unsolved
    4
    0 Votes
    4 Posts
    82 Views
    SGaistS
    If you want to sort, why are you setSortIndicatorShown(false); ?
  • fusion style is bad in combobox

    Unsolved
    4
    0 Votes
    4 Posts
    71 Views
    Christian EhrlicherC
    I don't understand your problem - what exactly is wrong here?
  • How should i do to make a qwidget cover qvulkanwindow

    Unsolved
    3
    0 Votes
    3 Posts
    37 Views
    C
    @Pl45m4 i do that,and also dosen`t work.
  • QPageLayout gives result from wrong printer

    Unsolved
    1
    0 Votes
    1 Posts
    18 Views
    No one has replied
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    13 Views
    No one has replied
  • How to set it panel horizontally

    Unsolved
    3
    0 Votes
    3 Posts
    61 Views
    Pl45m4P
    @JacobNovitsky Actually you can when compiling QtCreator from source and modifying that bit of code. I don't know if the community license allows that Funny enough I've been talking with one of the QtCreator maintainers on the Qt Discord about that exact menu bar lately, because I was interested in how it's set up and done. I might want to use something similar in one of my personal projects (also VSCode has some sort of side menu bar where you select between run, extensions or file system view, for example)
  • The sub-object cannot display when i add the Q_OBJECT in my code

    Solved
    4
    0 Votes
    4 Posts
    64 Views
    B
    @ctrkalk Then I know the reason, it is not that it doesn't show, but the stylesheet doesn't work, so the widget is totally transparent. There're already quite a lot posts in the forum asking about subclassed QWidget's stylesheet not working. It is also documented: If you subclass from QWidget, you need to provide a paintEvent for your custom QWidget as below: ... But this is the first time I know that a subclassed QWidget without Q_OBJECT would have stylesheet working :) BTW, the simplest solution for this kind of problem (if you don't want to reimplement paintEvent) is to subclass QFrame instead of QWidget, or using palette instead of stylesheet.
  • Qt 6.10 and text encodings

    Unsolved
    15
    0 Votes
    15 Posts
    428 Views
    cristian-adamC
    @AndyBrice said in Qt 6.10 and text encodings: @cristian-adam I used to build Qt myself, many years ago. But it just got too difficult. Is ICU going to supported in a future Mac binary release? No idea. I've opened up https://bugreports.qt.io/browse/QTBUG-141087
  • Embedding Lightweight Web Tools into Qt Desktop Apps — Best Approaches?

    Unsolved
    2
    0 Votes
    2 Posts
    50 Views
    No one has replied
  • partially update default stylesheet

    Unsolved
    21
    0 Votes
    21 Posts
    334 Views
    SGaistS
    Hi, Another option is to create a QProxyStyle to do the painting you want.
  • Running clang tidy for a qmake project from the command line

    Unsolved clang-tidy qmake linux clang
    3
    1 Votes
    3 Posts
    2k Views
    J
    this Bash solution didn't work for me, on account of a multi-level project structure that i was dealing with. (at least, i think it was multi-level.) What did work for me was something akin to the following: qmake ./my_project.pro -spec linux-clang CONFIG+=release CONFIG+=DISABLE_DEVELOPER_MODULES CONFIG+=force_debug_info && /usr/bin/make qmake_all make -j $CORES VERBOSE=y all &>make_output.txt compiledb --parse make_output.txt mkdir build/yamls run-clang-tidy -p . -j $CORES -clang-tidy-binary $CLANG_TIDY_PATH -checks=-*,bugprone-*,clang-*,cppcoreguidelines-*,modernize-* -export-fixes build/yamls this gives me a bunch of moc_* complaints, but also complaints on my actual code. the moc_* complaints seem to be clang-tidy's complaints about Qt itself, so i filter those out.
  • Memory leaks in 6.9.1 that weren't there in 6.9.0

    Solved
    14
    1 Votes
    14 Posts
    778 Views
    PerdrixP
    For reference The debug pdb files available for Qt 6.9.1 and 6.10 WERE INSTALLED and I NEVER REFUSED to install them e.g. qwindowsd.pdb is there next to qwindowsd.dll
  • How to build qt-everywhere-src-5.15.16 when configure broken

    Unsolved uoia
    7
    0 Votes
    7 Posts
    208 Views
    SGaistS
    Hi, The pre-built Qt 6 for macOS is multi-arch.
  • QSqlQuery prepared statment using QString as a bind value

    Unsolved
    5
    0 Votes
    5 Posts
    81 Views
    Christian EhrlicherC
    @sairun said in QSqlQuery prepared statment using QString as a bind value: somewhow it doesn't get replaced as a regular string in the query. This would completely contradict the prepared query idiom... https://en.wikipedia.org/wiki/Prepared_statement
  • Terminal Output Of Application Outside of Creator

    Unsolved
    4
    0 Votes
    4 Posts
    97 Views
    JonBJ
    @daviddev You have a Windows "UI" program, i.e. linked as a "windows" rather than a "console" application. I think you will find: when a Windows UI application is launched, whether from a terminal or icon-shortcut, that stdout and stderr are attached to "nowhere", so anything written to them "disappears". If it works from FrontEnd.exe > output.txt that implies that the calling shell has redirected stdout to the file so it stays like that when it runs and you get output there. The stuff inside Creator with/without terminal is special code in Creator so that's different. I am not sure what exactly you want to achieve for what situation(s). Logging to file sounds like a better option than stdout/err for a UI program anyway. Under Windows you might also try downloading something like dbwin, dbwin32 or whatever the modern replacement is and running that --- that displays any text sent via Win OutputDebugString(), it may also capture some other stuff I'm not sure. Your program can also call Win32 AllocConsole() to allocate a visible console window (like a terminal) and that will have stdout/err attached, instead of your attempted "supporting QProcess". Finally a UI program could create e.g. a permanently visible modeless dialog/window with, say, a QPlainTextEdit in it to which you send all your output messages for it to display.
  • 0 Votes
    2 Posts
    51 Views
    S
    here is the thread backtrace: Process 2636 stopped * thread #18, name = 'QSGRenderThread', stop reason = EXC_BREAKPOINT (code=1, subcode=0x19ea5a3ec) frame #0: 0x000000019ea5a3ec libsystem_c.dylib`__abort + 160 libsystem_c.dylib`__abort: -> 0x19ea5a3ec <+160>: brk #0x1 libsystem_c.dylib`abort_report_np: 0x19ea5a3f0 <+0>: pacibsp 0x19ea5a3f4 <+4>: sub sp, sp, #0x30 0x19ea5a3f8 <+8>: stp x20, x19, [sp, #0x10] (lldb) bt * thread #18, name = 'QSGRenderThread', stop reason = EXC_BREAKPOINT (code=1, subcode=0x19ea5a3ec) * frame #0: 0x000000019ea5a3ec libsystem_c.dylib`__abort + 160 frame #1: 0x000000019ea5a34c libsystem_c.dylib`abort + 180 frame #2: 0x0000000103b9c060 libclang_rt.asan_osx_dynamic.dylib`__sanitizer::Abort() + 68 frame #3: 0x0000000103b9b728 libclang_rt.asan_osx_dynamic.dylib`__sanitizer::Die() + 212 frame #4: 0x0000000103b9b7d0 libclang_rt.asan_osx_dynamic.dylib`__sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) + 156 frame #5: 0x0000000103b9c190 libclang_rt.asan_osx_dynamic.dylib`__sanitizer::UnsetAlternateSignalStack() + 100 frame #6: 0x0000000103b86a8c libclang_rt.asan_osx_dynamic.dylib`__asan::AsanThread::Destroy() + 252 frame #7: 0x000000019eb1db88 libsystem_pthread.dylib`_pthread_tsd_cleanup + 448 frame #8: 0x000000019eb20968 libsystem_pthread.dylib`_pthread_exit + 84 frame #9: 0x000000019eb20278 libsystem_pthread.dylib`_pthread_start + 160
  • QFileDialog on different platforms

    Solved
    4
    0 Votes
    4 Posts
    197 Views
    P
    @Bonnie Thanks a lot! Required some tweaking but this solution worked. Works on both Mac Intel and Silicon. Added the switch to my main() with an if-statemet as I want it to affect all my dialogs when on a Mac. #if defined(Q_OS_MACOS) QApplication::setAttribute(Qt::AA_DontUseNativeDialogs, true); #endif Then in my editor file: static const QString kFilters = "C/C++/CS Files (*.c *.cpp *.cc *.cxx *.cs *.h *.hpp *.hh *.hxx);;" "Pascal Files (*.pas *.pp);;" "Python Files (*.py);;" "Ada Files (*.ada *.adb *.ads);;" "Qt Project Files (*.pro);;" "Text and Markup Files (*.txt *.json *.xml *.md);;" "All Files (*.*)"; QString fileName; #if defined(Q_OS_MACOS) // non-native dialog QFileDialog dlg(this); dlg.setWindowTitle(tr("Open File")); dlg.setFileMode(QFileDialog::ExistingFile); dlg.setViewMode(QFileDialog::Detail); dlg.setDirectory(QFileInfo(startDir).isDir() ? startDir : QFileInfo(startDir).absolutePath()); dlg.setNameFilters(kFilters.split(";;")); dlg.selectNameFilter("C/C++/CS Files (*.c *.cpp *.cc *.cxx *.cs *.h *.hpp *.hh *.hxx)"); // dlg.setOption(QFileDialog::DontUseNativeDialog, true); // if not set in main() if (dlg.exec() == QDialog::Accepted && !dlg.selectedFiles().isEmpty()) fileName = dlg.selectedFiles().constFirst(); #else fileName = QFileDialog::getOpenFileName(this, tr("Open File"), startDir, kFilters); #endif if (!fileName.isEmpty()) { openFile(fileName); }