Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • Can "item" be added on top of the "list" ?

    Unsolved
    4
    0 Votes
    4 Posts
    1k Views
    Chris KawaC
    add - means just that - AT THE END Add means add. Doesn't really specify where. You can add to list, map, set, dictionary or sorted collection and it will have different placement in each. If you add to sorted collection it won't add at the end but at the place its sorting order indicates. For unsorted collections it just adds at the end because it happens to be the easiest and most performant operation. English word "add" doesn't have placement connotations, just expanding some collection to include given element. append - is more precise , again at the end Yes, but append is not used here for exactly that reason - it suggests position, which you can't guarantee if sorting is enabled. What should append b do to a sorted collection like this a,d,g? a,b,d,g? It breaks the meaning of append. a,d,g,b? It breaks sorting order. Both are wrong answers so if something can be sorted append operation is not included. On unsorted collections like QList or QString append is included because its meaning is clear and doesn't break container's assumptions. insert - means at selected place Agreed and it does just that. It could be more clear as insertAt, but the parameter clearly suggests that anyway. for example suggested "is sorting enabled " is NOT a feature of TextEdit. I mentioned it in context of QListWidget, which is a collection (list) of entries so it's obvious that it would sort those entries. It's not clear what would it sort in a QTextEdit - letters, words, sentences, paragraphs, text blocks, lines, something else? What if text has markup? What if there's block formatting? Should it break that, split blocks or reinterpret before sorting? Not clear at all. Different people different needs, so again - it doesn't try to guess for everyone. append - does not automatically advance line / index Why would it? Advancing a line would mean adding data to the collection that you didn't put there yourself. What if you wanted to append contents of a streaming text buffer (eg. from a real time chat) and it kept inserting line breaks whenever new data chunk arrived? It would totally destroy the data and be kinda excruciating to workaround (inserting artificial backspaces?). If you want a line break just append a line break. It's up to you as a user to implement behavior you need.
  • Button without form or simple

    Unsolved
    3
    0 Votes
    3 Posts
    225 Views
    O
    @Chris-Kawa thank you
  • Can't install the qmysql plugin in a Qt setup created using online installer

    Solved
    9
    0 Votes
    9 Posts
    883 Views
    SGaistS
    Hi, One more thing, ensure that you are using the qmake executable matching your Qt version for which you want to build the driver for.
  • QStandardItemModel or subclass QAbtractTableModel

    Unsolved
    2
    0 Votes
    2 Posts
    289 Views
    mrjjM
    Hi Well, it depends. QStandardItemModel works pretty well load and displays the data but editing is a bit clunky as when data changes, you get an Item * and must take its text and stuff it back into the right m_xxxx variable. If you make your own model, you would directly return/set the data to your CListBitmap . look here. http://www.java2s.com/Code/Cpp/Qt/Asimpleexamplethatshowshowselectionscanbeuseddirectlyonamodel.htm they uses QList<QStringList> rowList; but you would just use vector<CListBitmap> and most of the code would be the same, except the data function should also return the right m_xxx memeber it does like this now return rowList[index.row()][index.column()]; but you should map index.column() to a m_xxx variable A switch case could do it. A custom model is more code but also more flexible in the long run. It explains the functions here. https://doc.qt.io/qt-5/model-view-programming.html#an-editable-model
  • Draggable frame widget

    Unsolved c++ qt6 frame
    2
    0 Votes
    2 Posts
    473 Views
    mrjjM
    Hi Well you override the mouse functions and make it happen. virtual void mousePressEvent( QMouseEvent *e ); virtual void mouseMoveEvent( QMouseEvent *e ); virtual void mouseReleaseEvent( QMouseEvent *e ); have a look here https://gist.github.com/mnafees/10003130
  • MultiDigiMon -touch doesnt work with QProcess::startDetached("MultiDigiMon -touch");

    Unsolved
    7
    0 Votes
    7 Posts
    680 Views
    J
    @mrjj Hello, yes I can execute and no dialog are showed. I think the problem is that I am running a QT 32 bit app on a WIN10 x64 OS. Based on this post : link text But I found this post really interesting: link text I will try.
  • Programmatically determine if processor is 64-bit using Qt code

    7
    0 Votes
    7 Posts
    3k Views
    JoeCFDJ
    Sprezzatura is right. Check this out. https://doc.qt.io/archives/qt-5.9/qsysinfo.html#buildAbi https://doc.qt.io/qt-5/qsysinfo.html#buildAbi
  • 1 Votes
    7 Posts
    1k Views
    Christian EhrlicherC
    I don't think so. Simply take a look in the paintEvent() function of QTableView. Don't move columns what you want to use spans.
  • Is there a way to retrieve ui file from header file which is compiled by uic?

    Solved
    5
    0 Votes
    5 Posts
    356 Views
    A
    @JonB Thanks jon. will do that re-engineering. I opened this question to make sure that there is no tool like that which does this re-engineering things. So will close the question now. Thanks
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • automoc usage in cmake

    Solved
    4
    0 Votes
    4 Posts
    3k Views
    A
    @aravmadd @jsulm My mistake. Spell error in one of the header files. The reason for popping out this error is i named one of the header file as dumy.h instead of dummy.h
  • Widget stays on top of the qt application

    Unsolved
    5
    0 Votes
    5 Posts
    508 Views
    T
    @Chris-Kawa Ok, I wanted to be sure that i diddn't miss any qt option. I guess i have to make a concept to assign the parent dynamicly. Thanks for the help.
  • QListView flicker when inserting items in IconMode

    Solved
    11
    0 Votes
    11 Posts
    889 Views
    Z
    To close on this, I have verified that if I change the model to have a local copy of the items, i.e. instead of doing Item a = catalog->getItem(index.row()); which fetches the item from a different thread, then there is no flicker in the List View. I still believe it is a valid bug, but at least I know under what conditions it happens, so I can work around it.
  • My Array doesnt follow my window

    Unsolved
    5
    0 Votes
    5 Posts
    364 Views
    A
    @jsulm Oh my god, thank you so much. i had no idea that was related to headers, i thought i was a layout displaying problem. thank you.
  • 0 Votes
    10 Posts
    1k Views
    S
    If you have a transformation matrix A and a vector x you get the same result if you do A*x or x*(A^T) (A^T meaning A transposed). (If you want to be really precise in distinguishing row- and column-vectors you need to write x^T as well.) Now, if you have two transformation matrices A and B you want to apply successively, then it holds: B*A*x = x*(A^T)*(B^T) The reason why Qt multiplies the matrices in reverse order is because 1) their matrices are the transposed matrices and 2) they multiply the vector from the right as well. Mathematically speaking, the two are equivalent (assuming you construct the right matrix for your transformation): either chain your multiplications to the left or to the right. Just make it consistent and do not mix the two.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • Showing and hiding multiple dialogs

    Solved
    12
    0 Votes
    12 Posts
    2k Views
    A
    @SGaist @J-Hilk Thank you both! I didn't know about the QStackWidget, I'll take a look and try to create it with that.
  • How to know QTextEdit'height, when widget is hidden?

    Unsolved
    7
    0 Votes
    7 Posts
    853 Views
    S
    @qwe3 said in How to know QTextEdit'height, when widget is hidden?: But maybe there is a way to calculate this before "show()"? I know that problem very well. So far, we have not found a solution to this than to show the widget first. Somehow the sizes of widgets inside a layout are not calculated before the widget is shown for the first time. There are two functions that are supposed to recalculate the layout (QLayout::update() and QWidget::adjustSize()), but they don't do anything in this context.
  • QNetworkConfigurationManager deprecated

    Unsolved
    7
    0 Votes
    7 Posts
    2k Views
    T
    @Robotechnic Hi I'm in the same problem. Did you solve this?
  • Sidebar in QwtLegend

    Unsolved
    5
    0 Votes
    5 Posts
    486 Views
    I
    It works but now it cuts a part of the legend text [image: 11b6675e-519c-4ed3-8885-d98c2f6972a3.png]