Skip to content

Qt 6

This is where all Qt 6 related questions belong

828 Topics 4.0k Posts

QtWS: Super Early Bird Tickets Available!

  • 0 Votes
    8 Posts
    660 Views
    JoeCFDJ

    Is it possible to add some empty rows and make them unselectable? If their texts are empty, ignore selections.

  • [QT3D and OpenGL]

    Unsolved
    1
    0 Votes
    1 Posts
    147 Views
    No one has replied
  • [Loading PLY file using QT3D]

    Solved
    2
    0 Votes
    2 Posts
    263 Views
    A

    Sorry, the file name was incorrect.

    Thank you again.

    Have a nice day y'all.

  • [Installing QT3D, Qt C++]

    Solved
    3
    0 Votes
    3 Posts
    210 Views
    A

    @J-Hilk Thank youuuuu so much :D

  • [loading PLY file in Qt6 C++]

    Unsolved
    2
    0 Votes
    2 Posts
    225 Views
    SGaistS

    Hi,

    Some weeks ago another member asked for something similar but with PyQt. The example I linked to in that answer seem to have helped him. It might be possible to translate it to your use case.

  • 0 Votes
    2 Posts
    131 Views
    Christian EhrlicherC

    If you really care about those few bytes you have to re-compile Qt and Leptonic to use these three external libraries.

  • 0 Votes
    4 Posts
    205 Views
    A

    @mchinand Thank you so much.

  • QSqlDatabase: QMYSQL driver not loaded

    Unsolved
    33
    0 Votes
    33 Posts
    3k Views
    A

    @hskoglund said in QSqlDatabase: QMYSQL driver not loaded:

    Hi, libmysql.dll is not from the same year as libcrypto-1_1-x64.dll and ibssl-1_1-x64.dll, that could be a problem. I don't think that's the reason for the error though.

    I think you need to use a version of Qt that is not a beta release but a "real" release. That means installing the Qt 6.3.1 MSVC 2019 64-bit version. Then rebuild your app with that version of Qt.

    To avoid rebuilding the MySQL plugin for Qt version 6.3.1 you can download it from here

    When you open the zip, place the3 files libcrypto-1_1-x64.dll, libmysql.dll and libssl-1_1-x64.dll in the same folder as your .exe file (I'm guessing C:\Users\user\Documents\CP\build-DatabaseConnection-Desktop_Qt_6_3_1_MSVC2019_64bit-Release\release)
    then open the subdirectory sqldrivers in the .zip file and copy the 2 files qsqlmysql.dll and qsqlmysqld.dll to the plugins folder of your newly installed Qt version 6.3.1, I'm guessing: C:\Qt\6.3.1\msvc2019_64\plugins\sqldrivers

    It worked. Thanks a lot @hskoglund . To anyone struggling with the same issue, the quoted steps are precisely what you should follow to solve your problem.

    Thanks a million @hskoglund you are so kind.

  • 0 Votes
    8 Posts
    1k Views
    jsulmJ

    @nicker-player said in How to solve the problem C++17 std::byte and win sdk byte namespace ambigus:

    I put the <windows.h> into the preheader file of the project.

    No
    In the file where you have

    #include <windows.h>

    make sure it is above any Qt header includes.

  • How can I extract metadata from a music file?

    Solved
    7
    0 Votes
    7 Posts
    661 Views
    JonBJ

    @Pbaodoge said in How can I extract metadata from a music file?:

    QVariant var = mdData[QMediaMetaData::Genre]; qDebug() << var.toString();

    Please read the docs carefully! :) QMediaMetaData::Genre returns a QStringList. QVariant::toString() does not list that as a type it can convert to a string, and then

    Calling QVariant::toString() on an unsupported variant returns an empty string.

    Rewrite your code appropriately. You might also try QMediaMetaData::keys() to see what's there and QMediaMetaData::stringValue(QMediaMetaData::Key key) const.

  • 0 Votes
    9 Posts
    541 Views
    M

    @Pbaodoge
    layout2->addSpacing(100);
    layout2->addWidget(icon);

    instead of addSpacing use:
    addStretch();

  • 0 Votes
    2 Posts
    1k Views
    jsulmJ

    @ben-cottrell You should check the config.log file - it should give you more information about the issue (probably something is missing).

  • 0 Votes
    6 Posts
    391 Views
    SGaistS

    That I can't do.

    On the idea side, did you try to activate the Java debugging mode ?

  • how to using the button setenabled when clicked itself?

    Unsolved
    13
    0 Votes
    13 Posts
    534 Views
    W

    @nicker-player

    #ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> #include <QState> #include <QStateMachine> #include <QFinalState> QT_BEGIN_NAMESPACE namespace Ui { class MainWindow; } QT_END_NAMESPACE class MainWindow : public QMainWindow { Q_OBJECT public: MainWindow(QWidget *parent = nullptr); ~MainWindow(); signals: //this signals may be emit by buttons click, keys events,wheel events, slider move. void sigPageGoStart(); void sigPageGoMid(); void sigPageGoEnd(); void sigPageClose();//this signal emit when close current page,machine will finsh private slots: //Here I only add the button trigger emit state Transition procedure void on_pushButton1_First_clicked(); void on_pushButton_Prev_clicked(); void on_pushButton_Next_clicked(); void on_pushButton_Last_clicked(); void slotPageFinishedState(); private: Ui::MainWindow *ui; QStateMachine* pageStateMachine=new QStateMachine(this); QState* pageStartState=nullptr; QState* pageMiddleState=nullptr; QState* pageEndState=nullptr; QFinalState* pageNoneState=nullptr; void OpenPage(); void ClosePage(); }; #endif // MAINWINDOW_H #include "mainwindow.h" #include "ui_mainwindow.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) { ui->setupUi(this); //1-create state pageStartState=new QState(pageStateMachine); pageStartState->assignProperty(ui->pushButton1_First,"enabled",false); pageStartState->assignProperty(ui->pushButton_Prev,"enabled",false); pageStartState->assignProperty(ui->pushButton_Next,"enabled",true); pageStartState->assignProperty(ui->pushButton_Last,"enabled",true); pageMiddleState=new QState(pageStateMachine); pageMiddleState->assignProperty(ui->pushButton1_First,"enabled",true); pageMiddleState->assignProperty(ui->pushButton_Prev,"enabled",true); pageMiddleState->assignProperty(ui->pushButton_Next,"enabled",true); pageMiddleState->assignProperty(ui->pushButton_Last,"enabled",true); pageEndState=new QState(pageStateMachine); pageEndState->assignProperty(ui->pushButton1_First,"enabled",true); pageEndState->assignProperty(ui->pushButton_Prev,"enabled",true); pageEndState->assignProperty(ui->pushButton_Next,"enabled",false); pageEndState->assignProperty(ui->pushButton_Last,"enabled",false); pageNoneState=new QFinalState(pageStateMachine); connect(pageStateMachine,&QStateMachine::stopped,this,&MainWindow::slotPageFinishedState); //2-add state transition pageStartState->addTransition(this,&MainWindow::sigPageGoMid,pageMiddleState); pageStartState->addTransition(this,&MainWindow::sigPageGoEnd,pageEndState); pageStartState->addTransition(this,&MainWindow::sigPageClose,pageNoneState); pageMiddleState->addTransition(this,&MainWindow::sigPageGoStart,pageStartState); pageMiddleState->addTransition(this,&MainWindow::sigPageGoEnd,pageEndState); pageMiddleState->addTransition(this,&MainWindow::sigPageClose,pageNoneState); pageEndState->addTransition(this,&MainWindow::sigPageGoMid,pageMiddleState); pageEndState->addTransition(this,&MainWindow::sigPageGoStart,pageStartState); pageEndState->addTransition(this,&MainWindow::sigPageClose,pageNoneState); //3- open Page OpenPage(); } MainWindow::~MainWindow() { delete ui; } void MainWindow::on_pushButton1_First_clicked() { //page move to start page view emit sigPageGoStart(); } void MainWindow::on_pushButton_Prev_clicked() { //page move up //Check page view position, send signal sigPageGoStart\sigPageGoMid\sigPageGoEnd } void MainWindow::on_pushButton_Next_clicked() { //page move down //Check page view position, send signal sigPageGoStart\sigPageGoMid\sigPageGoEnd } void MainWindow::on_pushButton_Last_clicked() { //page move to start page view emit sigPageGoEnd(); } void MainWindow::slotPageFinishedState() { ui->pushButton1_First->setEnabled(false); ui->pushButton_Prev->setEnabled(false); ui->pushButton_Next->setEnabled(false); ui->pushButton_Last->setEnabled(false); } void MainWindow::OpenPage() { //1-open page move to start page view //2-set ui machine pageStateMachine->setInitialState(pageStartState); pageStateMachine->start(); } void MainWindow::ClosePage() { //1-close page //2-stop ui machine emit sigPageClose(); }
  • How setenv before loading the dll file?

    Unsolved
    2
    0 Votes
    2 Posts
    287 Views
    sierdzioS
    start your program through a script (.bat file) which will set up all paths and environment variables if this is about third party libraries, you can load your app first, then set env using qputenv, then load your libs using QLibrary install libraries system-wide so that all apps will have access to them regardless of where they are compile your app statically to include all code inside create a launcher for your app which will set up QProcessEnvironment and then launch your main app through QProcess

    As you can see, there are many ways to solve this. Which solution is correct depends on particular details of your situation and your preference.

  • This topic is deleted!

    Unsolved
    4
    0 Votes
    4 Posts
    146 Views
  • [QtQuick, Multimedia, GStreamer] Can't play video stream

    Solved
    5
    0 Votes
    5 Posts
    846 Views
    0

    Yes, it works!
    For test I send a videotestsrc via console:
    gst-launch-1.0 videotestsrc ! "video/x-raw,width=640,height=480" ! x264enc ! mpegtsmux name=mux ! udpsink host=127.0.0.1 port=8080

    In QML:

    ... MediaPlayer { id: player source: "udp://@127.0.0.1:8080" videoOutput: video } VideoOutput { id: video anchors.fill: parent fillMode: VideoOutput.PreserveAspectCrop } Component.onCompleted: { player.play() }
  • Is there a license difference between qt5 and qt6?

    Solved
    2
    0 Votes
    2 Posts
    1k Views
    SGaistS

    Hi,

    If memory serves well, there has not been any major changes in the licenses. You can see changes related to licences here.

  • qtpaths return incorrect path

    Solved
    2
    0 Votes
    2 Posts
    837 Views
    D

    Dirty hack - create symlink ln --symbolic /usr/lib/qt6/libexec/moc /usr/libexec/moc
    qmake work because it have symlink at /usr

    $ ls -l /usr/bin/qmake* lrwxrwxrwx 1 root root 9 May 3 2019 /usr/bin/qmake -> qtchooser lrwxrwxrwx 1 root root 21 Jun 13 23:13 /usr/bin/qmake6 -> ../lib/qt6/bin/qmake6
  • Qt build crashes

    Unsolved
    3
    0 Votes
    3 Posts
    248 Views
    A

    Add below line in your CMakeLists.txt file :
    find_package(Qt6 REQUIRED COMPONENTS Qml)
    target_link_libraries(${myProject} PRIVATE Qt6::Qml)

    More