Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. qt4
    Log in to post

    • UNSOLVED Does someone know where to download an old QtSdk for version 4.7.4 bundled with a MigGW complier that works with it?
      Installation and Deployment • qt4 compile compatibility old • • Curtwagner1984  

      5
      0
      Votes
      5
      Posts
      128
      Views

      Sadly, No luck. I'm getting: 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?
    • UNSOLVED how to draw a star ??
      General and Desktop • qt5 qt4 geometry 2d graphics • • timob256  

      1
      0
      Votes
      1
      Posts
      191
      Views

      No one has replied

    • UNSOLVED how to create a 2D speedometer. (is there any qt example) ??
      General and Desktop • qt5 qpainter qt4 2d graphics • • timob256  

      2
      0
      Votes
      2
      Posts
      168
      Views

      Simply two QPainter::drawArc() calls with a different color.
    • UNSOLVED Table Widget selected item doesnt take the first one
      General and Desktop • qt4 table widget • • deleted286  

      2
      0
      Votes
      2
      Posts
      167
      Views

      @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();
    • UNSOLVED Using QTquick 1 to trigger a bash script on button click
      QML and Qt Quick • qprocess qt4 process qtquick1.1 • • jcthomas556  

      5
      0
      Votes
      5
      Posts
      349
      Views

      @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.
    • UNSOLVED Qt4 and Qt5 compatibility issue with QDatastream and QDateTime
      General and Desktop • qt5 qt4 qstring qdatastream qdatetime • • johnyang  

      2
      0
      Votes
      2
      Posts
      222
      Views

      Now I realized I have to set QDataStream::setVersion to QDataStream::Qt_4_7. I think the problem is solved.
    • UNSOLVED Problem with plotting multiple plots in the same MatplotlibWidget graph
      General and Desktop • qt4 graph matplotlib • • NilleDaWize  

      5
      0
      Votes
      5
      Posts
      912
      Views

      Ahh I see. I'll check it out! Thanks for the suggestion. If you have any other ideas please let me know.
    • UNSOLVED QWebView - On Click CPU Performance
      Mobile and Embedded • qt4 webkit performance embedded qt cpu • • kumararajas  

      20
      0
      Votes
      20
      Posts
      1579
      Views

      @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
    • UNSOLVED QTextStream not working while running simple console output application Ask Question up vote
      General and Desktop • qt4 qtextstream console app stdout • • Johnx8664  

      3
      0
      Votes
      3
      Posts
      943
      Views

      @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.
    • SOLVED Add textEdits on listWidget
      General and Desktop • qt5.5 qt 5.7 qt4 listwidget • • Kinesis  

      15
      0
      Votes
      15
      Posts
      4903
      Views

      @Devopia53 it works! , Thanks alot
    • SOLVED Problems with providing arguments to QProcess
      General and Desktop • qprocess desktop qt4 qstringlist • • Thanos  

      6
      0
      Votes
      6
      Posts
      5523
      Views

      @Thanos thanks for your feedback. So please mark this topic as SOLVED now.
    • SOLVED How we can read particular string/data from any device to print on particular LCD in qt?
      Mobile and Embedded • qtcreator qt5.5 qt4 qtwidgets read serial • • Mohit Tripathi  

      25
      0
      Votes
      25
      Posts
      6494
      Views

      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.
    • UNSOLVED QT, repaint line that doesn't have boundingRect()
      General and Desktop • qgraphicsscene qt4 boundingrect shape python2 • • helloworld12345  

      2
      0
      Votes
      2
      Posts
      705
      Views

      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.
    • UNSOLVED error lnk2038: mismatch detected for '_msc_ver'
      General and Desktop • visual studio qt4 visual c++ visual studio 2 • • srikanth  

      2
      0
      Votes
      2
      Posts
      2918
      Views

      @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
    • SOLVED 'evaluateJavaScript()' doesn't return any value. (content position on page wanted)
      General and Desktop • javascript qt4 webkit javascript qweb • • ShivaHaze  

      24
      0
      Votes
      24
      Posts
      9685
      Views

      @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.
    • SOLVED default background color of QTabWidget and QWidget/QGroupBox
      General and Desktop • qwidget layout qt4 qtabwidget groupbox • • helloworld12345  

      4
      0
      Votes
      4
      Posts
      7639
      Views

      @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.
    • UNSOLVED clockwise/counter-clockwise drawing would influence the fill rule in shape()?
      General and Desktop • qt4 qpainterpath polygon fill windingfill • • helloworld12345  

      1
      0
      Votes
      1
      Posts
      567
      Views

      No one has replied

    • UNSOLVED Qt, differences between event.pos(), event.scenePos(), self.scenePos()
      General and Desktop • qt4 scene mouse event boundingrect python2 • • helloworld12345  

      2
      0
      Votes
      2
      Posts
      1810
      Views

      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.
    • UNSOLVED How can I draw a shape area around a polyline? So I can move polyline with mouse.
      General and Desktop • qt4 boundingrect shape polygon polyline • • helloworld12345  

      11
      0
      Votes
      11
      Posts
      3707
      Views

      @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.
    • UNSOLVED how to run two threads simultaneously without waiting for another thread in qt
      Mobile and Embedded • qtcreator qt4 threads multithreading • • AnnieAlbert  

      12
      0
      Votes
      12
      Posts
      7427
      Views

      You're welcome ! Since you have it working now, please mark that thread as solved using the "Topic Tools" button so that other forum users may know a solution has been found :)
    • SOLVED Two Message Boxes in a Row Positions Second One in an Odd Place
      General and Desktop • c++ qt4 qmessagebox • • DougyDrumz  

      5
      0
      Votes
      5
      Posts
      1494
      Views

      @joeQ As it turns out, I just tried the opposite. I had one newed Message Box for everything. In the place that had the funny location, I made a separate newed Message Box and it ended up in the correct place - the middle of its parent.
    • UNSOLVED Can't Interact with Main GUI while Brining up Dialog
      General and Desktop • qt4 qdialog • • DougyDrumz  

      4
      0
      Votes
      4
      Posts
      1022
      Views

      @DougyDrumz Open the dialog without this information. Then in a separate thread (so you don't lock things up) get the info you need and populate the dialog once the info is available. The way I would do that is just show a loading widget of some sort while it loads the info, then once loaded, show the real widgets on the dialog. You can use QStackedWidget to make this easy. Another way is don't use dialogs. Modern applications rarely use them any more, except for things like File->Open.
    • UNSOLVED Can't Cancel Progress Dialog.
      General and Desktop • c++ qt4 signal progress bar cancel • • DougyDrumz  

      12
      0
      Votes
      12
      Posts
      4409
      Views

      @DougyDrumz said in Can't Cancel Progress Dialog.: OK. I found it. I was being dumb! I have two flavors of Progress Dialogs. One is inside an App, and the other is standalone, meant to be called form a script. I was looking at the one in the App when I should have been looking at the other one. The standalone one doesn't have have a cancel slot. Good !
    • UNSOLVED Software Developer (f/m) Ergonomics and Physics Application
      Jobs • c++ qt4 • • Julia Runge  

      1
      0
      Votes
      1
      Posts
      1007
      Views

      No one has replied

    • SOLVED QGraphicsItem gets selected when clicking outside of visible shape
      General and Desktop • qgraphicsview qgraphicsscene qgraphicsitem qt4 zoom • • Vaniax  

      9
      0
      Votes
      9
      Posts
      5242
      Views

      :D I haven't had much time to test if the bug exists in Qt5. I'll check it out and update the topic accordingly. If the bug is still there, of course, I will submit the fix. Thanks for your time.
    • UNSOLVED How to trigger QMenu on right click.
      General and Desktop • qt4 qmenu qaction • • tokafr  

      3
      0
      Votes
      3
      Posts
      2916
      Views

      Hi Just as a note. No (dropdown) menus I have ever used can be triggered by right clicking. ( some offer properties this way) so can I ask why you need that?
    • SOLVED Best way to create new window (QWidget) and interactions between QWidgets
      General and Desktop • qwidget desktop qt4 slot connect slot • • vitorfhcosta  

      4
      0
      Votes
      4
      Posts
      5734
      Views

      difference between exec() and show(), Only QDialog have exec() Qwidgets have show. When you call show on a Dialog, it becomes visible but do not wait for input. example mainw::func() { MyDialog *dia=new MyDialog(this); dia->show(); int a=0; // this code is run the moment dialog is shown on screen, } using exec() mainw::func() { MyDialog dia; dia.exec(); int a=0; // this code is run only after dialog is dismissed. } The version of dialog where u call show() could be called floating so when user click ok it should emit signal that something should happen. ( to maiwindow ) The exec() version will report back the result ok/cancel/closed at once. learn when to use QObject, QWidget, QFrame QWidget is often used if making own widget. QFrame is used if you just need something to draw a frame. If you use Designer you can check out the Widgets that are available. QDialog is useful for any type of windows that pop ups up or open via a menu. I have to set anything inside Register. Yes, Register should be able to give the data back. the widgets inside are private so you need a function to return the data. You might also need to call http://doc.qt.io/qt-5/qdialog.html#accept in your Register buttons clicked slot.
    • UNSOLVED QGraphicsItem draw perpendicular line as wide as pen
      General and Desktop • qgraphicsitem qt4 qline qpen • • 6b656d70  

      1
      0
      Votes
      1
      Posts
      904
      Views

      No one has replied

    • UNSOLVED Error compiling QT4 with VS2015
      General and Desktop • qt4 nmake vs2015 javascriptcore • • EarthHobbit  

      2
      0
      Votes
      2
      Posts
      3443
      Views

      Why Qt 4.8.6 and not the latest Qt 4.8.7 ? I've compiled Qt 4.8.7 with VS2010, VS2013 and VS2015, in 32 and 64 bits, here's my steps: https://github.com/sandym/qt-patches/tree/master/windows/qt-4.8.7
    • UNSOLVED how to read hex value data from text file and store into array?
      Mobile and Embedded • qt4 • • sachin786  

      19
      0
      Votes
      19
      Posts
      13055
      Views

      @sachin786 it print garbage for hex[ ]...... What do you expect to be printed exactly? The data is binary so any of the elements that can't be displayed will be printed as gibberish ... 0x01, 0x00 are non-printable characters, so you'd see (depending on the platform) squares or other strange symbols, this doesn't necessarily mean the data is corrupted, only that it's interpreted in a erroneous way.
    • SOLVED Change Behavior of Double Click for QFileDialog
      General and Desktop • c++ qt4 qfiledialog qevent doubleclick • • DougyDrumz  

      2
      0
      Votes
      2
      Posts
      1339
      Views

      I figured it out. You can't call the connect statement for the doubleClick signal until the QListView is in scope.
    • SOLVED QTimer Pointer Out of Scope?
      General and Desktop • qt4 qtimer qprogressdialog • • DougyDrumz  

      4
      0
      Votes
      4
      Posts
      1451
      Views

      @DougyDrumz Easy peasy ... no one seems to want to answer my questions though. ;) Happy coding!
    • SOLVED Menu Icons Disappear with gnome Desktop Session
      General and Desktop • qt4 qmenu menubar redhat 6 gnome • • DougyDrumz  

      2
      0
      Votes
      2
      Posts
      955
      Views

      Hi, IIRC, that's part of the GNOME Human Interface Guidelines so there's no much you can do from a Qt point of view.
    • UNSOLVED Converting Enums to Strings for QPrinter
      General and Desktop • qt4 qprinter qmetaobject enum • • DougyDrumz  

      13
      0
      Votes
      13
      Posts
      4742
      Views

      Let me tone down this discussion by saying that the original reason for my question has disappeared. I misunderstood how QPrinter worked. I thought I would need the string versions of the QPrintDialog enums to pass on to lp. Turns out QPrinter does what I need to do automatically and I don't need to call lp. Thanks for the lively discussion though.
    • SOLVED Standard Output Double Spaced in QTextEdit
      General and Desktop • qprocess qt4 qtextedit • • DougyDrumz  

      9
      0
      Votes
      9
      Posts
      2346
      Views

      Good ! Since you have it working now please mark the thread as solved using the "Topic Tool" button so that other forum users may know a solution has been found :)
    • Cannot open QtCreator.
      Mobile and Embedded • qt4 raspberry pi 2 pi 2 qtcreator open • • azravian  

      2
      0
      Votes
      2
      Posts
      1055
      Views

      Hi and welcome to devnet, Did you double check the that sudo apt-get install qtcreator ran successfully ?
    • UNSOLVED CmakeLists error while compiling for Qt5.
      General and Desktop • cmake qt4 qt 5.4.2 • • MarKS  

      2
      0
      Votes
      2
      Posts
      3270
      Views

      Hi, You have to port the CMakeLists.txt for Qt 5. You have the CMake Manual in Qt's documentation to help you get started.
    • UNSOLVED QtTableWidgetItem Icon Text
      General and Desktop • qtablewidget qt4 qicon qtablewidgetite • • DougyDrumz  

      2
      0
      Votes
      2
      Posts
      1069
      Views

      Hi, You can try implementing a QStyledDelegateItem and paint only the icon. Hope it helps