Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • QTest::fetchData(): "Test data requested, but no testdata available."

    Solved
    8
    0 Votes
    8 Posts
    4k Views
    S
    @Surendranath Ok i got the solution . And where i went wrong was i gave the wrong test case definition. So i correct it testNumbers_data() instead of test_case1(). Now problem solved. Thank you.
  • 0 Votes
    4 Posts
    922 Views
    sierdzioS
    Hm, it should work then, no idea.
  • Converting PyQt5 (Python) to Qt C++ QtWebSockets

    Unsolved
    9
    -1 Votes
    9 Posts
    2k Views
    K
    @eyllanesc i fixed it by adding QT += websockets to the .pro but im getting this now 00:00:44: Cannot retrieve debugging output.
  • Implementing bluetooth - general questions - part 3 - trace bluetooth inquiry in Qt

    Solved
    3
    0 Votes
    3 Posts
    263 Views
    A
    @Pablo-J-Rogina Thanks, I think this will do nicely and not only on bluetooth. Appreciate your post.
  • QTableView Fixing Some Columns

    Solved
    13
    1 Votes
    13 Posts
    931 Views
    SGaistS
    Great ! Since you have it working now, please mark the thread as solved using the "Topic Tools" button or the three dotted menu beside the answer you deem correct so that other forum users may know a solution has been found :-)
  • How to access the default border color

    Unsolved
    1
    0 Votes
    1 Posts
    288 Views
    No one has replied
  • Terminal Example - read problem

    Solved
    22
    0 Votes
    22 Posts
    3k Views
    B
    Ok so in my console application i am going to use code where you can select to filter \0 and \r. This option is checked in settings dialog (next to Local echo checkbox). Do you guys think that this code is OK or should i use some other option for filtering \0 and \r? void mainWindow::readData() { QByteArray data; data = serialPort->readAll(); if(settings->settings().filter_r == true) { data.replace('\r', ""); } if(settings->settings().filter_0 == true) { data.replace('\0', ""); } ui->console->putData(data); }
  • 0 Votes
    11 Posts
    2k Views
    T
    @SGaist as a matter of fact it did... Then I used Qthread::msleep(500); I will try using it asynchronously today and get back to you with the result...
  • No SQL driver available

    Solved
    6
    0 Votes
    6 Posts
    698 Views
    Pablo J. RoginaP
    @Please_Help_me_D said in No SQL driver available: and it worked! great, so please don't forget to mark you post as solved!
  • Adding flag to clang for detecting problems in code

    Unsolved
    1
    0 Votes
    1 Posts
    262 Views
    No one has replied
  • [Solved] Convert content of QlineEdite to Char *

    15
    0 Votes
    15 Posts
    8k Views
    SGaistS
    @Jc_Opc Hi, It's a question of object lifetime. In this case: const char * characters = ui->lineEdit->text().toLatin1().data(); the QByteArray returned by toLatin1 ends its life on the same line it was created. Therefore characters is pointing invalid memory as soon as the line ends. You have the exact same issue: toStdString().c_str(); The std::string returned by toStdString() ends its life the same way as the QByteArray above. qDebug() << myQString.toStdString().c_str(); works because everything happens on the same line.
  • FramelessWindowHint removes the abbility to drag/move the window

    Solved
    2
    0 Votes
    2 Posts
    395 Views
    mrjjM
    Hi Yes when removing the caption, one can no longer drag it around. To fix you compile error do #include "QMouseEvent" You also must add resize if needed. One of the better version of this, i know is https://github.com/Jorgen-VikingGod/Qt-Frameless-Window-DarkStyle
  • Signal Slot Between main and worker thread

    Solved
    5
    0 Votes
    5 Posts
    342 Views
    JKSHJ
    @DonCoder said in Signal Slot Between main and worker thread: what if the Object S is a static object, Can i connect a static object's signal with a non static object slot ? Don't create static QObjects. This causes problems because static objects are created before main() starts, which conflicts with the requirement that QCoreApplication (or its subclass) must be the very first QObject to be created. I know connect should happen with either Auto or Queued Connection. I have verified Q_OBJECT Macro in both classes, even moc files also got generated Yes, these are both correct and good. From @Christian-Ehrlicher's links, you'll find more requirements. In particular: You must not subclass QThread You must start() the QThread
  • Display hexdecima format

    Solved
    5
    0 Votes
    5 Posts
    411 Views
    Pablo J. RoginaP
    @taku-s said in Display hexdecima format: I was able to solve great, so please don't forget to mark your post as solved!
  • Displaying available storage with QStorageInfo class

    Unsolved
    3
    0 Votes
    3 Posts
    267 Views
    M
    tnx it worked
  • QSerialPort is(n't) sending data to ESP8266

    Solved qserialport esp8266
    6
    0 Votes
    6 Posts
    1k Views
    G
    Thank you, the problem was, that I didn't wait for the Bytes to be written.
  • QODBC for MS Access doesn't support QSqlQuery::lastInsertId

    Solved
    10
    0 Votes
    10 Posts
    631 Views
    B
    Finally, it turned out, that a separate query with SELECT @@IDENTITY works (which is quite strange for me as I thought, that lastInserdId executes exactly the same query). I don't know how come I haven't noticed that. So one can do query.exec("INSERT ..."); and in the next line query.exec("SELECT @@IDENTITY");. But also I found out that SCOPE_IDENTITY and CURRENT_IDENTITY don't work. Thank you all for your help!
  • How to create Pie object?

    Solved
    4
    0 Votes
    4 Posts
    317 Views
    J.HilkJ
    @TomNow99 well it still holds true, just that you have to 2 additional boundary checks. I don't have those at hand, from the top of my head. But this stack overflow thread has it: https://stackoverflow.com/a/51896645
  • QtVolumeButton like GtkVolumeButton

    Unsolved
    2
    0 Votes
    2 Posts
    172 Views
    JonBJ
    @sonichy I guess because it offers a generic QSlider for this sort of thing. See e.g. https://doc.qt.io/qt-5/qtwidgets-widgets-sliders-example.html .
  • How to make simple app for run some terminal commands

    Unsolved
    2
    0 Votes
    2 Posts
    357 Views
    mrjjM
    Hi and welcome to the forums First you should read the docs. https://doc.qt.io/qt-5/qprocess.html Please notice that any parameters should be included in the QStringList param and not as part of the string for the app. QString program = "./path/to/app.exe"; QStringList arguments; arguments << "-arg1" << "arg2"; QProcess *myProcess = new QProcess(parent); myProcess->start(program, arguments); so start("sudo lsb_release -a") is not right as "-a" should be on its own. Then next is the fact that QProcess is asynchronous so make sure that you dont declare QProcess process1 inside a function as it will then be deleted before anything happens. So make it a class member. Then there is sudo. If it asks for password then it wont work. About where to have the process1.start, Well how will app work ? User must press something or its it automatic in some way ?