Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
82.9k Topics 453.3k Posts
  • Reporting inappropriate content on the forums

    Pinned Locked
    29
    3 Votes
    29 Posts
    29k Views
    A

    Thank you for the report. I have banned the user, which got rid of the spam posting. Not a loss, as this user did not post any other content on the site. Just deleting this one posting was not possible.

    Thanks for reporting this.

  • Qcompleter Rules

    Unsolved
    3
    0 Votes
    3 Posts
    33 Views
    C

    @SGaist
    Honestly, I don't know much about delegate, it scares me the way it works.

    So let me see if I understand, you are suggesting that I create two columns that turn into one item, and I just return part of that item?

  • mysql driver on macos sequoia

    Unsolved
    7
    0 Votes
    7 Posts
    106 Views
    L

    Macmini with M4 (apple silicon)

  • 0 Votes
    1 Posts
    13 Views
    No one has replied
  • All kits greyed out in QtCreator

    Unsolved
    6
    0 Votes
    6 Posts
    34 Views
    B

    Screenshot 2025-03-10 at 1.05.33 PM.png

  • Odd behaviors when submitting rows with NOT NULL constraints

    Unsolved
    5
    0 Votes
    5 Posts
    39 Views
    M

    Well, I hope this time it is ok for you:

    #include <QApplication> #include <QSqlTableModel> #include <QSqlQuery> #include <QSqlDatabase> #include <QSqlError> #include <QMainWindow> #include <QTableView> #include <QStyledItemDelegate> int main(int argc, char *argv[]) { QApplication a(argc, argv); QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE"); db.open(); QSqlQuery query(db); query.exec("CREATE TABLE bouquets (variant TEXT NOT NULL, name TEXT NOT NULL, capacity INT NOT NULL, PRIMARY KEY (name));"); query.exec("INSERT INTO bouquets (variant, name, capacity) VALUES ('A', 'foo', 10);"); QMainWindow window; QSqlTableModel *model; model = new QSqlTableModel(&window, db); model->setTable("bouquets"); model->setEditStrategy(QSqlTableModel::OnRowChange); model->select(); QTableView tableView; window.setCentralWidget(&tableView); tableView.setModel(model); tableView.setItemDelegate(new QStyledItemDelegate(&tableView)); QObject::connect(model, &QSqlTableModel::beforeInsert, [=](QSqlRecord &record) { switch (model->lastError().type()) { case QSqlError::ConnectionError: qWarning() << "Insert connection error" << model->lastError().text(); break; case QSqlError::StatementError: qWarning() << "Insert statement error" << model->lastError().text(); break; case QSqlError::TransactionError: qWarning() << "Insert transaction error" << model->lastError().text(); break; default: break; } }); model->insertRow(model->rowCount()); QModelIndex index = model->index(model->rowCount() - 1, 0); tableView.setCurrentIndex(index); tableView.edit(index); window.show(); return a.exec(); }

    I write again the steps:

    fill only the "variant" column, press enter and change row check the (correct) error about the missing "bouquets.name" field is fired come back to the row, check again the same error is firing (just because we changed the row, ok) fill the "name" column and press enter

    The error is fired again! But we set the column to a value different than NULL. No error should be fired.
    Now if you still edit the same column and press again enter it will change (correctly) to the next missing column.

    fill the "capacity" column and press enter. The row is submitted but:

    a) it should not since we didn't change the row
    b) a wrong error ("NOT NULL constraint failed: bouquets.capacity Unable to fetch row") is fired: it makes no sense since the field was set and the row correctly submitted

  • interest@qt.project.org appears to be offline

    Unsolved
    3
    0 Votes
    3 Posts
    32 Views
    jeremy_kJ

    The domain is qt-project.org, not qt.project.org.

    I see traffic from 9 March 2025.
    https://lists.qt-project.org/pipermail/interest/2025-March/date.html

  • No pen cursor n Qt library

    Unsolved
    12
    0 Votes
    12 Posts
    179 Views
    W

    @oneeyeman1 When I want a "familiar" but not universal icon for my application, I usually start by checking to see if there's an emoji that will work. You can render that from text using your favorite font with that character and set it as a custom cursor.

    Here's a somewhat janky utility function I have that you might find useful as a starting point. I use Font Awesome as my default font for UI symbol stuff and bundle it with the app, but you can specify whatever font when doing this sort of thing. It includes stuff like paintbrush icons, and a zillion other things that you might want https://fontawesome.com/icons/paintbrush?f=classic&s=solid

    If you are using standard emoji, you can even type them directly into your source code these days and do stuff like

    auto myBrushIcon = to_Icon("🖌") QIcon to_Icon(const std::string text, int size=64, std::string font="Font Awesome 5 Free", QColor background = QColor(255, 255, 255, 128)); /// QIcon to_Icon(const std::string text, int size, std::string font, QColor background) { QPixmap pm(size, size); pm.fill(Qt::transparent); QPainter p(&pm); int margins = 0; p.fillRect(margins, margins, size-margins, size-margins, background); QFont icon_font; if (font != "") { icon_font.setFamily(font.c_str()); } icon_font.setPixelSize(size*.75); icon_font.setWeight(0); p.setFont(icon_font); QFontMetrics metrics(icon_font, &pm); auto y = metrics.height(); // descent(); auto x = metrics.width(QString::fromStdString(text)); x = metrics.horizontalAdvance(QString::fromStdString(text)); auto offset = (size-x) / 2; // size - y - 1 p.drawText(offset, y, QString::fromStdString(text)); p.end(); return QIcon(pm); }
  • [QFileSystemModel] Data not updated after folder renaming

    Unsolved
    2
    0 Votes
    2 Posts
    34 Views
    SGaistS

    Hi,

    The patches linked in the bug report seem to provide a solution but the original submitter seem to not have pushed through.
    You could apply them to your Qt version to do what you need.

  • 0 Votes
    5 Posts
    116 Views
    J

    I came across QtConcurrent and QFutureWatcher only after I started down this path, and I was rather hoping to see if I can figure out why this isn't working before completely abandoning in favour of that approach. Realistically I can see situations where both approaches would be useful, and I would like to have both as viable options.

  • Qt Assistant and mouseover

    Unsolved
    9
    0 Votes
    9 Posts
    222 Views
    PerdrixP

    Now if QTextBrowser were based on QtWebEngine (well I can dream can't I).

  • Deleting QChart Causes 30+ Second Application Hang!

    Unsolved
    51
    0 Votes
    51 Posts
    2k Views
    F

    @Christian-Ehrlicher @JoeCFD Thank you for helping find the fix will try what was submitted to the bug report.

  • 0 Votes
    2 Posts
    35 Views
    JonBJ

    @nicker-player
    loadFinished() is issued when the engine finishes loading the HTML page. This does not mean everything on the page is "finished" as there can be further processing, JavaScript etc. I found I needed to write some JavaScript/jQuery attached to "onload"/"DOMContentLoaded"/"document ready" if you want to act on the page being "finished" client-side.

  • '#' key press not returning Qt::Key_NumberSign on Mac

    Solved
    3
    0 Votes
    3 Posts
    61 Views
    AndyBriceA

    @ jeremy_k
    That's what I was looking for - Thanks!

  • My table does't not dynamic update.

    Unsolved
    19
    0 Votes
    19 Posts
    263 Views
    JonBJ

    @architect23
    Since the code is identical the difference must come from either the value of filterNode versus new_row or the content of the node pointed to by parent_filter.

    Maybe lessThan(), which is needed for sorting, is not called because e.g. parent_filter has no children in one case so it does not need to compare to sort?

  • I can't build any version of qt because of assimp

    Unsolved
    11
    0 Votes
    11 Posts
    101 Views
    JonBJ

    @Alec_Star For the record, Qt supplies a MinGW version, use the one which comes with whichever Qt version you are building.

  • 0 Votes
    7 Posts
    134 Views
    nicker playerN

    @JonB
    thanks a lot.the topic u just mentioned is very useful.thanks a lot.

  • RGB ISSUE WITH DUNFELL

    Unsolved
    3
    0 Votes
    3 Posts
    64 Views
    B

    @Pl45m4 Thanks
    After changing into BGR also colours occurs in the different format and what way i need to debug the colour issue in the sama5d4 board or dunfell setup?

  • App crashes after deployment

    Unsolved
    11
    0 Votes
    11 Posts
    199 Views
    S

    Looks like now you copied QtPdf, QtPdfQuick and QtVirtualKeyboard. Do exactly the same for QtHunspellInputMethod.

  • QProcess language

    Unsolved
    2
    0 Votes
    2 Posts
    47 Views
    jsulmJ

    @sonichy Try to set process environment to the environment of your app:

    https://doc.qt.io/qt-6/qprocess.html#setProcessEnvironment https://doc.qt.io/qt-6/qprocessenvironment.html#systemEnvironment