Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.5k 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.
  • QWidget not resizing because of Q3DScatter

    8
    0 Votes
    8 Posts
    126 Views
    SGaistS
    That I understood but there's no information whether that widget is set as central widget of your QMainWindow subclass or if it's floating around. Hence my request of providing a minimal compilable example with a widget that we can use.
  • How to load "symbolic" icons respecting the dark/light mode?

    Unsolved
    1
    0 Votes
    1 Posts
    17 Views
    No one has replied
  • Pfx certificate file and Microsoft Store

    Unsolved
    2
    0 Votes
    2 Posts
    37 Views
    I
    If you bundle your applications as a MSIX file, Microsoft will sign them for you after you submit them to the store. If you want to publish a traditional installer, you need to sign it yourself. PFX certificates are no longer issued for code signing by trusted CAs, only cloud signing or HSM is allowed (when you buy a new certificate, you can get a small security token shipped to you that holds the private key for the certificate). I don't know what your idea of "low price" is, but $300-$500 is about what those things cost. There are CAs that subsidize most of the cost for Open Source projects.
  • How to register application to handle custom uri:// scheme?

    Unsolved
    5
    0 Votes
    5 Posts
    2k Views
    JKSHJ
    https://doc.qt.io/qt-6/qdesktopservices.html#setUrlHandler does it for macOS/iOS/Android, but not for Windows/Linux I believe
  • Issue with QLabel and wordwrap

    Solved
    26
    0 Votes
    26 Posts
    517 Views
    B
    @PLL3 said in Issue with QLabel and wordwrap: Out of curiosity I tried it, and it had the same result as adding a spacer item after my QLabel, ie it squishes it to the left and forces it to wrap as much as it can. Yes, as the example code I posted above shows, I met this problem exactly when I'm using alignment in layout :) @PLL3 said in Issue with QLabel and wordwrap: QRect boundingRect1 = fm.boundingRect(_label->rect(), _label->alignment(), _label->text()); Oh, flags is not the same as alignment, the way you call it still doesn't tell that you want text to wrap. So here it should be something like fm.boundingRect(_label->contentsRect(), _label->alignment() | Qt::TextWordWrap, _label->text()) contentsRect() is not the exact rect value that Qt use to draw text, but is the closest one in my opinion. If you want to be more accurate you can check the Qt source code of QLabel::paintEvent, but maybe not very necessary.
  • Problem with location of resources (svg icons) in subdir project with cmake

    Solved
    7
    0 Votes
    7 Posts
    63 Views
    S
    Well, for future reference, I solved the thing by adding the images' folder to the app subdir, not to the gui subdir where these resources are mandatory. <project root> ├── CMakeLists.txt └── src ├── app │ ├── images │ │ ├── document-new.svg │ │ └── document-open.svg │ ├── CMakeLists.txt │ └── main.cpp ├── core │ ├── CMakeLists.txt │ ├── core.cpp │ └── core.h └── gui ├── CMakeLists.txt ├── mainwindow.cpp └── mainwindow.h and editing the corresponding CMakeLists.txt file with the qt_add_resources function! I had tried it before, but without quoting the <RESOURCE NAME> ("app_images" in my case) and that was probably the reason the PREFIX "/" was throwing an error. qt_add_executable(myapp main.cpp) qt_add_resources(myapp "app_images" PREFIX "/" FILES images/document-new.svg images/document-open.svg ) target_link_libraries(mayapp PRIVATE Qt6::Widgets core gui) set_target_properties(myapp PROPERTIES WIN32_EXECUTABLE ON MACOSX_BUNDLE ON ) This way, there is no need to write a resources (.qrc) file on app subdir
  • Laying out items/widgets without stretching/spacing

    Solved
    11
    0 Votes
    11 Posts
    185 Views
    JonBJ
    @Bonnie I have now had a chance to play with this. hlayout->setAlignment(Qt::AlignLeft) was 100% what I had in mind (and e.g. AlignRight or AlignHCenter)! Thank you, I just could not find it. Marking your post as the correct answer. I really don't know why other people/Googling/ChatGPT don't seem to mention this, and all claim you need to do it with "spacers" or "stretchers". Those are cumbersome when QLayoutItem::setAlignment() is simpler and better at the job....
  • MSIX (for Windos App Store) can't find entry point

    Unsolved
    2
    0 Votes
    2 Posts
    35 Views
    SGaistS
    Hi, I think this thread might be what you are looking for. Hope it helps
  • Can't seem to get shaders to work.

    Unsolved
    2
    0 Votes
    2 Posts
    60 Views
    J
    Hey! It seems like it is impossible to pass javascript arrays to ShaderEffect shader parameters. I have been looking for a solution for this in pure QML as well. The best workaround is to pass an image and use the channels as info, this is prone to floating point precision issues though. https://bugreports.qt.io/browse/QTBUG-50493
  • Layout of fixed size objects and one object that changes size

    Unsolved qframe qlineedit
    2
    0 Votes
    2 Posts
    33 Views
    SGaistS
    Hi, AFAIK, the only way to do that would be to remove the widget from the layout it's in and you manage yourself its new independent life (e.g. resizing and moving).
  • Problem with transparent background using Inkscape SVG icons in Qt

    Unsolved
    2
    0 Votes
    2 Posts
    45 Views
    jsulmJ
    @buhtz You can see here what is supported by Qt: https://doc.qt.io/qt-6/svgextensions.html
  • class "has not been declared" in moc file though in class include is correct.

    Unsolved
    13
    0 Votes
    13 Posts
    307 Views
    L
    Thanks for your interest. They are there https://forum.qt.io/topic/163508/headers-not-found/4 Unfortunately, after solving these problems the same type of issue reappeared. ChatGPT pretends that this is because file name should be capitalised exactly the same as the class name which I find hard to believe. For now I am trying another way with the old .pro file.
  • Using QtCharts in a Pyside6 Application

    Unsolved
    2
    0 Votes
    2 Posts
    89 Views
    C
    I am seeing the exact same problem. However, I let AI generate some QML Chart code and the application works. It would be nice to have code completion working.
  • Swapping columns on QTreeView causes row highlight to disconnect

    Solved
    3
    0 Votes
    3 Posts
    61 Views
    P
    @Christian-Ehrlicher Thanks for your response. I was worried that might be the case. Changing the model or implementing a proxy model will be a bigger change to the code, but should be doable.
  • QIcon::pixmap() returns image double the size requested

    Unsolved
    7
    0 Votes
    7 Posts
    704 Views
    J
    i've bypassed it using : QSize iconSize(16, 16); QPixmap img = QIcon::fromTheme("folder-alt").pixmap(iconSize).scaled(iconSize, Qt::KeepAspectRatio, Qt::SmoothTransformation); qDebug() << img;
  • partially update default stylesheet

    Unsolved
    26
    0 Votes
    26 Posts
    880 Views
    SGaistS
    @SimonSchroeder Native styles are implemented such that they follow the original platform style and are thus free to ignore modified palette values to stay coherent. Thus, depending on what you want to change, you will need to check what the original style does underneath. I am not claiming that it's simple for everything, far from it. Many times, it's a question of re-implementing drawPrimitive to either call the base class implementation with modified values or having your own implementation based out of the original class.
  • getting the issues with QDialog

    Unsolved
    5
    0 Votes
    5 Posts
    72 Views
    S
    This is my dialog — when it’s created, a faint shadow briefly appears on the left margin for a fraction of a second. It doesn’t happen every time, but it occurs occasionally
  • Weird behavior of QT windows on Linux

    Solved
    13
    0 Votes
    13 Posts
    282 Views
    deisikD
    The solution was to make the main window stay on bottom with the Qt::WindowStaysOnBottomHint flag set (yes, I can live with that) But if you have other ideas, please share
  • Headers not found

    Unsolved
    4
    0 Votes
    4 Posts
    72 Views
    L
    Seems to be solved by set(CMAKE_INCLUDE_CURRENT_DIR ON) but not quite sure (I have other errors). Why the ui compiler would include with < and < instead of " " ?