Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.9k Posts
  • Other ways to write a switch ?

    Solved
    3
    0 Votes
    3 Posts
    253 Views
    ApprenticeRenoA
    @mpergand thank you
  • QProcess inside QtConcurrent::mapped - no slots called

    Unsolved
    3
    0 Votes
    3 Posts
    292 Views
    S
    6.4.2 open source, mac os
  • Deleted posts

    Unsolved
    8
    1 Votes
    8 Posts
    559 Views
    Pl45m4P
    @masa4 said in Deleted posts: This is a sad situation actually, why are you being a toxic guy at this point? Where am I being toxic?! I actually felt sorry to hear that. But these situations can be avoided very easily, when you describe your problem and post an example to reproduce it. Copy/pasting and posting code online, which is part of commercial software and is not owned by you, is never a good idea. Even if you're asking for help. It is what it is. If someone decided that he should not have shared that information, it was too much. Like OP wrote, he thought about it, and felt it wasn't that sensitive. I or "we" can not decided how sensitive it really was. I dont think so. You keep being a toxic while living in your imagination world. lol My "imagination" is, that if you work in a company and you share parts of hidden code and your boss or your client find it out, I guess, they wont like it. But that is, maybe, only my imagination, in my world :)
  • Pressed and release on capacitive touch screen

    Unsolved
    5
    0 Votes
    5 Posts
    1k Views
    A
    @mrjj Often the touch controller comes with a settings app that allows you to control if long press means right click and such things But actually, as this tutorial shows and i try it, even windows has it but it's very restrictive. I'm gonna try something like this. Your answer make me thinks maybe to install a macro. Could it be a solution?
  • undefined reference to `vtable for

    Unsolved
    39
    0 Votes
    39 Posts
    5k Views
    JonBJ
    @SPlatten I have PMed you.....
  • QTcpSocket Client QT 5.12 not connecting

    Solved
    4
    0 Votes
    4 Posts
    717 Views
    D
    I found the issue, of course I had a digit wrong on the port... The connection seems to succeed now, I get a different error elsewhere but for the purpose of this thread it can be considered solved.
  • cannot append QTextDocument to QList <QTextDocument>

    Solved
    2
    0 Votes
    2 Posts
    197 Views
    C
    QList<T> requires that type T is an assignable data type. QTextDocument is a QObject and you cannot copy QObjects (by design). Store a pointer instead QList<QTextDocument *> list
  • Building problem with cmake

    Unsolved
    2
    0 Votes
    2 Posts
    587 Views
    Axel SpoerlA
    Have a look at this. GCC-9 should work with the latest Qt 5.15-lts on Ubuntu 18.04 and 20.04. All other Linuxes on 5.15 prefer GCC-5, or GCC-10 and above. Qt 5.15.2, however, is not the latest LTS release. Isn't Qt 6 an option?
  • QSystemTrayIcon example does not show messages

    Unsolved
    1
    0 Votes
    1 Posts
    556 Views
    No one has replied
  • QSqlQuery::prepare fails on CREATE USER with bound values

    Solved
    6
    0 Votes
    6 Posts
    491 Views
    S
    Although not really solving the issued, I created a workaround using a stored procedure at the server. DROP PROCEDURE IF EXISTS testdb.CreaUser; DELIMITER // CREATE PROCEDURE testdb.CreaUser(IN username TEXT, IN passwd TEXT) BEGIN PREPARE stmt FROM CONCAT("CREATE USER ", QUOTE(username), "@'%' IDENTIFIED BY ", QUOTE(passwd)); EXECUTE stmt ; END; // DELIMITER ; Having the procedure in place I can call it from Qt with bound values: QSqlQuery q(db); QString qu="CALL CreaUser ( :username , :passwd );"; if(q.prepare(qu)) qDebug()<<"query prepared"; else { qDebug()<<"q.prepare failed "<<q.lastError().text(); return; } q.bindValue(":username", "foo"); q.bindValue(":passwd", "; DROP TABLE x; --'"); if(q.exec()) qDebug()<<"query executed"; else { qDebug()<<"q.exec failed "<<q.lastError().text()<<q.lastQuery(); return; } db.close(); and get the user created without any loopholes for SQL injection.
  • Why when running .exe file has 2 windows pop up

    Solved
    11
    0 Votes
    11 Posts
    639 Views
    DQUY05D
    @Bonnie Thank Sir, indeed it was caused by QT += testlib, I'm glad the problem is solved
  • How to show black-and-white image from binary data?

    Unsolved
    6
    0 Votes
    6 Posts
    877 Views
    C
    @w-tkm said in How to show black-and-white image from binary data?: I was able to output from binary data. But, If the image size is set to 1000*1000, the output will be rectangular instead of square. Source pixels or screen pixels may not be square, or may differ in aspect ratio. Hard to say what applies to your case. There is no original format because the binary data is automatically generated by the program. So the source just sends you a million bits in random arrangement? Of course not... it is sending you data in some arrangement. Chances are this is left to right, top to bottom, 8 pixels per byte and yu can use something like this to make the QImage much faster: #include <QGuiApplication> #include <QByteArray> #include <QImage> #include <QDebug> int main(int argc, char *argv[]) { QGuiApplication a(argc, argv); // Build a test raw image. QByteArray data; data.reserve(1024*128); for (int row = 0; row < 1024; ++row) { // 1024 rows for (int col = 0; col < 128; ++col) { // 128 bytes = 1024 pixels data.append(0xaa); } } // Convert to QImage // Be sure to read about the lifetime requirements on the source buffer. QImage result(reinterpret_cast<uchar*>(data.data()), 1024, 1024, 128, QImage::Format_Mono); result.setColorCount(2); result.setColor(0, QColor("black").rgb()); result.setColor(1, QColor("white").rgb()); qDebug() << result; result.save("/tmp/test.png"); return 0; }
  • QStringRef for Qt 6.4.2?

    Unsolved
    3
    0 Votes
    3 Posts
    262 Views
    S
    @Christian-Ehrlicher Oh, I don't know why I'm not using that. haha. I'll delete this post
  • How to override QAbstractItemModel::parent() in QSortFilterProxyModel?

    Unsolved
    7
    0 Votes
    7 Posts
    683 Views
    I
    Thanks for the answer, I'll try it and say what happened.
  • Using glib and gtk with Qt

    Unsolved
    6
    0 Votes
    6 Posts
    2k Views
    M
    By the way easiest solution i found is: adding #undef signals before glib includes, and after it #define signals again.
  • How create 3d CAD use QML

    Unsolved cad qml geometry
    1
    0 Votes
    1 Posts
    741 Views
    No one has replied
  • Recover QtWebengine build after critical shutdown

    Solved
    3
    0 Votes
    3 Posts
    231 Views
    Cobra91151C
    @jsulm I have tried 3 times and it failed due to power outage here in Ukraine because of russian aggression :( Anyway, I overclocked the AMD FX8350 processor from 4 GHz to 4.60 GHz. Now, it compiles a bit faster. Thank you.
  • 0 Votes
    3 Posts
    254 Views
    S
    Thank you :)
  • QTableWidget still trigger itemChanged event even if signals blocked

    Solved
    6
    0 Votes
    6 Posts
    1k Views
    JoeCFDJ
    @Sabrac there is a return value from blockSignals(true). Check it out. The return value is the previous value of signalsBlocked(). https://doc.qt.io/qt-5.15/qobject.html#blockSignals There is another way to avoid any unnecessary changes caused by a specific signal. disconnect( table, signal, this, slot); // ... Some other logics table->setItem(0, 0, value0); table->setItem(0, 1, value1); table->setItem(0, 2, value2); table->setItem(0, 3, value3); // ... Some other logics connect( table, signal, this, slot); This may work better sometimes since you may not want to block all signals.
  • QTDesigner how to store/reuse promoted widgets?

    Unsolved designer
    3
    0 Votes
    3 Posts
    631 Views
    D
    Darn, this is painnnn. Thanks!