Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • How to let QtCreator to HELP code "#include" ?

    Unsolved
    1
    0 Votes
    1 Posts
    126 Views
    No one has replied
  • QTest QMainWindow and deleteLater

    Solved
    5
    0 Votes
    5 Posts
    396 Views
    W
    @JonB thank you so much. That was right. there was an object that was calling deleteLater in different places and that caused a crash. It was definitelly on my side. Thanks!
  • Combobox popup and dialogs on the wrong screen

    Solved
    3
    0 Votes
    3 Posts
    328 Views
    rudagR
    @jsulm Updated to Qt 6.6.2 and it's working now! Thanks a lot
  • conflict LibXML2 validation with qt application

    Unsolved
    11
    0 Votes
    11 Posts
    901 Views
    JonBJ
    @QT-static-prgm said in conflict LibXML2 validation with qt application: i don't think using an older libxml version will solve the issue. As i build Qt from source the xml version used should be the same version as i use now for my program. It was supposed to be a test to see if it gave us a clue as to what the issue might be. Anyway I leave it with you, I don't use Qt6.
  • This topic is deleted!

    Unsolved
    16
    0 Votes
    16 Posts
    128 Views
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    25 Views
    No one has replied
  • How can I wait all request complate?

    Unsolved qnetworkreply qnetworkrequest wait
    3
    0 Votes
    3 Posts
    350 Views
    J
    @JonB said in How can I wait all request complate?: main() is no good for a Qt program I gave main() as an example. To show that there is a continuous data flow to the doSth function. @JonB said in How can I wait all request complate?: But if you really want to write your code to "block" and "wait" for a response, use a local QEventLoop instance and call exec(). This is at least an "efficient" way to do it. A couple of examples on stackoverflow illustrating just this for your QNetworkReply::finished case: https://stackoverflow.com/questions/29449561/qeventloop-proper-usage https://stackoverflow.com/questions/54694312/qeventloop-wait-for-only-local-events-not-main-loop-events Thank you I will look them
  • QtIFW parse xml for version number

    Unsolved
    1
    0 Votes
    1 Posts
    114 Views
    No one has replied
  • can't manage to resize column of QTreeView Automatically

    Solved
    7
    0 Votes
    7 Posts
    1k Views
    O
    @SGaist Thank you very much for your answer... I tried _view->header()->setSectionResizeMode(QHeaderView::ResizeToContents); in my init_wodgets function, and it looks like it's working :) I also tried connect(_model, &QFileSystemModel::directoryLoaded, _view, [this]() { _view->resizeColumnToContents(0); }); which obviously works too and might be the right way to do it... Your answer was very useful. Thank you very much for your help :)
  • Modify an XML file with QDomDocument

    Solved
    5
    0 Votes
    5 Posts
    728 Views
    C
    @JonB Sorry for the late reply doc.setContent(&file, false); works for me. Thank you .
  • Debugging in Qt creator gives SIGABRT

    Unsolved
    5
    0 Votes
    5 Posts
    1k Views
    jsulmJ
    @WildWilts Can you show your Kit and Qt configurations in QtCreator?
  • mac Codesign my QT app

    Unsolved
    1
    0 Votes
    1 Posts
    128 Views
    No one has replied
  • How am I blocking the event loop

    Solved
    13
    0 Votes
    13 Posts
    1k Views
    JonBJ
    @ocgltd said in How am I blocking the event loop: but running with Valgrind slowed everything down enough An excellent use of valgrind :)
  • how do I update the current row in the model?

    Unsolved
    3
    0 Votes
    3 Posts
    209 Views
    JonBJ
    @jdent said in how do I update the current row in the model?: since I can't find updateRecord. For that part, at the QSqlRecord level, it's bool QSqlTableModel::setRecord(int row, const QSqlRecord &values).
  • 0 Votes
    9 Posts
    978 Views
    J
    @JonB you are correct!! it was select I was looking for!! Thanks!
  • Issue when restoring docked widgets with restoreState

    Solved
    2
    0 Votes
    2 Posts
    306 Views
    SGaistS
    Hi, Until shown, widgets don't have any "physical" presence. What I usually do when restoring such settings is to use a 0 based timeout QTimer to trigger the settings loading function. This will happen after the event loop starts which usually mean that your widgets should be ready to be properly modified.
  • Error when compiling for rpi

    Unsolved
    1
    0 Votes
    1 Posts
    118 Views
    No one has replied
  • How do I make a QTableView readonly?

    Solved table view readonly
    7
    0 Votes
    7 Posts
    1k Views
    JonBJ
    @jdent said in How do I make a QTableView readonly?: @Christian-Ehrlicher sorry did not find any info on ItemFlags for QTableView In Qt's model-view paradigm the flags are returned by the model: Qt::ItemFlags QAbstractItemModel::flags(const QModelIndex &index) const, values flags Qt::ItemFlags. Qt::ItemIsEditable determines whether the model tells the view items are editable or not. A view like QTableView will call this, behind the scenes without you doing anything, and make its interface correspond to what the model wants. @mpergand's implementation does not return Qt::ItemIsEditable so items won't be editable. QTreeView will show items as non-editable.
  • How to have Qt interoperate with Metal (using the new Metal-cpp)?

    Unsolved metal metal-cpp macos
    2
    0 Votes
    2 Posts
    946 Views
    J
    Did you ever get an answer to this? I want to use many features of Qt but need to support Metal and it doesn't seem like there is an easy way with Qt widgets.
  • 0 Votes
    2 Posts
    313 Views
    Axel SpoerlA
    @jdent I am not exactly sure, what update the new record means. Update an existing record, or insert a new one? insertRecord()adds a new record to your table model. It doesn't do anything with the record's data. but with what row number That depends. currentIndex()is the currently selected index of any QAbstractItemView. It has a column()and a row(). indexAt()will return the model index at a given point on the screen. indexWidget()returns the pointer to a widget, in case you have set one. In the model itself, you have plenty of accessors to retrieve or set item data to a given model index. All of those examples can be used to modify existing records (actually: indexes).