Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.7k Topics 457.9k Posts
  • How can I retrieve a text description for a SQL field type?

    3
    0 Votes
    3 Posts
    4k Views
    J
    I did indeed mean QSqlField.type(). Thanks for the pointer. The following code does the trick: @ QSqlRecord record = ... for (int i=0; i<record.count(); i++) { QSqlField field = record.field(i); QString fieldName = field.name(); QString fieldType = QVariant::typeToName(field.type()); ...do something with 'fieldName' and 'fieldType'... } @
  • Force QPushButton release

    3
    0 Votes
    3 Posts
    5k Views
    L
    Thanks, it's a good solution, but for me it should be better to emit "released" signal when disabled. If there is no way to emit released() I think I'll subclass QPushButton .
  • QKeyEvent key as string

    2
    0 Votes
    2 Posts
    4k Views
    B
    Probably, this may help. enum Qt::KeyboardModifier contains only 7 values. Analyze the QKeyEvent::modifiers() and append the corresponding string.
  • Remove minimize button from QDialog

    8
    0 Votes
    8 Posts
    24k Views
    L
    Thanks, now I think it's not possible in linux.
  • QTwchar Built In type Entry point Error

    9
    0 Votes
    9 Posts
    5k Views
    D
    [quote] Ah, sorry, missed that with qmake in the very first post. [/quote] No problem [quote] I don’t know the reasons why the Trolls did switch of this switch and if Qt can be compiled this way at all. [/quote] :( me too, this is the problem
  • ClearWState( WState_Polished ) in Qt3 code

    3
    0 Votes
    3 Posts
    4k Views
    B
    [quote author="Volker" date="1290166755"]Yes, you can omit it. I once removed it from all my code.[/quote] Thanks.
  • The stylesheet do not work in custom widget

    14
    0 Votes
    14 Posts
    21k Views
    S
    Pfffff what a mistake we did :))))))) , QWidget supports only the background and background-origin attributes for the stylesheet, replace "backgroud-color" with "background" this is the correct answer.......
  • QDir::isWritable()?

    14
    1 Votes
    14 Posts
    20k Views
    S
    I know I started this thread a long time ago, but I just stumbled over the answer while browsing the documentation for QFile. There, it says, (http://doc.qt.nokia.com/4.7/qfile.html#platform-specific-issues) "File permissions are handled differently on Linux/Mac OS X and Windows. In a non writable directory on Linux, files cannot be created. This is not always the case on Windows, where, for instance, the 'My Documents' directory usually is not writable, but it is still possible to create files in it." It appears that it really is not writable, but I could create files in it.
  • Internal Drag'n'Drop (move) in QListView and Undo-Redo

    5
    0 Votes
    5 Posts
    5k Views
    B
    [quote author="Franzk" date="1290084294"]Maybe this one helps: "Using Undo/Redo with Item Views":http://doc.trolltech.com/qq/qq25-undo.html.[/quote] Thank you. Not exactly what I want, but very good article. Idea of using Proxy models is intersecting.
  • Using QGLBuffer instead of Vertex Buffer Object

    2
    0 Votes
    2 Posts
    3k Views
    M
    Just use it like regular vertex buffer object, bind it, and then use one of many glDraw* commands... There should be enough tutorials on the web about vertex buffer objects.
  • Button type of functionality inside QTextEdit

    6
    0 Votes
    6 Posts
    6k Views
    M
    maybe better and more easy just move custom widget to cursor point and then simply show it ?
  • Qt application from Linux to Windows

    8
    0 Votes
    8 Posts
    12k Views
    F
    [quote author="Queria" date="1290070620"]from C:\Qt\2010.05*qt*\bin (! not from C:\Qt\2010.05\bin)[/quote]The qt\bin is indeed the one you need. The bin directory is the one used by qtcreator, moc, uic and whatnot. These can be different versions on windows. M$ are being an ass by letting the developer solve the dll hell. Of course there can be problems with truly shared dlls as well, given the ever increasing amount of closed source dynamically linking applications.
  • Widget - multiple fonts

    7
    0 Votes
    7 Posts
    4k Views
    S
    what I need is a QToolButton to display his text in rich text format, I saw that a bug was posted for "this":http://bugreports.qt.nokia.com/browse/QTBUG-3535 but I was closed without being evaluated
  • [Solved] QListWidgetItem rename

    8
    0 Votes
    8 Posts
    10k Views
    T
    t3chNo is right, this is the main philosophy :) Joking aside, I guess that everybody's right, the point of view is different. Mine is: "Ok, assume that the item is editable ... which are the input keys (mouse or keyboard) that are allowed to enter in edit mode??" ... and these should be set. t3chNo is: "You should tell me if the single item is editable or not". Of course, if the default flags() allows editing, mine is the straightforward solution. Otherwise, you should do both. T.
  • QGLWidget with child widgets

    3
    0 Votes
    3 Posts
    6k Views
    R
    Hello Floof, one solution is to use the mechanics of QGraphicsScene/View to embed widgets in a scene : http://doc.trolltech.com/qq/qq26-openglcanvas.html Here, you have an example of doing OpenGL in the drawBackground of the Scene. Another way is to overpaint with a QPainter over your OpenGL scene : http://doc.qt.nokia.com/4.7/opengl-overpainting.html I think embedding directly over QWidget in a QGLWidget is problematic. Regards. David
  • 0 Votes
    5 Posts
    6k Views
    ?
    [quote author="Volker" date="1289912273"]BTW - could someone of the forum mods or the original poster change the topic please, it has nothing to do with the question. TIA.[/quote] done
  • Catch a signal from a parent class and send your own same named signal?

    10
    0 Votes
    10 Posts
    6k Views
    L
    bq. You can use QCompleter to provide auto completions in any Qt widget, such as QLineEdit and QComboBox. When the user starts typing a word, QCompleter suggests possible ways of completing the word, based on a word list. Sounds like something different! :-/ I'm gonna try Franzk solution. I think I can keep a lot of Code. The only thing i don't know how to deal with are Events. How can I ignore QComboBox's (e.g.) wheel event? EDIT : SORRY, found it myself. Using an EventHandler is the right solution! :)
  • Unable to run application with Custom Widget

    2
    0 Votes
    2 Posts
    2k Views
    G
    Die you copy your plugin dll to your application. Also you can build a (static) lib of your custom widget (without the designer plugin code) that you can link your application against.
  • JObs with QMdiSubWindow!

    11
    0 Votes
    11 Posts
    6k Views
    G
    There is an "MDI Example":http://doc.qt.nokia.com/4.7/mainwindows-mdi.html in the Qt docs. You should have an MDI area in your "main" MainWindow. If you need to instantiate sub windows from another subwindow you should do this via methods in the main window class. At least it is strange to have another MDI area an an MDI subwindow.
  • How can I use QSqlTableModel and QTableView to insert rows into a table?

    2
    0 Votes
    2 Posts
    5k Views
    J
    Posting the question led me to the answer. I'd missed QAbstractItemModel::insertRow(). Works a treat.