Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • Regarding reading version details from exe

    3
    0 Votes
    3 Posts
    2k Views
    G
    If you need the win API for versioninfo, have a look "at this thread":http://developer.qt.nokia.com/forums/viewthread/11377/
  • Small problem with QProcess output

    4
    0 Votes
    4 Posts
    2k Views
    G
    Sorry, I have absolutely no knowledge about tclsh and how it behaves. I can only give general advice here, and usually problems caused by "missing" stdout from a QProcess is caused by some buffering on the started process' side...
  • Help using QUdpSocket in blocking mode without an event loop

    3
    0 Votes
    3 Posts
    4k Views
    D
    Hi Yes, if you look at the code you will see that I have tried that. What I dont understand is a way to make writeDatagram behave like socket.h function sendto in blocking mode. Any help would be appreciated Regards
  • 0 Votes
    9 Posts
    7k Views
    L
    Singletons probably won't hit you immediately (except you are doing unit testing or multithreaded programming), but as with every bad design choice they involve a potential problem that might hit you at any time - with an increasing probability the lager a project becomes. And a global state, tight coupling and the violation of the single responsibility rule are huge problems when they become a problem. There are situations where singletons do make sense, but in 90% of cases singletons are just misused and they are used as a substitution for a global variable - and in the remaining 10% the classical singleton pattern can be most probably substituted with another singleton-like design pattern. In my humble opinion this fact alone qualifies them as an anti pattern. But enough of derailing this topic! :) Let's end it with a riddle: who said "When discussing which patterns to drop, we found that we still love them all. (Not really—I'm in favor of dropping Singleton. Its use is almost always a design smell.)"?
  • Making a checkbox in a QTableView useable?

    5
    0 Votes
    5 Posts
    8k Views
    S
    Thank you for pointing me in the correct direction, once I know the solution was found within the editorEvent(), I found this article that solves both my problem along with centering the checkbox. Very nice! "How can I align the checkboxes in a view?":http://developer.qt.nokia.com/faq/answer/how_can_i_align_the_checkboxes_in_a_view
  • 0 Votes
    2 Posts
    2k Views
    G
    For the types mentioned in the title (odt = Open Office, doc/docx = MS Word), there is nothing built into Qt. You will have to use external libraries that parse that file formats for you (or write them yourself).
  • Model\View Framework

    4
    0 Votes
    4 Posts
    3k Views
    S
    For those who want to solve the same problem, I have written a Wiki page with the code snippet "link":https://developer.qt.nokia.com/wiki/QSortFilterProxyModel_subclass_for_text_alignment_-and_readonly_columns. Thanks again Andre for the solution proposal. I hope the code I have written can evolve to some more complete class which can satisfy every user. Feel free to edit this Wiki page! (which by the way I don't know if it is possible) Seba84
  • [SOLVED] QGLContext::choose Context(): OpenGL 3.3 is not supported

    2
    0 Votes
    2 Posts
    3k Views
    Y
    I seem to have fixed this now - I was getting (and ignoring as I didn't think it was relevant and the code ran) the compile error: /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/X11R6/lib/libGL.so when searching for -lGL My project '.pro' file was missing '-L/usr/X11R6/lib64' in the 'LIBS =' line. When you create the Makefile (e.g. via 'Run qmake' in Qt-Creator) it creates a makefile with this library call in. You have to remove the existing '-L/usr/X11R6/lib' entry for the 32-bit libraries. It then appears to compile okay. It no longer produces the error mentioned above and the shaders compile. Apologies for the convoluted method - it would be better to change the default libraries used. I guess this is done via a different qmake '.conf' file, but I've not worked out how to find / change this via Qt Creator yet...
  • Model/View Framework

    5
    0 Votes
    5 Posts
    3k Views
    B
    Just making an modest observation for further improvement, as advised by Nokia itself... In fact, there wouldn't be so much to change. Right now there is already a beautiful mechanism, the stylesheet, that makes it possible to style some properties of a treeview, like the background color for example. So one possibility would be to extend these properties (with something like CSS selectors, allowing to select specific row and/or columns, and even items). For example I don't understand why it's not possible to set the text-align of a qtreeview via the stylesheet, while it is with some other widgets ? (or maybe it is, but I failed to find how). Otherwise I finally got the right way to "flash" a specific item, indeed subclassing itemdelegate, so if anyone is interested, just ask....
  • Crash in QTcpSocket inherited class : Help Needed

    9
    0 Votes
    9 Posts
    5k Views
    R
    Well, since most of the surrounding socket code is the same in Qt 5.0, you could have a look at the implementation from there. It might help you out.
  • How to insert many items into QListView without making the app freeze?

    22
    0 Votes
    22 Posts
    11k Views
    G
    Because the item views are a bit imperformant when using many item widgets. That's not the main usage they were designed for.
  • QAudioDeviceInfo - no formats available

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • Virtual Camera Device

    2
    0 Votes
    2 Posts
    3k Views
    T
    This is that you are looking for: "Canival LiveCam":http://developer.qt.nokia.com/forums/viewthread/12519
  • QDataStream won't work with custom crafted char array

    2
    0 Votes
    2 Posts
    2k Views
    G
    It's most probably a byte order issue. Windows uses little endian, whereas QDataStream by default uses big endian. You should add this right after the data stream instantiation (after line 15): @ ds.setByteOrder(QDataStream::LittleEndian); @ A platform independent way would be: @ #include <QSysInfo> ds.setByteOrder(QSysInfo::ByteOrder); @
  • Recognize ~ in UNIX , with QCompleter

    5
    0 Votes
    5 Posts
    2k Views
    C
    @class UnixFsValidator : public QValidator { public: UnixFsValidator(QObject *parent): QValidator (parent) {} virtual void fixup (QString & path) const { path.replace(QRegExp ("^~") , QDesktopServices::storageLocation(QDesktopServices::HomeLocation)); qDebug() << "Replaced to: " << path; } virtual State validate (QString &, int &) const { return QValidator::Acceptable; } }; @ So I'm wrong again ? This time i even see no output.
  • Suspected Bug in cursor registration with Qt4.8 and Mac OS X

    2
    0 Votes
    2 Posts
    1k Views
    K
    Can you prepare a small example showing the issue. That would help to demonstrate the problem. If you cannot find it on "JIRA, you probably should file a bug report there.":https://bugreports.qt-project.org/secure/Dashboard.jspa Please post a link here so that people can watch and vote your bug report.
  • Hand code GUI completely

    29
    0 Votes
    29 Posts
    18k Views
    A
    I agree: Designer-based UI's when possible, and hand-crafted when needed. However, I must say that at time, I also find that I fight with Designer more than I like.
  • How to fix the MDI Window?

    13
    0 Votes
    13 Posts
    7k Views
    M
    [quote author="Lukas Geyer" date="1327754227"]-Do you want to prevent the MDI windows from beeing dragged outside the visible area?- Too slow.[/quote] For that reason but, QMdiArea among child windows overlap, because the case is being generated.
  • QMYSQL equivalent of MYSQL source function

    2
    0 Votes
    2 Posts
    2k Views
    G
    There is no built-in method for this. You will have to read the file yourself into a QString and pass that to the prepare method of a QSqlQuery.
  • Restrict QGraphicsLineItem movement

    5
    0 Votes
    5 Posts
    4k Views
    A
    [quote author="cincirin" date="1327748569"]If you want to add QGraphicsLineItemMember object to scene you need to use "QGraphicsScene::addItem":http://developer.qt.nokia.com/doc/qt-4.8/qgraphicsscene.html#addItem @ QGraphicsLineItemMember* lineItemMember = new QGraphicsLineItemMember(); pq_scn->addItem(lineItemMember); @[/quote] works perfect, thank you!