Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • Qt QGraphicsScene AddWidget QSvgWidget

    Unsolved
    5
    0 Votes
    5 Posts
    622 Views
    A
    Why don't you use QGraphicsSvgItem instead? Using a proxy widget will add all kinds of nasty surprises, one of them being that the content of the embedded widget does not scale nicely by default.
  • filePathName

    Unsolved
    2
    0 Votes
    2 Posts
    140 Views
    mrjjM
    Hi What code do you have now? Anyway, something like this https://amin-ahmadi.com/2016/01/04/qt-drag-drop-files-images/
  • Arm architecture opencv qt not working properly

    Unsolved
    10
    0 Votes
    10 Posts
    877 Views
    SGaistS
    What did you implement to make it work ?
  • 0 Votes
    3 Posts
    210 Views
    Christian EhrlicherC
    Dupe of https://forum.qt.io/topic/125644/qt-6-0-adaptation-warning-string-is-deprecated-use-qmetatype-type-instead-how-to-solve ... wonder why it's so hard to read the error message. It contains the answer...
  • 0 Votes
    2 Posts
    376 Views
    SGaistS
    Hi, The answer is in the warning: QMetaType::Type enumeration.
  • 0 Votes
    15 Posts
    19k Views
    B
    QProcess has quite extensive support for synchronous use. #include <QCoreApplication> #include <QDebug> #include <QProcess> int main(int argc, char **argv) { QCoreApplication app(argc, argv); QProcess process; process.start("ls", {"-l"}); if (process.waitForFinished()) { qDebug() << "returned:" << process.readAllStandardOutput(); } else { qDebug() << process.errorString(); } process.start("ls", {"-l"}); while (process.waitForReadyRead()) { while (process.canReadLine()) qDebug() << process.readLine().trimmed(); } }
  • QAbstractItemView::setSelectionModel failing

    Solved
    6
    0 Votes
    6 Posts
    1k Views
    K
    Alright I had some stuff commented out that took me forever to debug, but I got it! So the piece I was missing is that a View has both a Model and a SelectionModel. Obviously this is listed in the documentation, but I missed it. Here's the chunk of documentation regarding that: Handling selections of items The mechanism for handling selections of items within views is provided by the QItemSelectionModel class. All of the standard views construct their own selection models by default, and interact with them in the normal way. The selection model being used by a view can be obtained through the selectionModel() function, and a replacement selection model can be specified with setSelectionModel(). The ability to control the selection model used by a view is useful when we want to provide multiple consistent views onto the same model data. Anyway, so it turns out all I needed was a subclass of QStringListModel to handle my data that I had already made, and I got lost in the sauce trying to turn that into a QItemSelectionModel, thinking it was a direct replacement for a Model. I guess I feel like it could be more clear that a View has both a Model and a SelectionModel attached as soon as you give it a Model, but it's there in the docs so I guess it's on me. :) Thanks for the help!
  • Cross-compiling Qt for Linux on Windows

    Solved
    7
    0 Votes
    7 Posts
    10k Views
    Pablo J. RoginaP
    @Donald-Duck said in Cross-compiling Qt for Linux on Windows: it worked. great. So please don't forget to mark your post as solved!
  • [Q3D] Object picking backend

    Unsolved
    1
    0 Votes
    1 Posts
    140 Views
    No one has replied
  • 0 Votes
    5 Posts
    1k Views
    B
    @nagesh thank you it solved i did the QRegisterMetaType just before connecting the signal to slot
  • Have vertical scrollbar below horizontal qheaderview

    Unsolved
    4
    0 Votes
    4 Posts
    362 Views
    S
    One mediocre fix would be to set the stylesheet of the vertical scoll bar to have enough padding at the top. However, this will not extend the header view all the way to the right. Another quick hack would be the following: permanently disable the vertical scrollbar of the table widget create your own QScrollBar which you place perfectly on top of the QTableWidget subscribe to the the table widget's resize and move events to resize and move your scrollbar accordingly (use inheritance or use installEventFilter() to be notified of size/position changes) connect your own scrollbar back to the table widget
  • QLabel How to change background color and have a border without stylesheet?

    Unsolved
    5
    0 Votes
    5 Posts
    3k Views
    S
    I would really suggest to go with a stylesheet. I don't see a reason why not (never had any issues that it would be too slow or anything). Changing the palette might work for some widget types on some platforms. If you use the native style on Windows or Mac OS you will eventually run into problems that you cannot change any part of the palette to influence some of the colors. You could try to use proxy styles to change colors of certain widgets. But, this is very messy compared to just plain stylesheets. Qt used to have setBackgroundColor() at one point, but it slowly faded out. So, as long as you don't have any specific good reason to not use stylesheets, go with stylesheets as they will make your life a lot easier. (I personally wish as well that we did not have to use stylesheets. After fighting it for quite a while I finally gave in because there is no better way in Qt.)
  • How to detect mainWindow size changment ?

    Unsolved
    2
    0 Votes
    2 Posts
    180 Views
    Christian EhrlicherC
    @AuLoMa said in How to detect mainWindow size changment ?: I don't find any slot or signal for this. See QWidget::resizeEvent()
  • This topic is deleted!

    Unsolved
    11
    0 Votes
    11 Posts
    93 Views
  • /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5.15' not found

    Solved
    7
    0 Votes
    7 Posts
    27k Views
    jsulmJ
    @m4t1 Did you try export LD_LIBRARY_PATH=HERE_PATH_TO_QT_LIBS_DIR && ./my_app ?
  • Code running in 5.12, but not in 5.15 or higher

    Solved
    5
    0 Votes
    5 Posts
    398 Views
    T
    It is solved - I had to find some updates for external libraries and the problem was gone.
  • Why is it wrong to write this in a header file?

    Solved
    15
    0 Votes
    15 Posts
    1k Views
    J.HilkJ
    @SGaist mmh 🤔 right, May be a better approach, than what I currently have. I'll have to test it. Thanks!
  • QTableWidget cellwidget set invisible become visible after column resize

    Solved
    10
    0 Votes
    10 Posts
    1k Views
    Christian EhrlicherC
    Dupe of https://bugreports.qt.io/browse/QTBUG-13522 - don't use widgets in itemviews. We really should have deprecate this widget inside item views stuff in Qt6...
  • 32-bit and 64-bit

    Solved
    2
    0 Votes
    2 Posts
    224 Views
    nageshN
    @canid as per qt doc.. On Windows, for 32-bit programs running in WOW64 mode, settings are stored in the following registry path: HKEY_LOCAL_MACHINE\Software\WOW6432node I feel 32 bit & 64 bit application registry locations are different..
  • Running qt on external computer

    Unsolved
    2
    0 Votes
    2 Posts
    162 Views
    JKSHJ
    @georgiav said in Running qt on external computer: Can I run my program on an external computer that doesn't have qt? Yes you can. Just deploy your application: https://doc.qt.io/qt-5/deployment.html for the open source version of qt, the application built can be run only within Qt , right? Nope, for 2 different reasons: The whole purpose of free and open-source software is to guarantee freedoms to users. So, you have the freedom to run the application anywhere you want. You're thinking about running the application within Qt Creator, the IDE (Integrated Development Environment). Qt is a library. Qt is not Qt Creator.