Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • Using breakpad on qt slots

    Unsolved
    1
    0 Votes
    1 Posts
    177 Views
    No one has replied
  • How to remove qt_static_metacall errors for removed signal

    Solved
    3
    0 Votes
    3 Posts
    830 Views
    jsulmJ
    @agmar said in How to remove qt_static_metacall errors for removed signal: because it always comes back after some time Because this is generated code! Simply do a complete rebuild: delete build folder, run qmake and build.
  • How to Implement the coding part of this UI Integration?

    Solved
    23
    0 Votes
    23 Posts
    3k Views
    Aviral 0A
    @JonB Thankyou for your help too! really appreciate efforts!
  • serialport considerations for linux

    Solved
    6
    0 Votes
    6 Posts
    855 Views
    JonBJ
    @agmar Put the open() as the first thing in openSerial() (actually immediately after the setPortName()). Always check the return result of any open()s. Remove the open() from writeAll().
  • Very long project build times after including QCustomPlot

    Unsolved
    21
    0 Votes
    21 Posts
    3k Views
    JonBJ
    @lukutis222 I wrote in my previous what I suggest you do.
  • QStandardItem pointer loses value after leaving function

    Solved
    10
    0 Votes
    10 Posts
    907 Views
    S
    @gsephelec said in QStandardItem pointer loses value after leaving function: I just couldn't get my head around what I was missing. Well, this is a very rare case and will likely slip through for many C++ programmers. Here is one way to think about this: QStandardItem * passes a copy of the pointer to the function. This is why you change only the copy of the pointer to point to a different object. Hence why others have suggested to use a reference or pointer to the pointer you want to modify.
  • QQuickImageProvider - unload Images / free memory

    Unsolved
    2
    0 Votes
    2 Posts
    349 Views
    jeremy_kJ
    @SeDi said in QQuickImageProvider - unload Images / free memory: Hi, who owns an image provided by QQuickImageProvider? Does it belong to the displaying QML element or to C++/the provider? Does that depend on the use of the QQIP cache? The function signature indicating an object rather than a reference or pointer makes it clear that the provider does not own the image returned to the QML engine. https://doc.qt.io/qt-6/qquickimageprovider.html#requestImage QImage QQuickImageProvider::requestImage(const QString &id, QSize *size, const QSize &requestedSize) How can I make sure that only a small number of pictures is being held in memory? I have not found anything like a "removeImage()" method. https://doc.qt.io/qt-6/qquickimageprovider.html#image-caching Images returned by a QQuickImageProvider are automatically cached, similar to any image loaded by the QML engine. When an image with a "image://" prefix is loaded from cache, requestImage() and requestPixmap() will not be called for the relevant image provider. If an image should always be fetched from the image provider, and should not be cached at all, set the cache property to false for the relevant Image or BorderImage object. So the decision is made by the consumer of the image, rather than the provider or engine. The provider can of course maintain its own private cache. I have thought about using a QQuickImageProvider to provide hundreds of photos from C++ to QML. I only need about 5-15 of them at a time After their use they have to be deleted from memory, because the user may browse through loads of them and I don't want that excessive use of memory. Does implementing the application using the framework-provided image providers result in acceptable memory usage? I would expect roughly similar consumption.
  • QMessageBox::warning on secondary thread

    Solved
    16
    0 Votes
    16 Posts
    1k Views
    S
    Your approach is good (and working). You can still avoid some hassle by using lambdas instead. Here is what we basically do in our software: QMetaObject::invokeMethod(qApp, [&errorMessage](){ QMessageBox{icon, "DeepSkyStacker", errorMessage}.exec(); }); Please note that your thread will just continue running before the message box might even be shown. Sometimes you might want to wait for a response by the user. For this we need extra synchronization. I've put several use case into a nice little header-only library: https://github.com/SimonSchroeder/QtThreadHelper You can have a look how you might solve some of the problems.
  • Clear example for drawing lines & areas(polygons) in rtsp video frame with mouse

    Unsolved
    4
    0 Votes
    4 Posts
    352 Views
    jsulmJ
    @RahibeMeryem Did you actually read my previous post? Or why do you ask me same question again?
  • This topic is deleted!

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

    Unsolved
    1
    0 Votes
    1 Posts
    26 Views
    No one has replied
  • QObject: Cannot create children for a parent that is in a different thread

    Solved qttcpsocket
    3
    0 Votes
    3 Posts
    374 Views
    W
    @Christian-Ehrlicher thanks. it had solved.
  • This topic is deleted!

    Unsolved
    2
    0 Votes
    2 Posts
    4 Views
  • How to check whether the computer connects the internet?

    Unsolved
    30
    1 Votes
    30 Posts
    18k Views
    Kent-DorfmanK
    @adazem009 Some variant of this question surfaces every few months, almost always initiated by someone who really does not understand what the internet is. InterNet in itself is an ambiguous term. It is a network of interconnected networks. There is no internet point of authority to ping with and come to the conclusion "I can reach the internet". It is by nature designed so that some segments may be reached even if other large portions are down. So, you need to be very specific with your intentions and expectations when branching outside of your LAN (local area network).
  • How to transfer a QMap from one function to another.

    Unsolved
    6
    0 Votes
    6 Posts
    464 Views
    SGaistS
    @kipalex the conflict is notified to you through the warning (ALWAYS FIX THE WARNINGS).
  • QChart suitability?

    Unsolved
    2
    0 Votes
    2 Posts
    226 Views
    SGaistS
    Hi, I think you should be able to achieve this with QCharts. Otherwise, projects worth taking a look at: Qwt QCustomPlot Check their licenses to see if they fit your needs.
  • UI Themes?

    Unsolved
    9
    0 Votes
    9 Posts
    1k Views
    PerdrixP
    @Axel-Spoerl 👏Thanks a lot
  • QThread::exit documentation seems wrong

    Solved qthread exit quit
    5
    0 Votes
    5 Posts
    1k Views
    S
    @Christian-Ehrlicher It took me a whole day, but I finally understood that you were referring to the fact that exit()/quit() can't be used in the same vein as requestInterruption()/isInterruptionRequested() or terminate(). I first learned about basic QThread semantics so long ago (more than a decade I think), that the fact that it's possible to not understand that got completely lost on me.
  • No stretch settings in QML Layouts?

    Unsolved
    2
    0 Votes
    2 Posts
    1k Views
    M
    Here's a specific example of how QML Layouts appears to be broken. I have a GridLayout with 4 colums and 5 rows. The cells in the 3th column each contain a GroupBox and with "Layout.fillWidth: true" in each GroupBox, the 3rd column expands when the app width is increased. That's what I want. However in the top cell of the 4th column, I want to have text which is right and top aligned within the cell. QML won't let me do it. I've tried various alignments and anchors, tried putting the text in a Rectangle & child GridLayout within the parent cell and with addition Rectangles (inside the child GridLayout) to push the text to the top right corner, and even tried used "Layout.fillWidth: true" in the Rectangle. Nothing works, and "Layout.fillWidth: true" causes the 4th column to expand at the same rate as the 3rd column, which is not what I want. Am I missing something obvious? Thanks, Michael
  • Subclassing QThread and signals/slots?

    Solved
    6
    0 Votes
    6 Posts
    757 Views
    JonBJ
    @mjsmithers A warning for what? This has nothing to do with QThread particularly, any QObject-derived class will have this issue. And Qt (Creator) is not a compiler, your compiler is external, so it could not "provide a warning".