Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • QStandardItem custom drag MIME

    Solved qstandarditem mime
    4
    0 Votes
    4 Posts
    866 Views
    Christian EhrlicherC
    @Joel-Bodenmann said in QStandardItem custom drag MIME: However, I'd like to understand why QStandardItem does not offer a setMimeData() function. Because noone wants to create a mime data just on suspicion for every item.
  • How to develop nice-looking, visually modern applications in QT?

    Solved
    7
    0 Votes
    7 Posts
    20k Views
    mrjjM
    @privatepepper Very happy to hear. Im not 100% if one can make it a Qt module or something more clever but at least this way it works then !
  • 0 Votes
    2 Posts
    577 Views
    gde23G
    The question is very general. So what exactly is the problem you cannot solve, and what have you coded so far?
  • What Qt type is best for graphics and image drawing?

    Solved
    10
    0 Votes
    10 Posts
    1k Views
    mrjjM
    @johnratius Hi LOD means Level of Detail and its often used in games where an object that is far away from view, is drawn using a lesser detailed model then when up close. for Graphics View Framework its more like a "factor" that allows you do reduce the drawing calls. Like not paint small text or what else that could make sense for your type of shapes. from the 40000 sample. Here is only draws the rect when far away and not all the small details. const qreal lod = option->levelOfDetailFromTransform(painter->worldTransform()); if (lod < 0.2) { if (lod < 0.125) { painter->fillRect(QRectF(0, 0, 110, 70), fillColor); return; }
  • Custom QTableView delegate with word wrap

    Unsolved
    5
    0 Votes
    5 Posts
    1k Views
    A
    I added in code setColumnWidth(): ui->tableView->setModel(model); ui->tableView->setItemDelegate(new TableViewColumnDelegate(this)); ui->tableView->setWordWrap(true); ui->tableView->setTextElideMode(Qt::ElideNone); ui->tableView->setFont(font); **ui->tableView->setColumnWidth(0,64); ui->tableView->setColumnWidth(1,250); ui->tableView->setColumnWidth(2,250);** Word wrap not working. Delegate didn't change. [image: c4d95d95-5616-4ff4-83e8-c877fb50840d.png]
  • UI start QTcpSocket::listen invalid

    Solved
    3
    0 Votes
    3 Posts
    239 Views
    sonichyS
    @VRonin I move the content of QThread into mainwindow.cpp, it worked now !
  • Can't get UNICODE support with QODBC and IBM DB2

    Solved
    9
    0 Votes
    9 Posts
    632 Views
    pedrogkbP
    I finally managed to build the driver with IBM DB2 11.5 libs and headers, turns out I just needed to use the MSVC 2017 compiler. Full unicode support now. Had some problems with the compiler in the past, but works just fine now, compile times for my program are vastly better too.
  • QSqlDatabase: QMYSQL driver not loaded

    Solved
    10
    0 Votes
    10 Posts
    4k Views
    M
    Hey I'm try to solve this problem. When i run the code, "qmake--MYSQL_INCDIR="%Mysql%/MySQL Server 8.0/include"MYSQL_LIBDIR="%Mysql%/MySQL Server 8.0/lib" " it's show me the message " QMake has two modes, one mode for generating project files based on some heuristics, and the other for generating makefiles. Normally you shouldn't need to specify a mode, as makefile generation is the default mode for qmake, but you may use this to test qmake on an existing project " How can i solve this?
  • Trouble making splitters?

    Unsolved
    1
    0 Votes
    1 Posts
    125 Views
    No one has replied
  • MSVC2017 compiler "not recognized" inside .pri file.

    Solved pri msvc2017
    4
    0 Votes
    4 Posts
    684 Views
    SGaistS
    AFAIR, they match the mkspecs that you can find in your Qt installation.
  • This topic is deleted!

    Unsolved
    2
    0 Votes
    2 Posts
    36 Views
  • QCoreApplication or QApplication calls are hanging the executable

    Unsolved
    6
    0 Votes
    6 Posts
    623 Views
    F
    @fcarney As I said it works ok in almost every computer, also I double checked the version of the Qt dlls and it was ok.
  • The most efficient way to filter a huge amount of data. Mentor needed!

    Unsolved
    7
    0 Votes
    7 Posts
    293 Views
    JonBJ
    @Rickz So since from your example your filters are simple sequential and do not need to look at other values, if you wish you can change so you simply read one line at a time and pass it through all the filters. Reading all the lines into memory/an array at the start does not gain you anything. In which case RAM will reduce from (300MB * whatever for each line) to about 100 bytes for one line! Up to you.
  • QWebEngineView loadfinished is too quick

    Solved
    3
    0 Votes
    3 Posts
    928 Views
    C
    I couldn't manage to implement it with runjavascript because pdf.js is way more complex than I can manage at the moment, but your link made me realize that I was ignoring a big part of qwebengine. I think I can use runjavascript to inspect DOM and see if it has already loaded. Thank you!
  • How to make destop panel (e.g. like Plank, Docky,Screenlets)

    Unsolved
    2
    0 Votes
    2 Posts
    284 Views
    mrjjM
    Hi For global hotkeys, you have to use platform API Like http://amin-ahmadi.com/2015/11/14/how-to-use-system-wide-hotkeys-in-your-qt-application/ for windows. For linux, i would inspect something like http://www.nongnu.org/xbindkeys/xbindkeys.html to see how it does. Regarding the stay on the top and stay in background feature. This will depend heavily on the Windows manger if supported/allowed.
  • [Solved] Qt Creator Run button disabled

    9
    0 Votes
    9 Posts
    11k Views
    Qibiron WhoQ
    This Issue seems quite old, for anyone who just wanna bring their Qt Creator back to work, here is some tricks I learned from somewhere else, share with you. Qt Creator Version: 4.11.0 Based on Qt 5.14.0 [quick solution]: right click <sources> folder under project tree, add some random file. After that the "Run" button activated again, this is definitely a Qt Creator bug. The reason I come up with this Bug is: I added created new subproject for unit test, and I delete or remove it somehow, and the run button just not working anymore, even after I restart the Qt Creator, until I found the trick above somewhere in youtube. I hope it helps any single one who is struggling.
  • std::string to QString can't convert properly

    Solved
    19
    0 Votes
    19 Posts
    10k Views
    mrjjM
    @Ketan__Patel__0011 Hi Since its not unicode or UTF8 or real text at all you cannot just store it in the DB as it expects it to be valid text with valid encoding. So do as @Bonnie says and store them in a blop via QByteArray. Like this sample storing images. https://wiki.qt.io/How_to_Store_and_Retrieve_Image_on_SQLite Note, the type used for creating the table query.exec( "CREATE TABLE IF NOT EXISTS imgTable ( filename TEXT, imagedata BLOB )" ); Then it won't alter your data and it should work. Your output from the encryption is no longer valid text. Treat it as a binary thing and use QByteArray in case it might add a zero in there. std::string and QString is not ok for this sort of data in many cases.
  • Creating double Widgets

    Solved
    5
    0 Votes
    5 Posts
    591 Views
    F
    @mrjj I will definitly give it a try, thank you :)
  • Adjusting Indenting for QTreeView items

    Unsolved
    4
    0 Votes
    4 Posts
    2k Views
    mrjjM
    @Taytoo Hi Did you try a Delegate to paint it the way you like ? https://stackoverflow.com/questions/55969916/how-to-remove-qtreeview-indentation
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    73 Views
    No one has replied