Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
79.0k Topics 454.2k Posts
  • Reporting inappropriate content on the forums

    Pinned Locked
    29
    2 Votes
    29 Posts
    24k Views
    A

    Thank you for the report. I have banned the user, which got rid of the spam posting. Not a loss, as this user did not post any other content on the site. Just deleting this one posting was not possible.

    Thanks for reporting this.

  • How to create the plugin of MYSQL for Qt

    Pinned Locked
    33
    8 Votes
    33 Posts
    36k Views
    K

    @flydragon

    Do not duplicate posting because you do not get an answer immendiately.

    [edit:koahnig see https://forum.qt.io/topic/82629/why-qsqlquery-exec-exit-failed ]

  • Slicer 3D GUI edit

    Unsolved
    1
    0 Votes
    1 Posts
    5 Views
    No one has replied
  • ui detect mouse event on objects

    Unsolved
    22
    0 Votes
    22 Posts
    218 Views
    JonBJ

    @Pfanne

    @JonB said in ui detect mouse event on objects:

    @mpergand said in ui detect mouse event on objects:

    &MainWindow::on_ioGroup_clicked);

    OIC I missed that when OP said it was correct.

    You can see for yourself (when it's written in monospace) that in your
    connect(ioGroup, &QButtonGroup::idClicked, this, MainWindow::on_ioGroup_clicked);

    one method reference has a preceding & and the other does not, and thereby tell what you had is not correct.

  • 0 Votes
    2 Posts
    29 Views
    M

    @kadet1090 I'm not sure if it's supported but try

    QTreeView::item:selected { background: transparent; }
  • Changing tray Icon on signal

    Unsolved
    4
    0 Votes
    4 Posts
    36 Views
    C

    @__d4ve__ Further to @jsulm's question, you may find it useful to add this at the top of the TrayIconApp constructor/destructor

    qDebug() << "Construct" << this; qDebug() << "Destruct" << this;

    and this in the slot:

    qDebug() << this << "onSyncChanged called with:" << sync;

    Then you will see which TrayIconApp object gets created and which object, if any, receives sent signals.

    What is the life span of client? In your connect(), client appears to be a stack-based instance of the Client class.

  • 0 Votes
    8 Posts
    45 Views
    S

    @J-Hilk
    add_executable(client
    client_main.cpp
    client_main_window.cpp
    client_manager.cpp
    client_chat_window.cpp
    chat_protocol.cpp
    chat_line.cpp
    )
    target_link_libraries(client PRIVATE database_library)

    qt_add_resources(client "images"
    PREFIX "/images"
    FILES send_icon.png
    )

    set(MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist)

    set_target_properties(client PROPERTIES MACOSX_BUNDLE ON)

    This is the CMake file related to the executable I am having prob ton have access to the Microphone. I did setup the Info.plist file.

  • QTcpServer as HTML Server

    Solved
    3
    0 Votes
    3 Posts
    56 Views
    R

    The server page was not loading and the issue was I was using the server's newConnection() signal to immediately write the html page to the client. But you have to wine and dine the client first. I ended up connecting the newConnection() signal to a set up function:

    void Server::handleConnection() { QTcpSocket* client = nextPendingConnection(); //client->setSocketOption(QAbstractSocket::KeepAliveOption, 0); QObject::connect(client,&QTcpSocket::readyRead,this,[=](){ handleRequest(client); }); }

    You can then write the HTML content to the client in handleRequest()

  • 0 Votes
    5 Posts
    48 Views
    JoeCFDJ

    @fontcolorhelp For Ubuntu, try to find qt deb files and download them to install. Ubuntu 22.04 has Qt 5.15.3.

  • How do I freeze the first row in a QTableWidget?

    Unsolved
    4
    0 Votes
    4 Posts
    52 Views
    JonBJ

    @SGaist said in How do I freeze the first row in a QTableWidget?:

    use the answer arrows rather than the quick answer box.

    Thanks, I discovered that after the first time I used it... :)

  • i need help in the QT installation

    Unsolved
    2
    0 Votes
    2 Posts
    30 Views
    Pl45m4P

    @Sadok_J

    Do you use the Online Installer?

    i'm not sure what boxes should i check in the personalized installation for me to work with thoses modules and functions

    If you are not sure what to pick and just start to use Qt for Qt Widget applications, go for the pre-configured installation.
    Don't know what the latest version in Online Installer currently shows, but it says something like
    Qt 6.7 for Desktop Development.
    Can't do wrong with this. There is QtCreator (the IDE with QtDesigner), the Qt Framework itself and every tool you need to start writing your first app, included

  • 0 Votes
    6 Posts
    45 Views
    N

    @Christian-Ehrlicher Ok, i'm going to use a signal/slot like solution.

    It's both more clean and safety.

  • Qt Designer/Creator/Design Studio - Which Should I Use?

    Unsolved
    6
    0 Votes
    6 Posts
    80 Views
    Pl45m4P

    @sburtchin said in Qt Designer/Creator/Design Studio - Which Should I Use?:

    The background color needs to change to indicate context. With .NET I had to add additional labels to patch the background and change this for every widget. With Qt I only will have to change the background for two widgets.

    This can be done using Qt stylesheet very easily

    https://doc.qt.io/qt-6/stylesheet.html https://doc.qt.io/qt-6/stylesheet-syntax.html https://doc.qt.io/qt-6/stylesheet-customizing.html https://doc.qt.io/qt-6/stylesheet-examples.html

    In the background it is checking literally trillions of possibilities for the best fit. The button comes with a warning for users who don't have really fast computers.

    that sounds like it could use some optimization.
    Some reworks when porting to C++ / Qt :)
    But definitely use Qt's Multithreading technologies, otherwise you will block the main GUI thread and make the window unresponsive.

  • 0 Votes
    6 Posts
    63 Views
    JoeCFDJ

    @Christian-Ehrlicher Good point. Busy with a release and no time to check it out. The bug report has been marked as Critical by Qt guys.

  • How to fix the blanked out windows in fullscreen mode?

    Unsolved
    9
    0 Votes
    9 Posts
    807 Views
    JoeCFDJ

    This setting works well in Qt5. Qt6 may be different. There is one example here.
    https://doc.qt.io/qt-6/qml-qtquick-window.html#visibility-prop

  • QTHREADS requests

    Solved
    10
    0 Votes
    10 Posts
    174 Views
    elicatE

    Hello, after reading your comments and performed multiple tests I solved it using the class QtConcurrent

    I called a slot from html/js which contains the start of the process where the loop is executed

    Solt Call method with process lancheur QtConcurrent

    void EngineIndexHtml::execLauncherBackupJob(QJsonObject jsonParameter) { extern void execLauncherJob(EngineIndexHtml * EngineHtmlObj, QJsonObject jsonParameter); QtConcurrent::run(execLauncherJob, this, jsonParameter); }

    Part of method execLauncherJob where EngineHtmlObj is mother class where there is declare signal

    for (int i = 0; i < arrayDataRowLauncher.size(); i++) { . . . . emit EngineHtmlObj->elabCheckStatusLauncher(jsonObjectDataRowLauncher); goLauncher(jsonObjectDataRowLauncher, strOriginFolder, startThread, endThread, iCoreIndex); . . . . }

    Now is all ok.
    Thanks to everyone who supported me and put up with me

  • Qml and MediaPlayer

    Unsolved
    6
    0 Votes
    6 Posts
    84 Views
    JoeCFDJ

    @mrdebug someone said state change is ok.
    https://forum.qt.io/topic/77694/detect-when-webcam-is-unplugged/13?_=1714657097024

    And you are using FFmpeg, not gstreamer.

  • Qt 6.7 Windows 11 Bug with Arabic languarge

    Unsolved
    19
    0 Votes
    19 Posts
    152 Views
    D

    @Christian-Ehrlicher just coincidence. I needed a style that worked and it doesn‘t look bad. And I admit I only saw the „ugly“ Windows style as the other alternative and overlooked „windowsvista“ :D

  • 0 Votes
    5 Posts
    57 Views
    Pl45m4P

    @Rozerin-YILDIZ said in How to create relation between main ui and different cpp/h files?:

    There will be just one .ui file (mainwindow.ui)

    The UI file is not directly connected to your class structure... As you might know, you don't need any *.ui files at all. Everything can be done by code.

    I want to split this issues (if it makes sense)

    Make no sense to me to split the MainWindow content into multiple classes / files. If it's shown (used only) in your MainWindow widget, what's wrong with having the code there?
    QMainWindow after all is just another widget, that you can fill with content.

    As I've said in your other topic, you can make widget "factories" to create and return the new widget to your main window.
    But this is also not needed.

    And if you subsclass some widget, you have your own separate class (files) anyway, which you include in your MainWindow header or code file.

  • Question about QThread object deletion

    Solved
    11
    0 Votes
    11 Posts
    142 Views
    jsulmJ

    @Kirill-Gusarev See @SimonSchroeder explanation and also read https://doc.qt.io/qt-6/threads-qobject.html