Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.7k Topics 457.9k Posts
  • [Solved] Edit an AbstractListModel with a QFileDialog

    4
    0 Votes
    4 Posts
    2k Views
    G
    You're welcome. Keep in mind, that you are completely responsible of managing the data storage. QAbstractItemModel just provides the interface for a standardized way of accessing and setting the data, the implementation is solely up to you.
  • 0 Votes
    1 Posts
    2k Views
    No one has replied
  • QFrame: Why do i need paint twice to be able to see it?

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • [Solved] QMdiSubWindow deletes internal widget on close?

    3
    0 Votes
    3 Posts
    3k Views
    S
    Thanks Chris!
  • Re-ordering QListWidget's items in IconMode

    4
    0 Votes
    4 Posts
    4k Views
    C
    Oh, I see. I don't think that functionality is built into QListWidget. I guess you could subclass QListView and reimplement the drag event to move the widgets around so that there was always a "hole" under the cursor.
  • [Solved] QDialog as UserControl?

    8
    0 Votes
    8 Posts
    4k Views
    D
    @Andre, ouch, how could I miss that :) Thank you very much, I appreciate your help :)
  • Partially bold text in a QListWidgetItem

    4
    0 Votes
    4 Posts
    7k Views
    A
    Putting widgets in there is even more expensive, and harder to manage. I used QTextDocument::drawContents(), and kept the textdocuments in a cache.
  • How to add a note in the new "notes" section of the Docs?

    5
    0 Votes
    5 Posts
    2k Views
    D
    Ah I found this: Ant Farmer (181 points) : can tag (while were in Open Beta all ranks can tag) and add doc notes
  • [Closed] Record and row in a QSqlTableModel

    Locked
    2
    0 Votes
    2 Posts
    2k Views
    A
    Sorry, you have opened enough topics on this issue now. Please stick to those. I am closing this one.
  • QListWidget Help

    3
    0 Votes
    3 Posts
    2k Views
    G
    First: make your code readable. The indenting is a complete mess. Blocks of code at the same level (if, loops) should be aligned at the same level. Your code to check whether an item is in the list, is broken. If you have 10 items in the list, you add the incoming string 9 times. I would suggest to use QListWidget's findItems() method to check for the existence of an item. The construction of your msg QString is suboptimal. You construct a default empty string and assign a newly created string afterwards. This is better: @ QString msg(datagram); @ Note, that QString has a constructor taking a QByteArray, there's no need to use the const char data pointer of the array. Did you check that msg contains a proper string?
  • [SOLVED] QHash string error

    2
    0 Votes
    2 Posts
    2k Views
    K
    i solved this post. i had to remove the line QStringList userselect; from the mainwindow.cpp file. sorry for this inconvenience.
  • Adding SubWindow to a MDI Area will not work inside a slot function

    2
    0 Votes
    2 Posts
    4k Views
    B
    This is not a bug, I figured out why after looking at the MDI example. I need to call SubWindow->show() after I add it to the mdi area.
  • Removing key bindings from QLineEdit

    9
    1 Votes
    9 Posts
    5k Views
    C
    AH! Your'e right then, that's exactly what I want: I didn't understand that the eventFilter() was happening BEFORE the event made its way to the QLineEdit, I thought it was something I had to implement IN the QLineEdit. Awesome, thanks for the clarification.
  • RemoveRow() method of a QSqlTableModel object

    2
    0 Votes
    2 Posts
    1k Views
    C
    Have you tried checking the return value (it's a boolean, I believe), and if false checking lastError() to see if it contains info about the failure?
  • Extend qDebug, qWarning ... with my own qSomething

    8
    0 Votes
    8 Posts
    6k Views
    J
    Ok I think it is not the first time I do not express correctly what I am trying to do. I edited the first post. Tell me if it is not clear.
  • Qt Clear the Contents of a QFile

    2
    0 Votes
    2 Posts
    24k Views
    D
    QFile::resize(0).
  • [SOLVED]Missing run time on Windows 7

    13
    0 Votes
    13 Posts
    11k Views
    G
    [quote author="Gerolf" date="1323954896"] AFAIK the debug msvcrt* files are not allowed to distribute. (MS license)[/quote] This is true and it is clearly stated in readme file.
  • Qt OpenGL project[SOLVED]

    4
    0 Votes
    4 Posts
    2k Views
    D
    Thank you for your answer!
  • Swap from one ui. Form to another on button click

    4
    0 Votes
    4 Posts
    6k Views
    A
    if the login details are ok, send a signal that connects to some slot that creates + shows the logged.ui form, and then hide() the mainwindow [code] void mainwindow::tryLogin( /* some details */) { bool login_is_ok = some_checking_method(/details/); if (login_is_ok) { emit signal_do_login(); hide(); } } [/code]
  • Replace ncurses-Masks of Fortran-Progr. with Qt-Masks

    2
    0 Votes
    2 Posts
    2k Views
    C
    If I understand you correctly, you have a Fortran program that uses nurses to get user input, and you basically want to convert it to use Qt, but without requiring major modifications to the original code, basically just trying to use Qt as a drop-in replacement. The problem is, Qt (and really all modern GUI packages) operate on a fundamentally different paradigm from ncurses, as you just discovered when you entered the event loop. nurses doesn't have en event loop, you manually step through each screen and your code basically draws them in sequence. Qt is an event-driven architecture: this allows it to respond to mouse clicks, lets you drag windows around, have multiple dialogs up at once, etc.: it's the foundation of modern user interface design. As such, converting from nurses to Qt is not at all straightforward. That is not to say it cannot be done, of course, but you need to reverse the problem: think of the Qt program as your main program, and your Fortran code as running inside of it. You want your various function calls from Fortran to act as events in Qt's event loop, and then write handlers that show the appropriate dialogs and then return the data to the Fortran code. All told, this is a big undertaking: is there a version of this Fortran code that simply reads an input deck (i.e. that doesn't use the nurses stuff)? The way I usually write this sort of interface is to design a GUI that ultimately just writes the input deck out and then triggers the Fortran code to read it.