Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.6k Posts
  • How to create printable list that correctly spans multiple pages

    2
    0 Votes
    2 Posts
    2k Views
    G
    Unfortunately there is no quick and easy way. You will have to do the calculations yourself [[Doc:QFontInfo]] and some other metrics helpers will be of use here. I once did it myself, but I cannot reveal the code here, it's a closed source app and I would have to make it "understandable" for outsiders too :) Anyways - some random hints you should pay attention for: use [[Doc:QFontInfo]] and its metrics helpers do determine the hight of a line - it can vary depending on the contents of some descriptive text and its line count use the printer device for setting up metric calculations (respect the DPI settings!) add the lines separating items (rows) and columns if needed, handle alternating background colors, reset to the correct starting color on each page calculate the height of your subtotals and grand totals parts at first and check if they will still fit onto the page before you print another row. You may have space for the row, but not the sub/grand total. It looks better if you move a regular item row to the next page, instead of having the grand total on a page alone take into account that you need some padding between subsequent columns and rows for the columns containing prices, amounts or units calculate the maximum width before you start to print and make the column wide enough to keep all values and the caption(!) (and add the padding!) keep in mind that the size of your paper sheet can differ (US sizes, DIN sizes)
  • Fadein effect in QListView adding items , how do i implement the example?

    3
    0 Votes
    3 Posts
    2k Views
    U
    i have item delegate im using as my items
  • Qt Documentation in more general format like pdf, chm, or epub.

    7
    0 Votes
    7 Posts
    12k Views
    J
    Good to see several reaponses. I thought Qt document itself is not only reference but also guide/tutorial/learning material. In other words it could be treated like book as well as ditionary. Actually there is no nice book on QML except Qt document. Thats what I meant in my original post. A few weeks ago, I saw nice troll team provide good QML introduction in several formats that i mentioned(epub, pdf ...). I downloaded it in epub format, and I can read it iBooks app while commutation between home and office. Qt document itself can be used like this way. Until nice and feasible conversion method is found, I only can have chm format of Qt document built by myself( not indexed well though ). with tha, at least i can read it on the way whenever i have time to do this.
  • Problem with QGLWidget

    3
    0 Votes
    3 Posts
    2k Views
    E
    I take it back. It's crap in debug too. Disabling the CUDA code allows the application to work normally again, so there must be some conflict between CUDA and the QGLWidget. Any thoughts?
  • Where to store moc_ and qrc_ generated files

    5
    0 Votes
    5 Posts
    2k Views
    M
    I have had further thoughts about the conclusion reached above. Qt projects on Windows generated by qmake (or QtCreator) produce two preprocessor DEFINE lists differing by one entry; the 'release' version includes QT_NO_DEBUG and the 'debug' version does not. So theoretically it is possible that the use, or not, of this directive in a header file containing a Q_OBJECT reference could result in two differing moc_xxx.cpp files. Such a case must be extremely rare but clearly must be allowed for in generally available apps like qmake and QtCreator. Maintaining two project source collections is very inconvenient and I intend to ignore the problem. As forums are a geat source of trouble shooting info I thought that submitting this new conclusion would be useful. Thank you.
  • Problem with my C++ library that uses a interface class[Solved]

    15
    0 Votes
    15 Posts
    5k Views
    G
    It's not in the Qt docs (despite some usage in examples). It's compiler dependent and documented with those, although most tool chains use -l and -L for the libs and lib paths, and -I for include paths. I don't know of any popular compiler that doesn't support this (at least additionally to some "native" switches like /xxx). It should be explained detailed in quite all decent introductions into C/C++ programming. To mark a thread as solved, just go to your very first post that opened the thread, click on the edit link right to it (just below your username and avatar) and prepend [Solved] to your topic, that's all. You might want to add a tag "solved" too.
  • QThread works on Win7 and fails on WinXP

    6
    0 Votes
    6 Posts
    4k Views
    B
    I played a little bit with the configuration and have a strange result now. It seems that VS 2010 does not like my implementation. I downloaded 4.7.4 and 4.8.0 and compiled them with Studio 2005 and 2010. Then I compiled my application with these four variants. The 2005 version works with both 4.7.4 and 4.8.0, and both 2010 versions don't work. Any idea why Studio 2010 cannot start the thread in the way Studio 2005 does?
  • Cluttered Tool Button in GNOME 3

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • [SOLVED] menu shortcuts not working

    3
    0 Votes
    3 Posts
    2k Views
    K
    thank you joonhwan. i solved it
  • 0 Votes
    3 Posts
    2k Views
    B
    Thanks for the reply. -Unfortunately I'm not sure that helps what I'm aiming. Sorry for not going into depth about the reason earlier.- I'm actually trying to get the QTextBlock. The reason is for bulleted list management. I want to determine the text blocks that are covered by the user's selection. So if they have parts of a bulleted lists selected (could be across different levels of indentation) I can increment/decrement the indentation of each selected block without affecting the non-selected portions of the list. Update Your suggestion worked for me. Using the selectionStart() and selectionEnd() methods you pointed out along with QTextDocument::findBlock(pos) I got what I needed. Thanks @ QTextCursor c = textCursor(); QTextBlock b1 = document()->findBlock(c.selectionStart()); QTextBlock b2 = document()->findBlock(c.selectionEnd()); @
  • Cannot reach signals and slots editing mode.

    6
    0 Votes
    6 Posts
    3k Views
    ?
    Well, I work as sysadmin. Right now I'm a Fedora user but I've used all major Linux distributions, and so far all of them offer the latest version of software in their repositories, including Qt. In the case of Qt there is two branches, the 3.x and the 4.x. I believe they keep the 3.x branch just for compatibility reasons, so the fact that 4.x is the new stable version it's enough for me. Not to mention obvious things like new features and improvements introduced with the 4.x branch, so as koahnig said now days doesn't make any sense starting with Qt 3. From my point of view upgrading to the 4.x branch and migrating your projects it's a step forward that you and the other users involved will appreciate, for the reasons commented above and definitely others that you will discover. So if your sysadmin does what needs to be done and isn't a lazy one, he/she should understand without creating a big issue for you.
  • [SOLVED] Modify QTableWidget's paintEvent()

    6
    0 Votes
    6 Posts
    9k Views
    D
    Aah, alright. That's brilliant. I really have to read about and learn Model/View architecture. Thank you very much Volker and Andre. I actually had a look at data() and setData() methods but after a short read, for some reason, I decided they won't help me ;-). Once again - thank you!
  • Doubt about deleting a child QObject

    2
    0 Votes
    2 Posts
    2k Views
    ZlatomirZ
    No, there is no problem in the situation you described, the child delete itself from it's parent's list of children. There is an issue if the child is allocated on stack and the parent gets deleted first: in this case parent calls delete on an address of a stack allocated object. //see "this":http://doc.qt.nokia.com/4.7-snapshot/objecttrees.html doc page
  • 0 Votes
    9 Posts
    6k Views
    G
    Sorry, I never used that stuff in my projects, I could only guess. I would advice to create a minimal test project an play around with the classes.
  • [SOLVED]QObject subclass compile error

    6
    0 Votes
    6 Posts
    3k Views
    F
    Correct, the right sequence is clean all, run qmake, build all.
  • Qlistview - review question QT 4.8 / VC2010

    8
    0 Votes
    8 Posts
    4k Views
    G
    Using threads, it's easy to run into trouble and calling a slot with the wrong thread affinity (depending on your thread implementation). Make sure to study "Threads, Events and QObjects":/wiki/Threads_Events_QObjects in the wiki.
  • 0 Votes
    17 Posts
    12k Views
    S
    I did use valgrind, but I didn't see any noticeable information to point to a specific class/function that was causing the memory leak. I'll keep fiddling with the various options to valgrind and update my Qt libs to something newer that 4.7.2
  • Qproccesdialog with external terminal command

    3
    0 Votes
    3 Posts
    1k Views
    G
    [quote author="gioullis" date="1325763280"]I have a program that call an external terminal command for calculations. Is it possible to create a qproccesdialog for the command?[/quote] If your external program is able to report progress via stdout, you can read that from the QProcess object and update the progressbar accordingly. Just make sure to set stdout on the other side to unbuffered, otherwise the progress updates come in batches.
  • Qt checksum

    2
    0 Votes
    2 Posts
    14k Views
    G
    If you look at "Appendix A":http://regregex.bbcmicro.net/crc-catalogue.htm#appendix.a of http://regregex.bbcmicro.net/crc-catalogue.htm you can see a map of checksums using various parameters for the CRC algorithms. 0x31C3 is the result of using an initial value of 0x0000, a final XOR with 0x0000, a polynom of 0x1021 and not using reflection - aka XMODEM 0x906E, the Qt result, is for using an initial value of 0xFFFF, a final XOR with 0xFFFF, polynom 0x1021 and using reflection - aka X.25 So, it's extremely important to use the very same parameters to calculate the checksum.
  • Radiobutton near qtabbar

    8
    0 Votes
    8 Posts
    3k Views
    K
    i found another way:d setmargin to zero and set maximum height a bit lower