Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.6k Posts
  • How to implement smoothly updating map in Qt Widgets app?

    Solved
    4
    0 Votes
    4 Posts
    632 Views
    I
    @IgKh I used this method and it worked as needed: def update_map(self, new_coords: tuple[float, float]): self.folium_map.location = new_coords # keep it for next calculation because JavaScript doesn't update it map_name = self.folium_map.get_name() js_code = f'{map_name}.setView({list(new_coords)})' # Use `list()` because JS needs `[ ]` instead of `( )` self.page().runJavaScript(js_code) Thanks for the answer.
  • class QList<QString> has no member named 'emplace_back'

    Solved
    4
    0 Votes
    4 Posts
    483 Views
    M
    Ok I fixed it somehow in CMakeLists. CMakeLists.txt had find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets) I removed Qt5 from there set(PROJECT_SOURCES did NOT have the files I had added while building the program. They were being added later in the else-clause in cmake logic so I added the missing ones to PROJECT_SOURCES. The code below was the situation before the fix set(PROJECT_SOURCES main.cpp mainwindow.cpp mainwindow.h mainwindow.ui ) if(${QT_VERSION_MAJOR} GREATER_EQUAL 6) qt_add_executable(Gridlink MANUAL_FINALIZATION ${PROJECT_SOURCES} ) # Define target properties for Android with Qt 6 as: # set_property(TARGET Gridlink APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR # ${CMAKE_CURRENT_SOURCE_DIR}/android) # For more information, see https://doc.qt.io/qt-6/qt-add-executable.html#target-creation else() if(ANDROID) add_library(Gridlink SHARED ${PROJECT_SOURCES} ) # Define properties for Android with Qt 5 after find_package() calls as: # set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android") else() add_executable(Gridlink ${PROJECT_SOURCES} searchview.h searchview.cpp searchview.ui mpd_communication.h mpd_communication.cpp libraryview.h libraryview.cpp libraryview.ui artistview.h artistview.cpp artistview.ui albumview.h albumview.cpp albumview.ui datahandler.h datahandler.cpp config.h config.cpp song.h song.cpp album.h album.cpp ) endif() endif()
  • How to add discord game sdk to a QtWidgets app using cmake

    Unsolved
    2
    0 Votes
    2 Posts
    289 Views
    SGaistS
    Hi, A quick search for discord SDK cmake turns two project on GitHub that proposes cmake integration for the SDK. You should check them.
  • Showing video from a rtsp ip camera

    Solved
    3
    0 Votes
    3 Posts
    4k Views
    R
    I found an onvif client that plays rtsp streams with practically no delay, the library written in c++ with visual studio 2019 is available, but the program's source code is paid, it's expensive, the installed program has qt6 dll. https://www.happytimesoft.com/products/onvif-client/index.html Another open source alternative is ffplay from ffmpeg, very little delay. Supports H.264 and H265.
  • MacOS and MS Shell Dlg 2

    Unsolved
    9
    0 Votes
    9 Posts
    2k Views
    I
    @Perdrix Nothing, normally. Elements that need to use the UI font should be allowed to fall back to the application default font.
  • 0 Votes
    2 Posts
    294 Views
    Christian EhrlicherC
    @Will said in Radio button circle becomes colored in when using a scroll area Qt6 on Windows: Question 1: Is this normal / expected? Yes since it's the windows 11 style Question 2: Can this be turned off? Yes, use the windowsvista style: https://doc.qt.io/qt-6/qstyle.html#setting-a-style
  • UI Builder

    Unsolved
    14
    0 Votes
    14 Posts
    1k Views
    Y
    Ok. is it ok if I post a screenshot of MainMenu here ?
  • Qt 6 CUDA to OpenGL performance loss

    Unsolved
    2
    0 Votes
    2 Posts
    221 Views
    SGaistS
    Hi and welcome to devnet, Intriguing issue ! I would recommend bringing it to the interest mailing list. You'll find there Qt developers/maintainers. This forum is more user oriented.
  • Have a doubt if the 5.15 is end how to use the same version for futue

    Unsolved hibernate
    5
    0 Votes
    5 Posts
    652 Views
    S
    Thanks for the message @jsulm & @Christian-Ehrlicher
  • binary builds missing for macos

    Solved
    6
    0 Votes
    6 Posts
    549 Views
    G
    Turns out, that I'm just too stupid :-) macos builds have been renamed to "Desktop".
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • QAbstractListModel with QObject::event()

    Solved
    3
    0 Votes
    3 Posts
    313 Views
    R
    The correct solution in my scenario is to install an event filter. void SplashScreenListModel::append(const QString& name, QObject* item) { // Get dynamic property initialized value // If the returned variant is invalid, the property is not set yet QVariant v = item->property("initialized"); bool initStatus = false; if (v.isValid() && v.value<bool>()) initStatus = true; s_instance->beginInsertRows(QModelIndex(), s_instance->m_data.length(), s_instance->m_data.length()); s_instance->m_data.append(SPDataItem(name, item, initStatus)); s_instance->endInsertRows(); // Set name for identification in slot item->setObjectName(name); // Install eventfilter item->installEventFilter(s_instance.get()); } bool SplashScreenListModel::eventFilter(QObject* obj, QEvent* event) { if (event->type() != QEvent::DynamicPropertyChange) return QObject::eventFilter(obj, event); // Default processing // We have a QDynamicPropertyChangeEvent at hand QDynamicPropertyChangeEvent* pc = static_cast<QDynamicPropertyChangeEvent*>(event); // Not the correct dynamic property if (pc->propertyName() != "initialized") return QObject::eventFilter(obj, event); // Default processing // Value is false if (!obj->property(pc->propertyName()).value<bool>()) return true; QModelIndex idx = indexByName(obj->objectName()); setData(idx, true, SplashScreenListModel::InitializationRole); return true; }
  • stylesheet: etch around widget?

    Solved
    3
    0 Votes
    3 Posts
    237 Views
    D
    OMG QFrame!
  • Problem with graphics display in buttom after OS update

    Unsolved
    2
    0 Votes
    2 Posts
    163 Views
    SGaistS
    Hi and welcome to devnet, Which version of Qt are you using ?
  • emit signal without connecting to a slot can cause segmentation fault

    Unsolved
    2
    0 Votes
    2 Posts
    203 Views
    SGaistS
    Hi, You should run your application through a debugger. There's likely something else at play as emitting a signal without connection should not trigger any dangerous code path.
  • QTableView: hide vertical lines on windows?

    Unsolved
    14
    0 Votes
    14 Posts
    2k Views
    D
    i have 6.9 beta 2, it is NOT fixed. are you talking about 6.9 beta 3?
  • Procedure Entry Point Error in EXE After Deployment

    Unsolved
    4
    0 Votes
    4 Posts
    293 Views
    aha_1980A
    @Signal_Slayer: get_default_resource is from the C++ standard library. Check if you have deployed the MinGW runtime libs (like libstdc++-6.dll and libgcc_s_dw2-1.dll) You should find them in c:\Qt\Tools\mingw1120_64\bin or whereever your MinGW is installed. Regards
  • New file fails to register to QML module - how to debug?

    Solved
    7
    0 Votes
    7 Posts
    652 Views
    A
    @Redman Thanks, but unfortunately, there is no portable version of this header file available...
  • Stylesheet for a subset of widgets

    Solved
    12
    0 Votes
    12 Posts
    1k Views
    S
    @Simplicius-Simplicissimus said in Stylesheet for a subset of widgets: I see that my attitude originates from a time when I participated in the production of generated code and drafted documentation for a Design Pattern course. Mission statements like “Aggregation is better than Inheritance” left their mark. I know that currently there is a strong push against traditional OOP, especially inheritance. Inheritance is not a silver bullet and sometimes there are better solutions. But also, never using inheritance is also not a silver bullet. I'm not saying you should use inheritance instead of aggregation in general, but rather you should make an informed decision (instead of just blindly following rules like "Aggregation is better than Inheritance"). @Simplicius-Simplicissimus said in Stylesheet for a subset of widgets: Qt has nothing to do with that. Actually, Qt has something to do with that. Qt does not use interfaces/abstract classes. This is a design decision that was made and you have to conform to this with your own classes. Qt dictates that you MUST use inheritance instead of aggregation/composition. If you want to use Qt it is not your choice anymore (except for classes that don't directly interact with the Qt eco system). As you have mentioned interfaces are implemented as abstract classes in C++. The mechanism is still inheritance to implement an interface. You gain nothing by using interfaces instead of just regular inheritance in C++. As I said before, you'd need to forward a lot of member functions when using aggregation. Nobody wants to write that much code! And with the design Qt has chosen you certainly don't need any dynamic_casts. Don't go through the trouble of rewriting Qt to use interfaces instead, just because of some stupid rule (most "rules" should actually be "guidelines"). BTW, the original design pattern book just collected patterns they observed in existing source code and gave them a name. The authors never said to force the patterns everywhere in your own code. If a pattern solves your problem–good, use it. But don't try to use as many patterns as possible. This was never the intention. Use them as guidelines.
  • how to change the position of the menu popped by the qpushbutton?

    Unsolved
    6
    0 Votes
    6 Posts
    621 Views
    jsulmJ
    @nicker-player said in how to change the position of the menu popped by the qpushbutton?: it is not the operating system default style What is your OS? Did you do any styling already in your app? There is documentation which should answer your question: https://doc.qt.io/qt-6/stylesheet-examples.html#customizing-qcombobox