Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.5k Topics 457.3k Posts
  • Qt5SQL MS SQL server querying is slow

    Unsolved
    4
    0 Votes
    4 Posts
    618 Views
    R
    Well I was able to get a significant speed increase in a production build by doing a bunch of query optimization. I no longer query a nvchar(400), 26million times. Instead, I let the server filter the names, into a new table and then I query the new table for all the names and create a map in my program. Luckily the database has a unique ID for every name. This is how I expected I would have to do it if I was processing billions of rows. I guess I will need to stick with Linux if I do that. My processData() code is slower than it is on linux for some reason. SQLServer::loop() processed 26800000 messages in 227282 ms
  • Where is QOpenGLWidget?

    Solved
    7
    0 Votes
    7 Posts
    5k Views
    F
    @appas Thank you, you saved me)
  • Cross platform taskbar progress indicator

    Unsolved
    2
    0 Votes
    2 Posts
    224 Views
    SGaistS
    Hi, Since it's a user forum, you are not very likely going to get an answer about that. In between, nothing forbids you to try and build the module with Qt 6 and integrate it into your application.
  • Problem with QPlainTextEdit

    Solved
    9
    0 Votes
    9 Posts
    584 Views
    JonBJ
    @GGG03 said in Problem with QPlainTextEdit: I found the problem. It was the font. I was using Terminal 9, and with Segou UI it is not laggy. LOL! Hopeless.
  • Error while loading shared libraries: libQt5Charts.so.5

    Solved
    5
    0 Votes
    5 Posts
    3k Views
    V
    @MarcoChiesi79 Even though this ones quite old: Would you mind explaining how exactly to include the library and perform the new bitbake? This would help me and maybe others having your exact issue.
  • Is there an easy way to escape all non-ASCII characters of a QString?

    Solved
    15
    0 Votes
    15 Posts
    4k Views
    l3u_L
    @l3u_ However, it would be encoded as =01, not =1 ;-)
  • Is it possible with QScrollArea behave like a wheel?

    Solved
    6
    0 Votes
    6 Posts
    702 Views
    C
    @TheoSys What if this feature gets suggested? Although the only way that I found to do that is by using the bug report system. But then I suspect it would be shut down as "user can implement this themselves".
  • QByteArray Datetime convert

    Solved
    6
    0 Votes
    6 Posts
    717 Views
    JonBJ
    @Abderrahmene_Rayene Absolutely no harm saying so your way :) Preference only. Just make 100% sure the fromString()/toString() work the same way as each other with regard to local time vs universal time.
  • Convert QByteArray to int

    Solved
    6
    0 Votes
    6 Posts
    936 Views
    Christian EhrlicherC
    @Damian7546 said in Convert QByteArray to int: quint16 val = buf2.toHex().toInt(nullptr,10); No, since toInt() converts readable characters written as integers, not binary stuff - please read the documentation.
  • How to install newer version Qt6 in Mint ?

    Unsolved
    3
    0 Votes
    3 Posts
    5k Views
    JonBJ
    @ChrisW67 , @AndrzejB But don't come back to us if you find the download isn't working right now... ;-)
  • Qt3DExtras Weird behaviour with materials

    Unsolved
    1
    0 Votes
    1 Posts
    125 Views
    No one has replied
  • QQuaternion convert euler angle to quaternion not work

    Solved
    3
    0 Votes
    3 Posts
    321 Views
    W
    @SGaist thks, i mixed qquaternion with eigen library.
  • Qt Installer Mac OS X Broken

    Unsolved
    1
    0 Votes
    1 Posts
    146 Views
    No one has replied
  • How to test QTableView cell editing in a unit test?

    Unsolved
    2
    0 Votes
    2 Posts
    334 Views
    SGaistS
    Hi and welcome to devnet, You should check that you actually got an editor. Did you consider using the edit method ? It would be simpler than trying to click on the table view.
  • Populate QTreeView from SQL.

    Solved
    6
    0 Votes
    6 Posts
    2k Views
    C
    @ytx-cash void amsSupport::loadRentalForms() { QSqlQuery sql; QString sqlStatement = "SELECT * FROM RENTALS ORDER BY `Order Number` DESC "; QTreeWidgetItem * child = nullptr; QStringList header, parentString, childList; QString previousClass=nullptr; int row = -1; ui->amsSupportTreeViewWidget->clear(); // Clear the widget if(sql.exec(sqlStatement)) { header << "Order Number" << "Order Date" << "Customer Name" << "Equipment" << "Serial Number" << "Stock Number" << "Sales Person" << "Store Location" << "Status" << "Remarks"; ui->amsSupportTreeViewWidget->setHeaderLabels(header); while(sql.next()) { QString className = sql.value(0).toString(); if(previousClass != className) { parentString << sql.value("Order Number").toString() << sql.value("Order Date").toString() << sql.value("Customer Name").toString(); QTreeWidgetItem *item = new QTreeWidgetItem(parentString); ui->amsSupportTreeViewWidget->addTopLevelItem(item); previousClass = className; parentString.clear(); row++; } childList << " -> "; childList << sql.value("Order Date").toString(); childList << sql.value("Customer Name").toString(); childList << sql.value("Equipment").toString(); childList << sql.value("Serial Number").toString(); childList << sql.value("Stock Number").toString(); childList << sql.value("Sales Person").toString(); childList << sql.value("Store Location").toString(); childList << sql.value("Status").toString(); childList << sql.value("Remarks").toString(); child = new QTreeWidgetItem(childList); child->setFlags(child->flags() | Qt::ItemIsUserCheckable); ui->amsSupportTreeViewWidget->topLevelItem(row)->addChild(child); childList.clear(); } } else { log_error(); } } What this does is pull my rental order numbers then adds them to the item based tree view widget one by one until the order number changes then starts a new row. Here is the outcome [image: 8d2c6ca2-d9d1-4923-9f5b-b70a911cbc9f.png] I'm sure by now there are better methods of doing this but this is what I did and its been working fine. Good luck!
  • QMediaPlayer and network files on Windows

    Unsolved
    1
    0 Votes
    1 Posts
    199 Views
    No one has replied
  • QT Docs

    Unsolved
    1
    0 Votes
    1 Posts
    135 Views
    No one has replied
  • Minimum height of QTableView

    Solved
    7
    0 Votes
    7 Posts
    1k Views
    PerdrixP
    @Perdrix Problem solved - there was a minimum size on the QDockWidget that was set. I adjusted that and all appears good now! Thanks, D
  • 0 Votes
    1 Posts
    124 Views
    No one has replied
  • QSQLRelationalTableModel display relation

    Solved
    12
    0 Votes
    12 Posts
    645 Views
    B
    @JonB We got it! [image: b5646101-1b90-4d5e-80b2-664d539aa481.png] This part of code was a solution: tableModel->setRelation(6,QSqlRelation("instruments","InstrumentID","InstrumentDimension1, InstrumentDimension2, InstrumentDimension3")); Thank you very much! Have a great day :)