Skip to content
  • 0 Votes
    5 Posts
    395 Views
    C

    Sadly, No luck. I'm getting: qtcreator_ByKFQogjC7.png

    Maybe there are other factors that I didn't consider. Though it's better than how it was before, because before it didn't even show this message. It just crushed.

    EDIT: When I copied the complier and Qt version from the computer where it works, It successfully complied and runs. So the issue defiantly stems from incorrect versions of either the complier or qt. But the Qt version is 4.7.4 which is what I currently have, so I guess the problem is the complier.

    Is it possible to know what complier version I'm using just from the exe?

  • 0 Votes
    1 Posts
    483 Views
    No one has replied
  • 0 Votes
    2 Posts
    463 Views
    Christian EhrlicherC

    Simply two QPainter::drawArc() calls with a different color.

  • 0 Votes
    2 Posts
    308 Views
    JonBJ

    @suslucoder said in Table Widget selected item doesnt take the first one:

    But it doesnt take the first one that i select

    Yes, this code will visit all selected items, including whatever "first one" which you say it does not include. Else everybody would be complaining about it.

    Why don't you print out:

    qDebug() << ui->tableWidget->selectedItems().length();
  • 0 Votes
    5 Posts
    596 Views
    J

    @JonB This is a quote from the example given on the link listed. It's from QT, in an explanation of how this works. It's not a string that I came up with, or that I'm using.

  • 0 Votes
    2 Posts
    415 Views
    J

    Now I realized I have to set QDataStream::setVersion to QDataStream::Qt_4_7. I think the problem is solved.

  • 0 Votes
    5 Posts
    1k Views
    N

    Ahh I see. I'll check it out!

    Thanks for the suggestion. If you have any other ideas please let me know.

  • 0 Votes
    20 Posts
    3k Views
    K

    @kumararajas said in QWebView - On Click CPU Performance:

    Thank you @Konstantin-Tokarev This explanation means a lot. This helps us to understand that we are using older version of Qt WebKit and which is not really efficient.
    At this moment of time, we don't have a plan to update to the latest version. We will have to find a work around in the application to manage the situation.

    Does it mean that you cannot change any bits of software in your system and you are limited to workarounds on the side of web page? If so, it's really sad situation.

    If you are able to change software, you are strongly adviced to use QtWebKit 2.3.4, or at least give it a try.

    @kumararajas said in QWebView - On Click CPU Performance:

    @Konstantin-Tokarev Yes, we have been trying to understand who consumes the lot of CPU and why. When I did profiling using gprof/perf tools, I can find out that which function in my application consumes a lot, but that does not root in to the framework, which is webkit. Do you recommend any method which I can profile the framework side as well?

    Don't use gprof. This tool claims to measure time spent in functions, but in fact measures totally different thing. And, as you've already discovered, it can only profile code which was rebuilt with -pg flag.

    As for perf, it is decent tool. On older systems oprofile can be used. Make sure that your QtWebKit library is not stripped

    And even if we find issues in the framework, at this moment we are not in a position to upgrade the system. So we will identify the work around and live with it ( Already found couple of work around solution, which I will be sharing it in a while here )

    I have no idea what do you mean here, and I don't really want to be in your shoes. (/me once had to reverse engineer and then binary patch 3rd party kernel driver with no source code, but at least there were no problems with updating target system)

    Reason for asking such question is,
    Someone might have faced similar problem and might have the ready solution. Instead of I spending lot of time in exploring, researching, debugging, etc, I could post it here to know if someone knows about it. However, in parallel to posting this question, I have been doing things in parallel if in case I don't get the answer. For this post, you being a legend on webkit, you have mentioned that it could be a problem of webkit version that we use, which makes sense and unveils the root cause.

    I'm far from being legend, and there may be other reasons of high CPU consumptions, maybe several factors at once. It can be that WebKit just doesn't have enough memory to process page, and system is thrashing (you'll see high sys usage in top then).

    When I touch the report, does Qt Web Kit renders the whole web page again?

    If you are not using QWebSettings::TiledBackingStoreEnabled and are not using accelerated composting on QGLWidget viewport, and are not using QWebPage::setPreferredContentsSize, then QtWebKit definitely reners whole page again after scroll. It doesn't redraw old pixel, but it performs whole rendering procedure with QPainter being clipped to update region. It may easily be a bottleneck if page is complex

  • 0 Votes
    3 Posts
    1k Views
    A

    @Johnx8664 Learning Qt4 at this point would be a waste of your time. Like @SGaist said it's long past it's end of life. Qt5 is 12 major releases into it's life cycle now and 5 years old now.

    I would grab a book on Qt5, or I find it's pretty easy to learn Qt just from the docs that come with it. If you know C++ well (and you should if you are tackling Qt), then you should be fine learning from the Qt Assistant docs. There are a lot of examples and tutorials in there as well.

  • 0 Votes
    15 Posts
    6k Views
    K

    @Devopia53
    it works! , Thanks alot

  • 0 Votes
    10 Posts
    7k Views
    SGaistS

    Hi,

    There is a simpler method: setStandardOutputProcess.

    Use one QProcess for each element of your pipe. That way you recreate your chain in code and no dependency on shell handling.

  • 0 Votes
    25 Posts
    9k Views
    SGaistS

    Don't @ the moderators unless you have an issue requiring moderation.

    Depending on the content of your line edit, you can use toLatin1() or toUtf8() rather than making these two conversions.

  • 0 Votes
    2 Posts
    859 Views
    mrjjM

    Hi
    I just keep a pointer to the "white lines" and adjust if i move yellow.

    class ColorItem : public QGraphicsItem { .. ConnectorLine* line = nullptr; .. protected: QVariant itemChange(GraphicsItemChange change, const QVariant& value) override { if (change == ItemPositionChange && scene()) { if (line) { line->adjust(); } } return QGraphicsItem::itemChange(change, value); } private: QColor color; };

    line->Adjust() alters its endpoints. You could just adjust it directly here.

  • 0 Votes
    2 Posts
    4k Views
    JonBJ

    @srikanth
    https://stackoverflow.com/questions/19575747/error-lnk2038-mismatch-detected-for-msc-ver-value-1600-doesnt-match-valu

    and others like https://stackoverflow.com/questions/14692019/linking-error-because-of-different-versions-msvc-and-qt-libraries

  • 0 Votes
    24 Posts
    12k Views
    JonBJ

    @ShivaHaze
    @ShivaHaze said in 'evaluateJavaScript()' doesn't return any value. (content position on page wanted):

    You are a god to me - Thanks so much!

    I think you might have meant "good" rather than "god" ;-)

    I am very pleased this approach has worked for you. It is potentially useful for me to know for my own work one day. Had I realized you had not tried the "delay" principle earlier, we would have got there quicker.

    The actual implementation of the delay loop is "naughty". It will mean that your application is "running busily" (i.e. using CPU time, potentially blocking other applications) for most of 1 second. If an expert here looks at it, please don't shout at me! Like I said, I got it from elsewhere as "quick & dirty". For your purposes it's probably fine, and we achieved it without you having to do slots & signals which you were not keen on learning at this stage.

    If you feel like you want to improve/experiment, in the same stackoverflow thread have a look at https://stackoverflow.com/a/3756341/489865, leveraging QWaitCondition, whose description sounds like it should have the same effect without the "busy blocking":

    class SleepSimulator{ QMutex localMutex; QWaitCondition sleepSimulator; public: SleepSimulator::SleepSimulator() { localMutex.lock(); } void sleep(unsigned long sleepMS) { sleepSimulator.wait(&localMutex, sleepMS); } void CancelSleep() { sleepSimulator.wakeAll(); } };

    Certainly I would try it. If you copied that class into your code, you would call it (I assume) via:

    SleepSimulator* sleep = new SleepSimulator(); sleep->sleep(1000); delete sleep;

    Now I think you can get down to the real coding you want to do for your application! Best of luck.

  • 0 Votes
    4 Posts
    9k Views
    H

    @raven-worx

    Great, it works.

    Actually I did try setting QTabWidget setAutoFillBackground(True) previously, but it didn't work.
    Now I tried set VGroupBox setAutoFillBackground(True), then the color changed to light grey which is the exact default color I need.

    Thanks so much, raven-worx.

  • 0 Votes
    1 Posts
    676 Views
    No one has replied
  • 0 Votes
    2 Posts
    3k Views
    Chris KawaC

    It would be nice to say what self and event are. I'm guessing a QGraphicsItem and a parameter of QGraphicsSceneMouseEvent? Is that right?

    If so then event.pos() and event.scenePos() are not exchangeable. The first one is cursor position in item's coordinates and the second one cursor position in scene coordinates. They are the same only when item is placed at (0,0). If item is moved they will differ. It's important to note that these values are what they were at the time the event took place, which might be different from the "current" values for item (this is a good thing). For example if you move your mouse fast and there are a lot of events generated the cursor position in these events will be a little behind the actual current position of the cursor before they "catch up".

    As for self.scenePos() - this is the position of the item in the scene. This is the point relative to which the event.pos() is calculated. It is not necessary the top left of the bounding rect. It can be placed anywhere using 'setTransformOriginPoint()'. It is often set to the center of the item. For example if you have a bunch of draggable circles a center is probably more convenient than a top left corner. For vertical bars on a chart the origin might be placed at the middle bottom of a bar etc.

  • 0 Votes
    11 Posts
    4k Views
    H

    @Asperamanca

    No, I didn't set these two flags ItemClipsToShape, ItemClipsChildrenToShape.

    Then I tried setting only one flag ItemClipsToShape, and both of ItemClipsToShape, ItemClipsChildrenToShape. For each, it still check if the point is in the boundingrect() firstly, and then check the shape() which means if point is not in boundingrect(), it wouldn't bother to check shape().

    So now my solution is still enlarging the boundingrect() area.