Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.5k Topics 457.3k Posts
  • How to quit Application immedialy after QMessageBox?

    Unsolved
    5
    0 Votes
    5 Posts
    317 Views
    K
    @Chris-Kawa Nice tipps, thx, I just began this way, forgot to put QApplication to first line
  • 0 Votes
    3 Posts
    190 Views
    D
    @mpergand I will try this, thank you. Update: Works fine, I was unware of sender() of QObject. Thanks!
  • debug.log file created when removing files from qtwebengine_locales

    Unsolved
    1
    0 Votes
    1 Posts
    191 Views
    No one has replied
  • Will Qt support Apple Vision Pro / visionOS?

    Unsolved
    6
    0 Votes
    6 Posts
    845 Views
    SGaistS
    @Felix-van-de-Donk the thread is here.
  • QTreeView memory consumption increasing

    Unsolved
    16
    0 Votes
    16 Posts
    1k Views
    JoeCFDJ
    @jinming if loading blocks UI, send loading to a thread.
  • QLabel with <img>

    Solved
    3
    0 Votes
    3 Posts
    196 Views
    PerdrixP
    @Pl45m4 It appeared to have a transparent background but actually had a checker-board background, so it looked right, but wasn't. Editing file and making the background truly transparent solved the problem. D.
  • 0 Votes
    23 Posts
    2k Views
    C
    The problem was a missing reference on the container. It should have been QList<Bookmark>&, thus it didnt update the container when I add a book.
  • This topic is deleted!

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

    Solved
    7
    0 Votes
    7 Posts
    48 Views
  • QByteArray saves wrong size with UTF8

    Solved
    6
    0 Votes
    6 Posts
    456 Views
    C
    @JAVH The longblob column should have the pseudo-character set "binary" (see, e.g., the second paragraph here) The blob is not a string with UTF-8 or any other encoding.
  • Tooltip for each Qplieslice in a QPieSeries

    Unsolved
    2
    0 Votes
    2 Posts
    334 Views
    M
    In terms of when to hide, Qt 6.6 has a different hovered() signature which includes a bool, which is set to true on mouse over and false on mouse exit. so: void xyzObject::slotSliceHover(bool hovered){ QPieSlice* hoverSlice = qobject_cast<QPieSlice*>(QObject::sender()); if (hoverSlice != nullptr){ if (hovered) hoverSlice->setExploded(true); else hoverSlice->setExploded(false); } }
  • Build errors in qjsnumbercoercion.h under Qt 6.6.0 on Windows 11

    Solved
    3
    0 Votes
    3 Posts
    492 Views
    E
    Adding the #define NOMINMAX in the source file that loads a lot of header files did the trick. I'll have to track down the specific header that's causing this. You put me on the right track. Thank you.
  • QStyledItemDelegate how to force close the editor?

    Unsolved
    4
    0 Votes
    4 Posts
    378 Views
    Christian EhrlicherC
    @StudentScripter said in QStyledItemDelegate how to force close the editor?: but sadly this way my delegates editevent logic isnt working anymore when clicking on this area. What does this mean? clickPosition is relative to the view, not relative to the current cell (how should it be?).
  • on screen logging

    Solved
    14
    0 Votes
    14 Posts
    2k Views
    W
    @SimonSchroeder thank you very much for your help. It is more clear now to me the use of static keyword in global variables which I did not understand. I have moved the static call to myMessageHandler, also checked if file is already open. So everything is safer and more meaningful now. thanks again for your help!
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    5 Views
    No one has replied
  • Question Concerning QWidget API

    Unsolved
    3
    0 Votes
    3 Posts
    273 Views
    F
    @Christian-Ehrlicher Sorry ,I'm a new user of Qt Forum .Please forgive my untidy code(
  • Moc not generating functions

    Solved
    18
    0 Votes
    18 Posts
    1k Views
    R
    Solution was to create SUBDIR .pro with lib and test subdirs. In lib I build a .dll from app and include the dll in test [image: 6e3c257a-a4f9-4f9d-b56e-4c4488f95778.png]
  • How to change center of scene/view?

    Unsolved
    3
    0 Votes
    3 Posts
    982 Views
    A
    @ChrisW67 You can see in this image I have four items and I calculated center of scene as A and clicked point as B [image: 260e731e-7715-4dbc-a07d-d78eef7f04da.png] After clicking on point B A new item added and that cause shifting of point B towards left . [image: c06dac09-bc6d-4e5e-9e00-9dc3a1287d01.png] Here what I want is that I want to match Poinit A with point C or Point B with point D by shifting the scene.. Here I am trying to set point A as center of scene so that it will move item toward right and then point B will shift on point D. @Qt-embedded-developer @qt_learning @qtgraphical @develop-world
  • Is QList thread-safe for certain operations?

    Solved
    6
    0 Votes
    6 Posts
    885 Views
    S
    @deisik said in Is QList thread-safe for certain operations?: So is QList thread-safe for modifying one of its elements (with replace()) from one thread while reading its other elements (with at()) from another? This isn't entirely about thread-safety of QList anymore. If you are storing ints inside the QList, at() will retrieve either the old value or the new value (assuming the ints are properly aligned) when do a replace() at the same time on the same index. If you store your own class in the container, your class would have to be somewhat thread-safe as well. However, I don't know an easy mechanism for locking assignment to the object (i.e. replacing its contents) against any access to the object while it is being changed. (Unless you synchronize all access to the object with a mutex.) If you store pointers to objects inside your container you get entirely different problems. Replacing a pointer is as safe as replacing an int. But, you might have a local copy of a pointer to the object which will now be replaced inside the QList. Most likely, the object will then also be destroyed by the thread that replaced the object. The local copy of the pointer is now invalid. Using shared pointers might help in this context, but they will slow down every access to the objects inside your container. (And you need to make sure that you get a copy of the shared pointer. The default implementation of at() will return a reference to whatever is stored inside the container, not a copy.)
  • Speed up make or/and ninja building proccess

    Unsolved
    8
    0 Votes
    8 Posts
    1k Views
    S
    @JacobNovitsky said in Speed up make or/and ninja building proccess: how to amend your project for ubuntu? Most of the things should work right away on Linux as well. The batch scripts (in the scripts folder) mostly work as a bash script also. grep and sed should be available by default on Linux or are easy to install through the package manager. Only generateInputFiles4Fbuild.bat needs a little more adjustment. You don't need to load Visual Studio (or any compiler for that matter) and just need to adjust the path to qmake. Also, rmdir needs to be replace by a simple rm -r. A little bit more involved is the adjustment of the .bff files. It should be fairly easy to adjust the paths of the .bff includes in the Qt subfolder. Certainly you need to replace the Visual Studio folder by a GCC or Clang folder. My inspiration for the general setup came from the .bff files for building FASTBuild itself. Have a look over there how to set up a GCC or Clang folder. The only additional thing they do is to copy the compiler explicitly to other machines during distributed builds. The toolchain (i.e. Windows or Linux, GCC or Clang (if you have both as option)) is selected in the fbuild.bff file. IIRC you can have a look at the FASTBuild setup itself for how to select the toolchain inside this file. One last thing is which compiler/linker flags to choose. For this I ran qmake once initially and had a look at the generated Makefile. These are the flags I set inside fbuild.bff and I think there are more (especially some default libs) inside the Visual Studio folder.