Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.4k Posts
  • Connect Doubts...

    4
    0 Votes
    4 Posts
    2k Views
    A
    There are several versions of disconnect, which take different sets of arguments. Did you read the docs on all of them?
  • QToolbar question

    3
    0 Votes
    3 Posts
    2k Views
    F
    OK, Thank a lot, I see it in the docs as well now (must have been tired ...)
  • Is that meego will reborn?

    2
    0 Votes
    2 Posts
    1k Views
    L
    See http://qt-project.org/forums/viewthread/18609.
  • Event/signal when any kind of gui activity occurs

    2
    0 Votes
    2 Posts
    2k Views
    D
    You could make a timer which triggers every 5 secs and checks whether the cursor has moved further than, for example, 2 pixels in that time (see QCursor::pos()). If it hasn't moved for n consecutive intervals, lock the application. For the keyboard it's more difficult when your program doesn't have focus. I wouldn't recommend creating keyboard hooks for this, because your program wouldn't be distinguisable from a malicious keylogger. If you just want to react to keyboard events while your application is active, look into event filters. //EDIT: Thought about it. If you're not writing a text editor or word processor, just checking the cursor position and ignoring the keyboard should be fine for your purpose. //EDIT2: If this is an industrial application (i.e. doesn't need to be pretty but robust), assign each user his own background color tone. This way a user will feel foreign when working with a different account and should notice it right away.
  • #if Q_BYTE_ORDER = Q_LITTLE_ENDIAN apparently not working

    4
    0 Votes
    4 Posts
    2k Views
    P
    Thanks mburr! I did some more testing and you pinpointed the problem exactly.
  • Qt dimension

    5
    0 Votes
    5 Posts
    2k Views
    B
    I will try it. Thank you
  • Layouts in QtCreator for beginners

    10
    0 Votes
    10 Posts
    13k Views
    N
    I found this useful when I was beginning to learn about layouts: "http://www.informit.com/articles/article.aspx?p=1405224&seqNum=4":http://www.informit.com/articles/article.aspx?p=1405224&seqNum=4
  • How to format QString to remove % and & symbols for URL requests

    5
    0 Votes
    5 Posts
    4k Views
    M
    So, you're basically needing to parse, unencode, and simplify a URL? If so, look at the QUrl documentation. It has some methods which may be helpful for you. "fromPercentEncoding":/doc/qt-4.8/qurl.html#fromPercentEncoding might be a good start. "path":/doc/qt-4.8/qurl.html#pathx and the queryItem methods might also be helpful as well. (You'd have to manually pull out the URLs from the XML, of course, to process them.)
  • HEAP CORRUPTION DETECTED

    6
    0 Votes
    6 Posts
    9k Views
    K
    You will see the error concerning heap corruption in debug builds because heap checking is being carried out when freeing memory only in the debug C++ runtime libraries. Usual causes are writing past the end of an array you've allocated on the heap, using delete / delete [] wrongly etc.
  • Qt animation + button bouncing up

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Solved : Reading ASCII/UTF-8 file

    8
    0 Votes
    8 Posts
    6k Views
    K
    [quote author="Andre" date="1342688046"] [quote author="koahnig" date="1342687524"]Did you check out "fromUnicode?":http://qt-project.org/doc/qt-4.8/qtextcodec.html#fromUnicode At least from the name and description it seems to be fitting. However, Andre may have more experience with this. [/quote] The problem is that the codec used is not a codec in the normal sense. It is a unicode escape sequence in an otherwise ASCII-encoded file. So to use this method, you first have to actually implement a codec that does that translation back and forth. If you have to work with these files, it is probably a good idea to implement such a codec. Doesn't seem all that hard to me... [/quote] Andre, thanks for clarification
  • Error while integration Qt files with existing Visual studio project

    6
    0 Votes
    6 Posts
    3k Views
    K
    You could setup a new project with some features you are requiring from Qt. Especially you need to have a header with an object inheriting from QObject. In MSVC you need to check the different build features. The header file with QObject is having a custom build step. Those build steps are required for moc'ing. However, who knows what comes as next problem. I have done such introduction of the custom build steps myself when it was somehow messed by msvc. However, my recommendation is "Think twice". At the day's end the fresh setup of the project may be ways faster. It would be the way I would choose. My projects have a couple of libs with a couple of hundreds source files each. Pulling in existing source files in msvc is certainly boring, but it is rather short with may be an hour. Trying to search all the requirements of custom build steps may be a couple of days and a lot of hair pulled ;-)
  • Is there a way to view a QImage “live” on the UI?

    6
    0 Votes
    6 Posts
    4k Views
    W
    Hello. AFAIK it's possible to set Z-order for objects at QGraphicsScene. My suggestion is to use something like layers: you draw your picture on the background, while user changes pixels on the foreground. When you need to save your picture you just get all pixels that were changed and write it into pixmap.
  • QFtp strange behaviour.

    3
    0 Votes
    3 Posts
    2k Views
    S
    Hi, that's for your answer. I'm pretty sure it crashed on Qt code.
  • Crash inserting QTreeWidgetItem into a QTreeWidget

    4
    0 Votes
    4 Posts
    2k Views
    C
    Just as a follow-up for those interested, I spent some time debugging QtGui4.dll and found the problem. The crash happends in QAbstractItemView.cpp in function : @ QStyleOptionViewItem QAbstractItemView::viewOptions() const @ at line 3576 @ option.rect = QRect(); @ I looked in QRect class and found no assignment operator. So I implemented one to check and everything worked fine after. It's a very simple fix.
  • Editing XML

    8
    0 Votes
    8 Posts
    10k Views
    P
    KA510 is right. You can use something like this to overwrite the file: @ xmlfile.resize(0); QTextStream stream; stream.setDevice(&xmlfile); doc.save(stream,0); xmlfile.close(); @ I'm new to Qt too, so maybe there's a better way to do it.
  • [SOLVED] How I can set QTableWidget cells?

    2
    0 Votes
    2 Posts
    2k Views
    I
    [SOLVED] :D I added this line and worked. @ ui->tableWidget->insertRow(row);@ Google is my best friend :D
  • [SOLVED] SMTP attachments not completed

    2
    0 Votes
    2 Posts
    2k Views
    JeroentjehomeJ
    It was the Exchange server that just killed the xls files as being virus friendly.
  • Which one is quicker?

    5
    0 Votes
    5 Posts
    2k Views
    I
    [quote author="sidewinder" date="1342615854"]If you have time to experiment then try and implement different approaches to your problem. You can use QTestLib to take some "measurements":http://qt-project.org/doc/qt-4.8/qtestlib-manual.html#creating-a-benchmark and compare numbers. IMHO, if data structure is really so simple, if row count will be held between 10 and 100 and you are not going to run your program on some embedded device or anything really slow then you most likely won't see much difference in speed if any.[/quote] Yes, I have time. ( I'm on summer holiday). So I will try also your idea.
  • [QT 4.6.3] QtreeView: where to put a wait cursor during data search?

    5
    0 Votes
    5 Posts
    2k Views
    sierdzioS
    Nice to hear that, thanks for updating.