Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.5k Posts
  • QFileSystemModel: fileName works, filePath and fileInfo crashes

    3
    0 Votes
    3 Posts
    3k Views
    D
    YES! You saved my life. Works perfectly. I suspected that it might be due to the different indexes, however I didn't know how to match them. Thanks a lot for the explanation :)
  • QGLWidget with custom OpenGL context

    3
    0 Votes
    3 Posts
    5k Views
    M
    I wrote a small article to describe that : http://virtrev.blogspot.fr/2012/12/custom-opengl-context-with-qt.html
  • [SOLVED]qUncompress not enough memory

    7
    0 Votes
    7 Posts
    7k Views
    J
    I removed QIODevice::Text when saving. I assume that it's binary by default, as there is no binary flag. I added toBase64 when saving and fromBase64 when reading. I still get an error that data is corrupted. When I remove conversion to/from base64 on both sides, it's the same error: input data is corrupted. The only difference is with and without base64 is: With base64: @qUncompress: Input data is corrupted@ Without base64: @qUncompress: Z_DATA_ERROR: Input data is corrupted // Notice Z_DATA_ERROR@ EDIT After recompiling entire project, started to work. There are no Text mode flags while reading, saving, and there is no conversion to base64. Marked as Solved. Thanks for the help! Regards, Jake
  • Render QGraphicsScene to a QPrinter to export PDF

    6
    0 Votes
    6 Posts
    9k Views
    B
    I tried a Python version and it seems to work: @ def exportPDF(self): fileName = "/tmp/test.pdf" printer = QPrinter (QPrinter.HighResolution) printer.setPageSize(QPrinter.A4) printer.setOrientation(QPrinter.Portrait) printer.setOutputFormat(QPrinter.PdfFormat) printer.setOutputFileName(fileName) p = QPainter(printer) self.scene.render(p) p.end() @ Steno: Is it really an "external device" if you are printing to a file? An architecture for printing can be very confusing. For example, is a PDF file paginated? Do you use a "Print Setup" dialog to setup the pagination of a PDF file? Why not the same for SVG format? Is it because external printers and PDF files support the notion of many pages, while SVG format doesn't (but defines a viewport that is a single page?)
  • [SOLVED] Determining coordinates for Custom Completer

    4
    0 Votes
    4 Posts
    1k Views
    D
    You should retrieve the combobox position every time the completer shall pop up and update the list view's coordinates accordingly. Taking and setting the position once in the combobox or mainwindow show() isn't enough. The combobox might change its position (think of rearranging, resizing,...)
  • Iterate over a QList with QFile's

    5
    0 Votes
    5 Posts
    6k Views
    JeroentjehomeJ
    Be aware that the foreach is much more code consuming then the C-style for loop, but if it isn't used a lot, the foreach is the way to go ;-) The correct use of the iterator is more like this: @QList<QFile *>::iterator i;@
  • Changing layout depent on class

    3
    0 Votes
    3 Posts
    1k Views
    T
    You could have the derived classes all return a widget and embed those into a static layout. We do that a lot in Creator: e.g. the Projects mode is basically widgets from all kinds of plugins merged into one common layout.
  • Is QtWebKitd5.lib missing from Qt 5.0.0 Beta?

    25
    0 Votes
    25 Posts
    10k Views
    T
    [Late response, but posting for others who may also have hit this particular error]. Regarding the error: ‘...\configure.exe’ is not recognized as an internal or external command... I was getting this error as well. Digging into it a bit, in qtbase\configure.bat, there is a test for the existance of a file called '.gitignore'. If this file does not exist, then it jumps to the end of the script and attempts to run 'configure.exe'. If the file does exist, then it first builds configure.exe (among other things). I suspect you're getting this error because, like me, you downloaded the sources from the link on http://qt-project.org/downloads rather than getting them via git. For some reason, the .gitignore file is missing from the qtbase directory. When I got the sources via git, the file was present. Just create the file (e.g. "echo foo > qtbase.gitignore") and you should be able to run the configure script successfully. [Perhaps the configure.bat script should instead test for the presence of qtbase\configure.exe, rather than qtbase.gitignore?]
  • [SOLVED]QMutex not working at same way on Windows and Linux

    7
    0 Votes
    7 Posts
    5k Views
    A
    Thanks, your reply is very helpful!
  • Buffered http for large downloads?

    5
    0 Votes
    5 Posts
    2k Views
    G
    In the end, painfully googling: I found i needed this in my .pro file @symbian: { TARGET.EPOCHEAPSIZE = 0x200000 0x2000000 }@ this sets the min and max heap size.
  • Activeqt events problem

    7
    0 Votes
    7 Posts
    6k Views
    V
    I'm generating class with dumpcpp and it also has "skipping event interface" line. But when I'm using signal by name it works fine. Just make sure you are specifying correct signal name.
  • 0 Votes
    4 Posts
    3k Views
    M
    Glad it did the trick! It's a common mistake to make. :-) Be sure and edit your initial post to add [Solved] to the title. Thanks!
  • Qt3D - Retrieving Qml Viewport Element as C++ Object

    2
    0 Votes
    2 Posts
    2k Views
    P
    For those interested, you can't really retrieve a Viewport directly from qml as it is a QQuickItem. So either you retrieve it as a QQuickItem* and then try to insert your 3D items in it (not tested but it should work) or you do this on the qml side using loaders.
  • Qtcreator debug mode question

    2
    0 Votes
    2 Posts
    822 Views
    T
    Read the code that defines the datatypes. That is what defines how things look in memory.
  • [SOLVED] Using "open" methods in QPrintDialog and QFileDialog

    3
    0 Votes
    3 Posts
    2k Views
    G
    Qt 4.8.4 has fixed the bug that was causing this problem.
  • [SOLVED] QDockWidget missing title text

    3
    0 Votes
    3 Posts
    2k Views
    X
    Thank you!! Funny, this is second time I made this mistake, I had the same problem with graphics scene. Hopefully, this is the last time I make this mistake.
  • [Resolved] How to Create a Pointer from Object like the example?

    8
    0 Votes
    8 Posts
    2k Views
    T
    Youre wellcome :) Goodluck!
  • 0 Votes
    4 Posts
    3k Views
    U
    Even if you don't want to do the migration from Qwt 5 to Qwt 6 ( a lot has changed as Qwt 5 supports Qt 3+4 and Qwt 6 Qt 4+5 ) you should use Qwt 5.2 ( still maintained ! ) instead of a Qwt 5.1 version that is from the stone ages. When deciding to use Qwt 6 consider to use Qwt 6.1 ( code from SVN trunk, will be released shortly after Qt5 ). It will work with Qt5 and has many, many new features compared to 6.0. Uwe
  • [Solved] How to close threads that are blocked by system-level calls?

    3
    0 Votes
    3 Posts
    2k Views
    T
    For windows, my thread blocked at GetOverlappedResults(). I stored a HANDLE to an event I created with HANDLE myEvent = CreateEvent(NULL, FALSE, FALSE, NULL); and set the OVERLAPPED's hEvent member to myEvent. To unblock it, I signalled the event with SetEvent(myEvent). GetOverlappedResults() http://msdn.microsoft.com/en-us/library/windows/desktop/ms683209(v=vs.85).aspx CreateEvent() http://msdn.microsoft.com/en-us/library/windows/desktop/ms682396(v=vs.85).aspx SetEvent() http://msdn.microsoft.com/en-us/library/windows/desktop/ms686211(v=vs.85).aspx
  • 0 Votes
    1 Posts
    1k Views
    No one has replied