Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.1k Topics 454.6k Posts
QtWS25 Last Chance
  • how to protect apps from reverse engineering hacks

    Unsolved
    10
    0 Votes
    10 Posts
    639 Views
    S
    You have to be careful. The article is meant specifically to try to sell you a commercial license. Do not use the advice in this article if you are using the open source version of Qt. The whole article is saying to strip the function names of Qt functions. However, the LGPL requires you to provide a way to the users of your software to relink with a different version of Qt. If you link to Qt statically, you need to provide e.g. your own object files with all symbol names so they can be relinked with a different Qt library version. Even obfuscation would not work as you would have to provide the obfuscator so others can obfuscate the Qt source code to be compatible with your own code. You need to buy a commercial license if you really want to follow this advice. As the article states: all this only helps against "casual reverse engineering". Without the function names it is slightly harder to reverse engineer programs. However, the hardest part is figuring out how the function works. This can still be done without the function names. Someone who can do that does not really care about function names. Another thing they mention is to protect your software against tempering. This is mostly in the context of closed devices which are supposed to just run your single program. Most likely this does not apply to your use case. (Tempering protection in the context of desktop or mobile apps is a lot more complicated.)
  • QLineedit adding extra \ from text()

    Solved qlineedit qsettings utf-8
    3
    0 Votes
    3 Posts
    212 Views
    C
    @sayan275 said in QLineedit adding extra \ from text(): qInfo()<<__FUNCTION__<<textentered; When you use the QDebug functions the output is in the form of a C++ literal with anything that would need to be escaped inside the double-quotes, escaped. In this case the backslashes, but also any embedded double quote etc.
  • Q_DECLARE_METATYPE results in assert failure after upgrading from Qt 4.8 > 5.15

    Solved
    2
    0 Votes
    2 Posts
    120 Views
    Z
    Replacing my types with typedefs resolved my issue
  • QT for Zulty's messing up after screen saver

    Unsolved
    2
    0 Votes
    2 Posts
    99 Views
    S
    I was going to try some qt example programs and see if they get some kind of weird position information when the monitor wakes back up. This is what I am assuming is going on. During the "wake back up" phase there is some kind of position messages that's weird and the client window is getting confused.
  • Finding and setting supported opengl version for QOpenGLWidget

    Unsolved
    5
    0 Votes
    5 Posts
    529 Views
    JoeCFDJ
    Try to set openGL version: // Set OpenGL version and profile QSurfaceFormat format; format.setVersion(3, 3); // Set OpenGL version (e.g., 3.3) format.setProfile(QSurfaceFormat::CoreProfile); // Set OpenGL core profile https://doc.qt.io/qt-5/qopenglwidget.html#setFormat
  • Counting files in a directory

    Unsolved
    6
    0 Votes
    6 Posts
    354 Views
    J.HilkJ
    @JonB said in Counting files in a directory: QDir::Files | QDir::Hidden: I am unsure whether this would include a hidden directory (as well as hidden files), or only files which are hidden. since the filter is set to files only, hidden folders will be ignored @JonB said in Counting files in a directory: QDirIterator::Subdirectories: I am unsure whether this means only immediate sub-directories of the directory path or all, recursive sub-directories. all, recursively
  • How to correctly rotate a QGraphicsItem around different anchors in Qt C++

    Unsolved
    2
    1 Votes
    2 Posts
    568 Views
    P
    It might be a little late, but maybe someone else will find this information useful in the future. I am pretty new to Qt, so please correct me if my explanations are not correct. I believe that the problem lies in the changing of the origin point itself. Because your two anchor points exist relative to the coordinates of your MyView item, they will also change their position every time you change the origin point. This is probably the reason why you get this weird jumping behavior. Another way of implementing the desired behavior would be to translate the whole MyView item. So you could implement the following modifications to your existing code. First, change the mousePressEvent method so that you no longer change the origin. MyView::mousePressEvent void MyView::mousePressEvent(QGraphicsSceneMouseEvent *event) { _tapPoint = event->pos(); auto cp1 = _anchor1.center(); // get center point of anchor 1 auto cp2 = _anchor2.center(); // get center point of anchor 2 // Anchor 1 clicked if (_anchor1.contains(_tapPoint)) { _viewState = ANCHOR1; } // anchor 2 clicked else if (_anchor2.contains(_tapPoint)) { _viewState = ANCHOR2; } // View clicked else { QGraphicsItem::mousePressEvent(event); _viewState = VIEW; } } Secondly, use a transformation matrix to rotate the whole item. MyView::mouseMoveEvent void MyView::mouseMoveEvent(QGraphicsSceneMouseEvent *event) { auto p = event->pos(); auto cp1 = _anchor1.center(); // get center point of anchor 1 auto cp2 = _anchor2.center(); // get center point of anchor 2 QTransform transformMatrix; switch (_viewState) { case ANCHOR1: { // calculate the angle of the rotation based on the mouse touch auto angle = qRadiansToDegrees(qAtan2(p.y() - _anchor2.y(), _width)); transformMatrix.translate(cp2.x(), cp2.y()); transformMatrix.rotate(-angle); transformMatrix.translate(-cp2.x(), -cp2.y()); setTransform(transformMatrix, true); break; } case ANCHOR2: { // calculate the angle of the rotation based on the mouse touch auto angle = qRadiansToDegrees(qAtan2(p.y() - _anchor1.y(), _width)); transformMatrix.translate(cp1.x(), cp1.y()); transformMatrix.rotate(angle); transformMatrix.translate(-cp1.x(), -cp1.y()); setTransform(transformMatrix, true); break; } default: QGraphicsItem::mouseMoveEvent(event); // move the item normally } } In this solution, I just change the rotation origin manually by first translating the whole item by the coordinates of the center point of the selected anchor.
  • How do I unify all dlls to the main application when doing windeployqt?

    Unsolved
    17
    0 Votes
    17 Posts
    777 Views
    S
    You don't really have to "code" an installer. Qt itself provides the Qt Installer Framework (had some trouble with getting root access on Linux). If your project already uses CMake it is easy to integrate some off-the-shelf installers. For legacy reasons we are using NSIS (without CMake, but I think CMake does support this). (We also decided to compile Qt statically and link to the static VS runtime which in our case allows to deploy a single executable. I am not sure how that translates with OpenGL and D3D in your case (i.e. if there are static versions of these as well). Linking to Qt statically under the LGPL has some additional requirements which can be a bit annoying. However, for commercial software it is at the same time very unlikely that someone wants to switch out the Qt libraries.)
  • Qt Shift Key - Must Press Twice

    Unsolved shift-problems key-problems web-view-sub
    3
    0 Votes
    3 Posts
    162 Views
    J
    Qt 6.7.2 (Newest I think) on macOS 13.6.2 (newest for Ventura), Intel core.
  • Windows permissions error

    Unsolved
    6
    0 Votes
    6 Posts
    275 Views
    jsulmJ
    @Bryan-Kelly said in Windows permissions error: The error is specific to a Qt created directory so I suspect this is not an anti-virus problem How so? A anti virus software also observes stuff which is created...
  • how to solve the problem lnk error

    Unsolved
    7
    0 Votes
    7 Posts
    298 Views
    Christian EhrlicherC
    You can not mix c++ libraries compile for MinGW and MSVC.
  • QCommandLineParser print data to dos window

    Unsolved
    9
    0 Votes
    9 Posts
    365 Views
    G
    Thanks a lot! I use the "qInstallMessageHandler" to solve the issue and show the printed result in dos window. I think the topic is finished perfectlly and thank you for the help, BTW how to set the topic as solved?
  • Multisampling maximum available samples

    Unsolved
    2
    0 Votes
    2 Posts
    217 Views
    J
    I have the exact same question. Any luck?
  • how to use sqlcipher in QT6 on linux ?

    Unsolved
    5
    0 Votes
    5 Posts
    546 Views
    Christian EhrlicherC
    See https://github.com/chehrlic/qsqlcipher-qt6
  • QPainter/QChart/QSvgGenerator grab() vs render() problems

    Unsolved
    1
    0 Votes
    1 Posts
    97 Views
    No one has replied
  • Help with nstallation of Qt 5. Haven't found online installer for Qt 5 versions in 2024

    Unsolved
    7
    0 Votes
    7 Posts
    2k Views
    J
    @Emily-C said in Help with nstallation of Qt 5. Haven't found online installer for Qt 5 versions in 2024: Re: [Qt Creator](how to install older version?) I can't find any online installer of Qt 5 versions. And I'm not being able to do the installation from source code. I need specifically one of the Qt 5, preferably 5.15.14, required by Geant4. Any help on where to find the online installer of these versions? In this link: https://download.qt.io/archive/online_installers/ there are no online installers for any version 5. Thanks in advance! Have you tried installing it on Ubuntu? I remember that "sudo apt install qtcreator" installs version 5.10, if I'm not mistaken.
  • How does the stackedWidget manage its pages?

    Solved
    9
    0 Votes
    9 Posts
    443 Views
    J
    @mpergand Thank you for the tip, but my book doesn't have a lot of content to load into a txt file. In fact, it consists of hundreds of short chapters, so loading doesn't take much time. I've divided it so that it opens one chapter at a time, specifically to make it quick when loading a chapter. But thank you for the advice; when I need it, I'll use 'preloading/caching'. As mentioned earlier, I want to learn the best way and avoid going down wrong paths only to have to correct them later.
  • 1 Votes
    1 Posts
    128 Views
    No one has replied
  • Unable to run video with QT Mediaplayer in one of my computers

    Unsolved
    8
    0 Votes
    8 Posts
    323 Views
    SGaistS
    You're welcome ! What was the issue ?
  • createEditor of a custom widget is not being called. How to debug?

    Unsolved
    16
    0 Votes
    16 Posts
    570 Views
    A
    Actually, I've begun to put the std::map approach to use it in the other models too, because it is much less awkward. When I'm done with that, I will show the code especially, if I encounter any errors. Thanks for your help, anyway.