Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • This topic is deleted!

    Unsolved
    2
    0 Votes
    2 Posts
    10 Views
  • Building a DLL on macOS for a non Qt application

    Solved mac dll macos thread
    9
    0 Votes
    9 Posts
    2k Views
    B
    @IgKh Thank you for your precious help, things are a lot clearer now. Further tests have shown that most of the features I need still work without a call to exec(). I still can't quite understand what in my example started the event loop or if Qt just plugs in the existing NSApplication's event loop. @IgKh said in Building a DLL on macOS for a non Qt application: Had no effect on the main issue though Can you, just for sake of clarity, state the remaining issues? The main issue i refered to was me wanting to have a separate thread with a QApplication in it and the Qt::AA_PluginApplication attribute had no effect on this. The other issues I have are not within the scope of this topic though. Thank you very much !
  • CMake + Qt6: Unable to Find <QNetworkAccessManager> header

    Solved
    5
    0 Votes
    5 Posts
    605 Views
    JonBJ
    @IPlayGenji6 Have a look carefully at the actual compiler statements generated for these two source files during build. So far as I know include paths are not passed by setting environment variables so you should see a difference in the -I... options, else it would be inexplicable/something deeper. This assumes " it fails to find the header file" is an actual error generated during compilation? If it's only while editing inside Creator then it's from the Code Model only, and that sometimes gets stuff wrong for unknown reasons.
  • How to get ROI of QVideoFrame?

    Solved
    17
    0 Votes
    17 Posts
    1k Views
    M
    If somebody is interested in the soultion: #include <QObject> #include <QAbstractVideoFilter> #include <QVideoFilterRunnable> #include <QAbstractVideoFilter> #include <QVideoFrame> #include <QDebug> #include <QThread> #include <QFuture> #include <QtConcurrent/QtConcurrent> #include <QOpenGLContext> #include <QOpenGLFunctions> #include <QQmlContext> #include "private/qvideoframe_p.h" ... QImage MyVideoFilterRunnable::QVideoFrameToQImage(const QVideoFrame& videoFrame) { if ( videoFrame.handleType() == QAbstractVideoBuffer::NoHandle ) { QImage image = qt_imageFromVideoFrame( videoFrame ); if ( image.isNull() ) { return QImage(); } if ( image.format() != QImage::Format_ARGB32 ) { image = image.convertToFormat( QImage::Format_ARGB32 ); } return image; } if ( videoFrame.handleType() == QAbstractVideoBuffer::GLTextureHandle ) { QImage image( videoFrame.width(), videoFrame.height(), QImage::Format_ARGB32 ); GLuint textureId = static_cast<GLuint>( videoFrame.handle().toInt() ); QOpenGLContext* ctx = QOpenGLContext::currentContext(); QOpenGLFunctions* f = ctx->functions(); GLuint fbo; f->glGenFramebuffers( 1, &fbo ); GLint prevFbo; f->glGetIntegerv( GL_FRAMEBUFFER_BINDING, &prevFbo ); f->glBindFramebuffer( GL_FRAMEBUFFER, fbo ); f->glFramebufferTexture2D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, textureId, 0 ); f->glReadPixels( 0, 0, videoFrame.width(), videoFrame.height(), GL_RGBA, GL_UNSIGNED_BYTE, image.bits() ); f->glBindFramebuffer( GL_FRAMEBUFFER, static_cast<GLuint>( prevFbo ) ); return image.rgbSwapped(); } return QImage(); } QVideoFrame MyVideoFilterRunnable::run(QVideoFrame *input, const QVideoSurfaceFormat &surfaceFormat, RunFlags flags) { ... m_filter->m_frame.copyData(*input); QImage img = QVideoFrameToQImage( *input ); QImage imgRoi = img.copy(xMin, yMin, width, height); QVideoFrame frameRoi = QVideoFrame(imgRoi); *input = frameRoi; m_filter->m_processThread = QtConcurrent::run(this, &MyVideoFilterRunnable::processVideoFrame, m_filter->m_frame); return *input; }
  • Scroll bar overlaps on MAC only

    Unsolved
    5
    0 Votes
    5 Posts
    523 Views
    W
    This has nothing to do with QT, it's the way scroll bars look on recent Macs, when using the trackpad only. When you plug in a mouse, the scrollbars change back to the familiar style. I have dialog elements that I want to line up with the contents of a QTableView, but I can't find any dimensions, anywhere that show a difference between the different views, even though they are obviously different sizes. You'd think it would have to be obvious, but none of the widget's dimensions change in any way that I can find. I also notice that there are no events reported to the app when the scrollbars change. Just a Paint event. Even though the widget in the scroll area changes size, there is no Resize event.
  • Unexpected message from exe build using CMake

    Unsolved
    2
    0 Votes
    2 Posts
    174 Views
    Axel SpoerlA
    Hi David, For some reason, QML debugging seems to be enabled. You can disable it here: https://doc.qt.io/qtcreator/creator-debugging-qml.html Cheers Axel
  • How to solve error messages when converting a QMake .pro file to a CMake .txt file?

    Solved
    3
    0 Votes
    3 Posts
    299 Views
    B
    @Bonnie WOW! It works like a charm. Thank you SO MUCH!!!
  • 0 Votes
    2 Posts
    254 Views
    Christian EhrlicherC
    Normally you don't set any fixed values for layouts or widgets so no - no snapping since not needed in the normal usecase.
  • Is "About Qt" dialog HTML or text content available in Qt5 API?

    Solved about qt aboutqt qt version
    10
    0 Votes
    10 Posts
    6k Views
    F
    @GrecKo Thank you very much. That is a much cleaner solution and much more secure. I wrote a small class that also deals with unregistration in a RAII way today. Works like a charm.
  • QHeaderView vertical headers do not change background color

    Solved
    7
    0 Votes
    7 Posts
    601 Views
    D
    To solve this, I ended up creating a subclass of the QHeaderView and added my background color logic (background using the background role of the underlying model associated) inside thepaintSection method.
  • What is the difference between QSizePolicy::Expanding and QSizePolicy::Ignored?

    Unsolved
    6
    0 Votes
    6 Posts
    654 Views
    F
    QSizePolicy::Expanding has 3 flags: GrowFlag | ShrinkFlag | ExpandFlag QSizePolicy::Ignored has 3 flags: ShrinkFlag | GrowFlag | IgnoreFlag Both have GrowFlag and ShrinkFlag, but one has ExpandFlag, and the other one has IgnoreFlag. I know that only with the ExpandFlag I can use the QSizePolicy::expandingDirections() function, but I want to know the behavioral difference. From the descriptions of these two flags, it seems that maybe there are cases of using the ExpandFlag when the widget does not get as much space as possible. What are these cases?
  • This topic is deleted!

    Unsolved
    3
    0 Votes
    3 Posts
    25 Views
  • CMake QT_INSTALL_BIN_DIR not set to the value of CMAKE_INSTALL_BINDIR as expected

    Unsolved
    3
    0 Votes
    3 Posts
    411 Views
    PerdrixP
    Hmm - good question but it was there until a few moments back and removing it didn't change the behaviour. This thread now superseded, please see: https://forum.qt.io/topic/159565/problems-with-qt_deploy_runtime_dependencies
  • qt.network.ssl: QSslSocket::connectToHostEncrypted: TLS initialization failed

    Unsolved qt6.6 tls
    6
    0 Votes
    6 Posts
    2k Views
    M
    @TLaren And where can I find this plugin and where should I copy it?
  • How to solve the error message: "Could not create pixmap..."?

    Solved
    5
    0 Votes
    5 Posts
    1k Views
    B
    I created a .qrc file and it worked! Thank you!
  • How can I make my app ignore window's "HIGH DPI SCALING"?

    Solved widgets dpi awareness scaling
    15
    0 Votes
    15 Posts
    13k Views
    V
    Found the proper option: QT_ENABLE_HIGHDPI_SCALING=0.
  • qgraphicsscene remove item but sometime still in view

    Unsolved
    14
    0 Votes
    14 Posts
    2k Views
    JonBJ
    @StudentScripter said in qgraphicsscene remove item but sometime still in view: calling remove onto the other items the programm crashes cause there is still the flag "isVisible" given back on remove. Is it in this case fine to just case setVisible(false) and than scene()->removeItem(), because than it don't crashes. First, why do you care about isVisible() or setVisible() at all in your situation? Once you removeItem() the QGraphicsItem will no longer be shown on the scene/view so it's not relevant. But given that you want to use it. After removeItem() the item no longer belongs to the scene in any way. I would guess that QGraphicsItem::visible() needs to access the scene from the item in order to do whatever calculations are required for "visibility". But for a removed item the scene is probably "undefined" (or maybe nullptr) and hence it "crashes". Do not call any methods on a QGraphicsItem once it has been removed from the scene. If you really want to set/test visibility do so before removeItem().
  • CMake and windeployqt

    Solved
    9
    0 Votes
    9 Posts
    996 Views
    S
    @Perdrix said in CMake and windeployqt: PS What about a linux version of windeployqt which seems notable by its absence :( We are using a combination of linuxdeploy and linuxdeployqt. I don't fully remember, but linuxdeploy is better at creating the initial AppDir for the AppImage. In a second step we are using linuxdeployqt to add the .so files for Qt. A huge downside of these tools is that they refuse to work on the most recent Linux distros as their intent is to support as many Linux versions as possible. So, most likely you cannot use these tools during development (unless you setup an old Linux machine for development).
  • Handling existing VS2022 solution's translation files when converting to CMake

    Unsolved
    1
    0 Votes
    1 Posts
    127 Views
    No one has replied
  • 0 Votes
    2 Posts
    375 Views
    Christian EhrlicherC
    What exact Qt version do you use? I would guess it's 6.7.0 or similar with the new windows11 style which has some bugs. Either upgrade to 6.8.x or use the windowsvista style in between.