Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.6k Posts
  • Got VNC platform plugin working on Qt 5

    vnc qt 5
    11
    1 Votes
    11 Posts
    19k Views
    M
    For those who find this via web search, the port can be set via a … drum roll … port=INTEGER parameter, as in #!/bin/sh export QT_QPA_PLATFORM=vnc:size=480x300:addr=127.0.0.1:port=$(expr 5900 + ${SCREEN:-1}) export QT_PLUGIN_PATH=/usr/lib/qt/plugins here="$(dirname "$0")" exec "${here}"/gui.real
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    14 Views
    No one has replied
  • how to make the tablewidget cost less time?

    Unsolved
    5
    0 Votes
    5 Posts
    468 Views
    S
    For a QTableWidget you have to create the widget for every cell in the table view. This can take quite some time (depending on the number of rows and columns). The QTableView manages the individual widgets for the cells differently. Simply speaking, it just shows the widgets that are visible and reuses them when scrolling. This is why QTableView is the better choice for a lot of data. However, you are saying that you have only 100 rows. If it is only a hand full of columns 2 seconds might be a little long (though 100 rows by 10 columns would already be 1000 widgets). Do you have a single call to the database to fetch the data? Or are you querying one row at a time?
  • QSortFilterProxyModel subclass returns undefined records

    Unsolved qsortfilterprox model
    1
    0 Votes
    1 Posts
    202 Views
    No one has replied
  • Assert in QSortfilterproxymodel

    Solved
    5
    0 Votes
    5 Posts
    768 Views
    D
    Ive hit the same problem again while building new system. The solution is... beginInsertColumns(QModelIndex(), 0, labels.size() - 1); endInsertColumns();
  • How to implement smoothly updating map in Qt Widgets app?

    Solved
    4
    0 Votes
    4 Posts
    637 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
    488 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
    293 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
    300 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
    225 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
    656 Views
    S
    Thanks for the message @jsulm & @Christian-Ehrlicher
  • binary builds missing for macos

    Solved
    6
    0 Votes
    6 Posts
    551 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
    314 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
    238 Views
    D
    OMG QFrame!
  • Problem with graphics display in buttom after OS update

    Unsolved
    2
    0 Votes
    2 Posts
    165 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
    206 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.