Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.7k Topics 458.0k Posts
  • Problem with moc_* file

    3
    0 Votes
    3 Posts
    4k Views
    S
    I never have a problem with VS2008 when using the Qt addon. The addon is great, does the pre-build step for you and also adds the moc file to the project. It's worth checking out.
  • Q_INVOKABLE vs. slots

    5
    1 Votes
    5 Posts
    26k Views
    S
    You might want create separate thread for this...
  • Background Database Tasks

    2
    0 Votes
    2 Posts
    2k Views
    D
    AFAIR sqlite blocks db for data changing operations. As for general answer (not only for sqlite or database, but for any threaded operations) you can use mutexes or queue with operations and execute them one a time.
  • QVariant for int/double members that could be "Null" ?

    3
    0 Votes
    3 Posts
    5k Views
    J
    Thanks Denis. I gave it some more thought and decided to go the QVariant way.
  • [solved] Problem with creating a static variable in my class

    8
    0 Votes
    8 Posts
    31k Views
    T
    Oh, I missed that part. Your posting would be more readable if it used the code tags!
  • QWidget unwanted paintEvent

    7
    0 Votes
    7 Posts
    10k Views
    L
    I finally found this: @ Qt::WA_OpaquePaintEvent Indicates that the widget paints all its pixels when it receives a paint event. Thus, it is not required for operations like updating, resizing, scrolling and focus changes to erase the widget before generating paint events. The use of WA_OpaquePaintEvent provides a small optimization by helping to reduce flicker on systems that do not support double buffering and avoiding computational cycles necessary to erase the background prior to painting. Note: Unlike WA_NoSystemBackground, WA_OpaquePaintEvent makes an effort to avoid transparent window backgrounds. This flag is set or cleared by the widget's author. @ So I put: setAttribute(Qt::WA_OpaquePaintEvent); in MyWidget constructor to avoid erasing the widget before paintEvent and in paintEvent I put: @ void MyWidget::paintEvent(QPaintEvent *event) { if(update_required) { QPainter p(this); p.drawImage(0,0,image); } } @ This way I can avoid the unwanted drawImage.
  • Can I import a COM .dll object in Qt?

    8
    0 Votes
    8 Posts
    5k Views
    T
    Jom, is yet another make variant. It reads Makefiles and executes the stuff in there -- just like nmake, too. It is in no way mingw specific (only if the Makefiles are;-). Jom supports -j X to run (up to) X jobs in parallel, which is great for multicore systems. nmake does not seem able to do this. PS: I am using jom with msvc, so I am sure it does work. Maybe you need to rerun qmake to regenerate the makefiles for MSVC?
  • Mingw build using dwarf2 exceptions?!!!

    2
    0 Votes
    2 Posts
    4k Views
    F
    Qt has no direct influence on that. The choice of throwing dwarf exceptions is made at MinGW: From their "release notes":http://sourceforge.net/project/shownotes.php?release_id=691876 [quote] 4. NEW FEATURES SINCE MINGW GCC 3.4 Windows-specific:-- [...] Zero cost exceptions: New exception model Dwarf only has performance penalty when being thrown. The old model, SJLJ, is no longer available. [/quote]
  • Why QThread cannot speedup my program on Intel core 2 duo Q6700

    12
    0 Votes
    12 Posts
    7k Views
    P
    [quote author="Denis Kormalev" date="1282326556"][quote author="ixSci" date="1282324950"]There are can be really many causes for this behaviour. It should be investigated by yourself which one you have encountered. It can be bind with the cache related issues(missing, races etc.) and it can be just an overhead of using thread. The best answer you can get from the thorough profiling of your code. [/quote] More strange that it works ok for author at another multicore processors. So source architecture problems and possible race conditions are hardly the reason. [/quote] As long as increasing number of threads to 64, it will speedup 1.98x on dual core cpu or 3.79x on quad core cpu stably.
  • Problem with custom signals in threads

    3
    0 Votes
    3 Posts
    3k Views
    ?
    this "faq":http://developer.qt.nokia.com/faq/answer/why_is_it_only_possible_to_draw_in_the_gui_thread_and_how_can_this_be_worke might answer your second question
  • Linux application not working on Windows

    12
    0 Votes
    12 Posts
    6k Views
    S
    When I call QFileInfo::isReadable about a file, it works fine. Maybe it is not valid for a directory? If that is the case, is there another way to find out if a directory is writable? Why is there no QDir::isWritable function?
  • [Merged] Problems with QScript

    2
    0 Votes
    2 Posts
    2k Views
    I
    If I try to check the presence of the property myPrint from the C++ side with @per_ctr.property("prototype").property("myPrint").call();@ the function is called (even if it clearly crashes because it's not called on a valid object). But this means that at least in the c++ side of the application the myPrint function exists in the Person's prototype. I cannot say the same thing in the JavaScript side when i get an Interpreter Error: line 2: TypeError: Result of expression 'v.myPrint' [undefined] is not a function.
  • Signals & Slots problems

    3
    0 Votes
    3 Posts
    2k Views
    E
    two things I jsut want to remind u . Make sure you write Q_OBJECT macro in you header file and declare your slot in the slot section of the header : @ class myForm .. { Q_OBJECT private slots: void butonclick(); }@ but when subclassing from a ui file , the last method of the abov reply is more conveniant as it auto-connect directly
  • Windows 7 64-bit Platform: Qt ONLY debugs my app in assembler

    5
    0 Votes
    5 Posts
    5k Views
    F
    but if you want to build it yourself you should know that there is a bug in VS2010 compiler as you can see "here":http://developer.qt.nokia.com/forums/viewthread/319/ which causes release builts to crash.
  • LGPL Licence and Submitting Changes

    2
    0 Votes
    2 Posts
    2k Views
    V
    Hi, 1.As per LGPL you need to provide the sourcecode of the library (i.e your modified QT) to the users who recieves your application. 2.If you think the changes that you made are relevant to QT upstream version, you can contribute the changes to QT. Refer http://developer.qt.nokia.com/contribute for details.
  • 0 Votes
    1 Posts
    3k Views
    No one has replied
  • Real read-only file Windows

    3
    0 Votes
    3 Posts
    3k Views
    G
    Thanks for the answer, I thought it was not possible, and thanks for the alternatives
  • Problem with resource files in VS2005

    1
    0 Votes
    1 Posts
    3k Views
    No one has replied
  • Signals and Slots for drag and drop behavior

    9
    0 Votes
    9 Posts
    9k Views
    D
    [quote author="Franzk" date="1282280552"] What overhead exactly? [/quote] Code development overhead, maintainability, etc. [quote] The Model/View framework is used whether you are directly working with it or not. [/quote] I'm aware that the QListWidget utilizes the QListView framework. [quote]This means that from a code perspective you are introducing more overhead right now than you would have when you wrote your own model. [/quote] If you are accounting for code overhead from generated code, yes. However, I'm handing off the code to a customer, and I would like to keep it simple [quote] You could have written one model (three models that have the same behavior? Derived from QAbstractListModel) that does exactly what you want in very nearly half a day, while you've been going at this through this forum for about two days now without any results so far. [/quote] I haven't been sitting on my thumb waiting for the fairy-code-mother to answer my question. I found a work around. This thread is more about wishful thinking. In retrospect, I probably should have put it under a bug report wishlist. [quote] I may not be an expert on your system, but I have done a great lot of 'simple' things with model/view over the last year and everything turned out to be simpler and easier writing a model than when using the widget equivalent.[/quote] I really don't mean any disrespect. I know the model/view framework is powerful and not that difficult. I've used it myself before. Granted, I need more practice, but it seemed like there should have been a simpler solution for the functionality I was seeking.
  • Center align the icon in QAbstractItemView using stylesheets

    3
    0 Votes
    3 Posts
    6k Views
    S
    I tried using it in the following ways but these did not work as well. QAbstractItemView::item { subcontrol-position: center center; } And QAbstractItemView::item::icon { subcontrol-position: center center; }