Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • MVD

    Unsolved
    2
    0 Votes
    2 Posts
    124 Views
    Christian EhrlicherC
    Would you please start using code tags and asking questions instead posting tons of code?
  • This topic is deleted!

    Unsolved
    11
    0 Votes
    11 Posts
    75 Views
  • How to clear plot in QCustomPlot?

    Solved qcustomplot plot vector qt5.15.2
    2
    0 Votes
    2 Posts
    754 Views
    timob256T
    @timob256 In general , there was one mistake , for some reason I thought that by setting the size of the vector , it would correct everything itself , but it turned out not to be so void MainWindow::slotProcessDatagrams() { QByteArray baDatagram_in; do { baDatagram_in.resize(m_pudp_in->pendingDatagramSize()); m_pudp_in->readDatagram(baDatagram_in.data(), baDatagram_in.size()); } while(m_pudp_in->hasPendingDatagrams()); QDataStream in(&baDatagram_in, QIODevice::ReadOnly); in.setVersion(QDataStream::Qt_5_3); in >> str_priem; // принимаем сообщение str_x = str_priem.section(' ',0,0); str_y = str_priem.section(' ',1); if(my_int >= 80) { // clear firs element // x.pop_back(); // y.pop_back(); // x.removeLast(); // y.removeLast(); x.pop_front(); //последний из вектора y.pop_front(); x << str_x.toDouble(); y << str_y.toDouble(); } else { x << str_x.toDouble(); y << str_y.toDouble(); my_int = my_int + 1; } // чистим старое отрисовываем новое wGraphic->graph(0)->clear(); wGraphic->graph(0)->rescaleAxes(); // wGraphic->replot(); // Отрисовываем содержимое полотна wGraphic->graph(0)->setData(y,x); // Устанавливаем координаты точек графика wGraphic->replot(); // Отрисовываем содержимое полотна // Очищаем принятую строку str_priem.clear(); } True, a new error jumped (for some reason the last and first point somehow connects, I don't know how to break) [image: R3rvJ.png]
  • How to create .exe file of QT project

    Unsolved designer launch executable qtcreator launchimage iconset
    13
    0 Votes
    13 Posts
    10k Views
    S
    hello man so first change ur build configuration to release or whatever then build your application and after that go to ur qt files -> bin > compiler u used > windeployqt.exe that file is what which will gather the .dll and etc files which ur app needs right click on the window and select powershell and then this command .\windeployqt.exe "path of ur .exe file"
  • Cross building on MacOS for Linux device. How?

    Unsolved
    2
    0 Votes
    2 Posts
    154 Views
    SGaistS
    Hi, One of the simplest solution is to use a virtual machine so you can develop directly on Linux and have all the tools required available.
  • QGroupBox not expanding in QTabWidget

    Unsolved
    3
    0 Votes
    3 Posts
    245 Views
    SGaistS
    Hi and welcome to devnet, Which version of Qt are you using ? On which platform ? Can you provide a minimal compilable example that shows your issue ?
  • git is not working in QT creator terminal with bash

    Unsolved
    3
    0 Votes
    3 Posts
    242 Views
    JoeCFDJ
    @srinath_ramamoorthy try to use the full path bash -c "/usr/bin/git describe --tags --abbrev=8 --dirty --always --match """
  • How to migrate from Qt5 to Qt6 ?

    Unsolved
    3
    0 Votes
    3 Posts
    1k Views
    JoeCFDJ
    @AndrzejB said in How to migrate from Qt5 to Qt6 ?: set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD 17)
  • QSoundEffect lag after stop() func

    Unsolved
    2
    0 Votes
    2 Posts
    154 Views
    Christian EhrlicherC
    First I would upgrade to latest Qt5 version to see if it is fixed there. 5.12 is very old.
  • Run application on the other computer

    Unsolved
    6
    0 Votes
    6 Posts
    2k Views
    JoeCFDJ
    @jsulm I guess plugins are needed as well.
  • MacOS 13 Help menu crash in my qt app

    Unsolved
    8
    1 Votes
    8 Posts
    1k Views
    MehrshadM
    I filed a bug report here.
  • Microsoft remove TLS 1.0 and TLS 1.1 from Windows 11

    Unsolved
    3
    0 Votes
    3 Posts
    403 Views
    piervalliP
    @kkoehne Thanks
  • QPainter effects removed when rendering a QOpenGLWidget into a QPixmap

    Unsolved
    8
    0 Votes
    8 Posts
    956 Views
    C
    If possible, I'm hoping to get an explanation about the 2nd solution, because I stumbled upon it while experimenting. I have never used OpenGL, but I'm interested in why calling grabFrameBuffer() and disabling OpenGL before calling render fixes the problem (I'm not even sure it does fix it)? I read that grabFrameBuffer() relies on glReadPixels(), and read its documentation, but it's still unclear to me. I also took a look at grabFrameBuffer source code to try and see if I can replicate what it's doing without calling it, but failed to understand that as well. I'm just trying to learn something new, so it's not a problem I'm facing or an urgency. Thanks if anyone decides to look into this!
  • it is showing error

    Unsolved
    5
    0 Votes
    5 Posts
    266 Views
    C
    @Pappu-Kumar-Keshari First, you need to heed the warning your compiler is probably giving you: dbmanager.cpp: In member function ‘bool DbManager::saveToSqlite(const QString&)’: dbmanager.cpp:219:1: warning: no return statement in function returning non-void [-Wreturn-type] 219 | } | ^ The code compiles and runs with no error message like: Getting error when saving file from QML to Sqlite. Error like this =>Property 'saveToSqlite' of object QObject(0x7ffcfa692910) is not a function The GUI disappears when I click on any of the buttons, does not exit, but also does not save anything into the people table. This is the limit of the effort I can put into debugging your code. Linux, Qt 6.4.2, GCC 11.4
  • Doubts about QGraphicsView fitInView method

    Unsolved
    5
    0 Votes
    5 Posts
    639 Views
    Z
    @JonB said in Doubts about QGraphicsView fitInView method: @ZeusFa So fitInView doesn't change the size of the scene? I certainly hope not! It's a view onto the scene, it should not change anything on the scene. If you take a photo of a cat, and the cat is too small to see, to make it fill the view you don't change the size of the cat, you zoom the view instead :) How can I get the scale value after fitInView? Irritatingly QGraphicsView offers scale() to change the view's scale but not a method to return just the current scale. IIRC you have to call transform() to get the whole current QTransform and access the individual transformation members (m11() and m22(), I think) if you want retrieve the current scale. Try printing these out before and after fitInView() and I think you will see those change. (You may also see the origin/translation change if fitting in view alters the view's top-left corner position on the scene. The others should not change.) Got it, thank you!
  • QTextBlockFormat resets by pressing the return key for empty block

    Solved
    3
    0 Votes
    3 Posts
    301 Views
    K
    @SGaist thanks, I tried to find something but no luck. However, I managed to find a workaround. I installed an event filter for the text widget that is listening for the return key and manually inserts a new block. If someone is interested in the code: if (event->type() == QEvent::KeyPress && object == ui->textEdit) { QKeyEvent* key = static_cast<QKeyEvent*>(event); if (key->key() == Qt::Key_Return) { QTextCursor cursor = ui->textEdit->textCursor(); cursor.insertBlock(); ui->textEdit->setTextCursor(cursor); return true; } return false; }
  • QComboBox bug in Qt5.15

    Unsolved
    25
    0 Votes
    25 Posts
    4k Views
    K
    Ok - this seems to actually be a bug in Qt introduced in Qt 5.15.3 - however it is resolved some time between Qt 6.0.0 and 6.5.1. I retested with Qt 6.5.1, and it seems not to reproduce there. The bug shows up in Qt 5.15.3, but not in Qt 5.15.2 and not in Qt 6.5.1. Given this, it isn't worth making a bug report about it, since it is already fixed in Qt 6. If anyone reading this is interested to test, I have updated my bug exploration repo with this new info: https://github.com/keithel/qapitrace-combobox-elide-bug
  • QTcpSocket Read/Write correctly & reliable

    Unsolved qtcpsocket qdatastream readyread qiodevice qtcpserver
    8
    0 Votes
    8 Posts
    2k Views
    JonBJ
    @Narutoblaze Your code/algorithm is incorrect. This is basic coding, please study what your code does. You "actively" encourage reading across file boundaries, i.e. what you call "too much"). You (seem to) start by setting size to the total number of bytes expected for the file. Then you call read(buffer, size);. But when that returns with fewer bytes than size you still call it again next time round asking it to read up to size further bytes. This can/will exceed the number of bytes in the first file. You obviously need to reduce what size you pass to read() accordingly on subsequent calls. And then be careful what you compare in your if (... || numReadTotal == size). Adjust your code however to make it right. I previously said that the whole synchronous approach of repeatedly calling waitForReadyRead() in a loop is not the event-driven way to do things. Allow bytes to arrive in repeated readyRead() signals asynchronously instead.
  • QJSEngine does not support JavaScript lambdas as expected

    Unsolved javascript qjsengine qjsvalue callback
    1
    0 Votes
    1 Posts
    379 Views
    No one has replied
  • How to propagate the wheelEvent to multiple widgets of my centralwidget

    Unsolved
    11
    0 Votes
    11 Posts
    1k Views
    T
    @JonB In the code I provide in my previous message, the MyWidget seems to execute the code assiocated to the wheelevent, and then the event is propagated to the parent widget (the central widget is this case). And the central widget re-propagate the event to all its children (including the original widget). How to avoid this first process, the one before sending the event to the parent ?