Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • Issue with Pitch Variation in Video Playback using Video{} in Qt 6.5.1

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

    Unsolved
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • query.bind not formatting date correctly

    Unsolved
    7
    0 Votes
    7 Posts
    705 Views
    ocgltdO
    @Christian-Ehrlicher Ok - I'll leave this thread open for now. Once I'm done this current program I'll create an MRE and provide addition info. Development system info: Qt 5.15.2 Alma Linux release 9.2 MariaDB 15.1 Distrib 10.5.16 mariadb-connector-c-devel 3.2.6-1.el9 mariadb-devel 10.5.12-3.el9 Host running SQL server: Alma Linux release 9.2 MariaDB server 10.5.1 Distrib 10.5.16
  • Can't launch app into terminal window

    Unsolved
    1
    0 Votes
    1 Posts
    182 Views
    No one has replied
  • Build mysql drivers under AlmaLinux 9

    Solved
    6
    0 Votes
    6 Posts
    1k Views
    SGaistS
    There's usually either a log, or an output folder in the build folder.
  • QT Widget Tab Does Not Expand

    Unsolved
    7
    0 Votes
    7 Posts
    782 Views
    R
    @mpergand The issue was due to the fact that the maximum width had changed to a smaller value. As a result when I maximize the tab did not maximize to full screen.
  • qt.bluetooth.bluez: Missing CAP_NET_ADMIN permission. REOPEN / REPOST

    Unsolved
    1
    0 Votes
    1 Posts
    156 Views
    No one has replied
  • Audio not playing from .qrc resources

    Solved
    20
    0 Votes
    20 Posts
    5k Views
    8Observer88
    My example works with Qt 6.2.4. You can download it from DropBox here. Many thanks to the guys in this topic: How to play sounds using QMediaPlayer media-player-qt6-cpp.pro QT += core gui multimedia greaterThan(QT_MAJOR_VERSION, 4): QT += widgets CONFIG += c++17 # You can make your code fail to compile if it uses deprecated APIs. # In order to do so, uncomment the following line. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 SOURCES += \ main.cpp \ widget.cpp HEADERS += \ widget.h # Default rules for deployment. qnx: target.path = /tmp/$${TARGET}/bin else: unix:!android: target.path = /opt/$${TARGET}/bin !isEmpty(target.path): INSTALLS += target RESOURCES += \ audio.qrc widget.h #ifndef WIDGET_H #define WIDGET_H #include <QtWidgets/QWidget> #include <QtMultimedia/QMediaPlayer> class Widget : public QWidget { Q_OBJECT public: Widget(QWidget *parent = nullptr); ~Widget(); private slots: void play(); private: QMediaPlayer mediaPlayer; }; #endif // WIDGET_H widget.cpp #include "widget.h" #include <QtCore/QUrl> #include <QtWidgets/QPushButton> #include <QtMultimedia/QAudioOutput> Widget::Widget(QWidget *parent) : QWidget(parent) { mediaPlayer.setSource(QUrl("qrc:/assets/audio/music.wav")); mediaPlayer.setAudioOutput(new QAudioOutput); QPushButton *playButton = new QPushButton("Play", this); connect(playButton, &QPushButton::pressed, this, &Widget::play); connect(&mediaPlayer, &QMediaPlayer::mediaStatusChanged, [=](QMediaPlayer::MediaStatus status) -> void{ qDebug() << "QMediaPlayer::mediaStatusChanged" << status;} ); } Widget::~Widget() { } void Widget::play() { mediaPlayer.play(); qDebug() << "play"; } main.cpp #include "widget.h" #include <QApplication> int main(int argc, char *argv[]) { QApplication a(argc, argv); Widget w; w.show(); return a.exec(); }
  • 0 Votes
    2 Posts
    477 Views
    D
    OK, I found the cause of the problem. Well, the problem is the right combination of codec, format and QMediaRecorder configuration. In the case of my systems, it turned out that they do not support WAV. Using AAC and a bitrate of 256kbit solved the problem. Previously I tried with AAC and 320kbit but the codec does not work with such a high bitrate and there was no error message.
  • how to open Qt app terminal in gnome Terminal (ubuntu)

    Unsolved
    2
    0 Votes
    2 Posts
    436 Views
    JonBJ
    @JacobNovitsky What does "opening a Qt app terminal in gnome terminal" mean? There is no such thing as a "Qt app terminal" (or indeed any kind of "Qt terminal"), and even if there were how could one open it "in" another terminal? When running a Qt console application from Qt Creator you can set a "Run in terminal" checkbox to ask it to create a new terminal when launching your program. And which terminal (e.g. xterm or gnome-terminal) command line is a setting you can alter inside Creator. Is that what you are talking about?
  • QProcess with Elevated permission

    Unsolved
    4
    0 Votes
    4 Posts
    787 Views
    JonBJ
    @HrishiGobler OK. But the issue here is that you claim that after QProcess::started() the process is "stuck" on "Running" and never "finishes" after the user clicks Deny. If that is true it is problematic. You could Google for qprocess uac. There are a few hits, but mostly about how you might run elevated not your Deny report. (Nonetheless, some of the advice there about6 running it via Windows shell might be of interest.) You might also try running your command via QProcess::start("cmd", { "-c", yourCommand } ) to see if that finishes. I doubt anything is going to tell you about Deny having been selected. Certainly not from QProcess. The native Windows ShellExecute()-type calls might do. If it is really true that the QProcess never sees the process as having finished you might (first search and then) report it as a Qt bug to see whether the devs have anything to say.
  • Driver not loaded (MySQL)

    Solved
    8
    0 Votes
    8 Posts
    567 Views
    ocgltdO
    @Christian-Ehrlicher In building my MRE I found a mistake I hadn't noticed before...solved :) Thanks
  • I am trying to fetch data from Sqlite to Table but data is not showing in table

    Unsolved
    2
    0 Votes
    2 Posts
    137 Views
    SGaistS
    Hi, You have no error checks, no debug information added. Nothing there to even know whether your code does something.
  • how create Dynamic Chart ??

    Solved
    3
    0 Votes
    3 Posts
    244 Views
    timob256T
    @timob256 Another header coupon, this ok #include <QtCharts> .h #ifndef QDYNAMICCHART_H #define QDYNAMICCHART_H //#include <QChart> //#include <QtCharts/QChartGlobal> #include <QtCharts> class QDynamicChart: public QChart { Q_OBJECT public: explicit QDynamicChart(QChart *parent = 0); ~QDynamicChart(); static int ResID; // Статическая переменная, счетчик номеров графика int getID(); // Функция для возврата локального номера графика public slots: private: int ChartID = 0; // Локальная переменная, номер графика }; #endif // QDYNAMICCHART_H .cpp #include "qdynamicchart.h" QDynamicChart::QDynamicChart(QChart *parent) : QChart(parent) { ResID++; // Увеличение счетчика на единицу ChartID = ResID; /* Присвоение кнопке номера, по которому будет производиться * дальнейшая работа с кнопок * */ } QDynamicChart::~QDynamicChart() { } /* Метод для возврата значения номера кнопки * */ int QDynamicChart::getID() { return ChartID; } /* Инициализация статической переменной класса. * Статическая переменная класса должна инициализироваться в обязательном порядке * */ int QDynamicChart::ResID = 0;
  • 0 Votes
    5 Posts
    1k Views
    A
    @Axel-Spoerl Yes, I have but not this one. Thank you for the link!!
  • Why is the capacity of qvector smaller than that of std:: vector?

    Solved
    20
    0 Votes
    20 Posts
    1k Views
    S
    @Christian-Ehrlicher said in Why is the capacity of qvector smaller than that of std:: vector?: std will crash also as you don't have 800MB of contiguous memory. "Contiguous" is usually not the problem. With a 64bit OS and paging you have a huge address space which can be used to create contiguous addresses. PC processors don't use 64bit pointers in hardware and IIRC it was only 52bit pointers initially. This still would give you 4 petabytes of address space per process. You only need enough free memory which can then be put anywhere inside that huge address space. You would have to produce some serious fragmentation (or other really huge data) to fill up that address space. However, if you only have 8 GB of RAM you'll quickly might run of space if you request 800MB and a lot of other things are also running.
  • This topic is deleted!

    Unsolved
    2
    0 Votes
    2 Posts
    27 Views
  • QT Creator Setting Icon Image on Hover

    Solved
    4
    0 Votes
    4 Posts
    3k Views
    R
    @Abderrahmene_Rayene Thanks for the response. That was really helpful! C++ approach worked for me.
  • How to get data from Qthread

    Locked Moved Unsolved
    3
    0 Votes
    3 Posts
    244 Views
    Christian EhrlicherC
    Please stop deleting your posts...
  • 0 Votes
    2 Posts
    145 Views
    SGaistS
    Hi, Please, as already requested several times, stop posting your whole code base and reduce it to the strict minimum required to show your issue. And also use coding tags when posting your code. It's the </> button on the text editor tool bar.