Navigation

    Qt Forum

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

    • SOLVED converting from float or double to QString results in output being 0
      General and Desktop • c++ qstring line edit conversion float • • Dean21  

      23
      0
      Votes
      23
      Posts
      114
      Views

      @JonB said in converting from float or double to QString results in output being 0: Warning: The QString content may only contain valid numerical characters which includes the plus/minus sign, the character e used in scientific notation, and the decimal point. Including the unit or additional characters leads to a conversion error. In which case RTFM is the rule of the day! but I'm lazy.
    • UNSOLVED issue getting a lineEdit to update
      General and Desktop • c++ function lineedit • • Dean21  

      18
      0
      Votes
      18
      Posts
      82
      Views

      @jsulm the data that is sent is in the form of a char array, example, char message[] = "message here"; I use QString because before I was using std::string and I was getting errors when trying to submit that to the line edit, I think conversion type errors, using a QString removed that error and thus I just stuck with it. edit: oh it is working now, I feel like we didnt change anything though and we were just going through debug statements
    • UNSOLVED how to use Qtconcurrent::run with either a member function or maybe a lamdba function
      General and Desktop • c++ thread function qtconcurrent qfuture • • Dean21  

      24
      0
      Votes
      24
      Posts
      104
      Views

      @Dean21 Please show your current code if something does not work...
    • UNSOLVED Installing MQTT module
      General and Desktop • c++ widget ubuntu mqtt • • Dean21  

      11
      0
      Votes
      11
      Posts
      118
      Views

      @Dean21 @JoeCFD asked where the mqtt libs you built are stored, not where the code is...
    • SOLVED how to add compiler option for a library
      3rd Party Software • c++ qt6 library mqtt compiler option • • Dean21  

      3
      0
      Votes
      3
      Posts
      47
      Views

      @SGaist Great Thank you this, I know that qt has its own MQTT module just I had already developed my code for MQTT using the mosquitto library before I knew I was going to be making a GUI using QT.
    • SOLVED QVariant to QList
      General and Desktop • c++ model • • mzimmers  

      13
      0
      Votes
      13
      Posts
      68
      Views

      @JoeCFD said in QVariant to QList: Understand. Thiink about you can never be number 1 anymore if you play chess. Oddly enough, that was never a concern of mine.
    • UNSOLVED How to upload files in google drive? C++
      General and Desktop • c++ api google api google google drive • • MEsc  

      4
      0
      Votes
      4
      Posts
      59
      Views

      Then the links I posted is what you should read and use.
    • SOLVED Apply a transformation to all QGraphicsItem in a QGraphicsScene
      General and Desktop • c++ qgraphicsscene qtwidgets qgraphicsitemgr qtransform • • ThThoma  

      5
      0
      Votes
      5
      Posts
      61
      Views

      At the end I've researched again the view's transformations and concluded to support both features and warn for the complexity. I did not re-implement the add/remove items of the scene together with a group. Thanks for the hint @Asperamanca .
    • UNSOLVED Show build kit at runtime
      Tools • c++ build runtime • • harveyab  

      2
      0
      Votes
      2
      Posts
      48
      Views

      @harveyab said in Show build kit at runtime: use it for conditional compilation If you want to use it for this you will need to know at compile-time, not at runtime. Assuming (I don't know but would guess) that you cannot access the particular kit selected in Creator I would expect to have to test for compile-time defines which come from the kit chosen, e.g. compiler version like _MSC_VER.
    • SOLVED [c++] opening window B by clicking a button on window A
      General and Desktop • c++ button window • • Uchi  

      8
      0
      Votes
      8
      Posts
      88
      Views

      @Uchi Correct! At the time the connect() statement is issued both the signal & slot objects must be set to the instances to be connected, that's what connect() does. Changing either of the objects later to an instance has no effect on the earlier connect().
    • SOLVED [Qt on Android] App doesn't start when i set specific defaultConfig on build.gradle file
      Mobile and Embedded • c++ android qt creator gradle api 31 • • Gianluca Bernardi  

      8
      0
      Votes
      8
      Posts
      146
      Views

      @Gianluca-Bernardi I have default as well. Not sure how you got full before. Good to know you solved the issue.
    • UNSOLVED QVector of QPair<int, QString> does not sort the elements C++
      General and Desktop • c++ qvector sort algorithms qpair • • MEsc  

      2
      0
      Votes
      2
      Posts
      68
      Views

      No sort problem but a basic c(++) problem - you pass the parameters to unzip() by value instead by reference so how should the those variables be updated outside?
    • UNSOLVED sort a vector and shuffle all similar values
      General and Desktop • c++ qvector sort vector shuffle • • MEsc  

      4
      0
      Votes
      4
      Posts
      96
      Views

      There are examples and detailed descriptions on both pages I linked.
    • UNSOLVED Complicated system design - need your help!!
      General and Desktop • c++ h file • • RuWex  

      12
      0
      Votes
      12
      Posts
      118
      Views

      Hi, As @JonB already explained you need to properly encapsulate the various aspects of your logic. One class to handle the communication with the camera. That class shall not care at all about the UI. That's not its job. It should provide feedback through signals. What is connect to it, again, not its problem. The job of your UI is to give the user the option to load a file and configure stuff. The UI will be responsible for reconfiguring whatever needs to be. As for the sequential command handling, load the file, parse it, send the first command and once your "communicator" class is done with it, make it emit a signal to signify that the task is done. In a slot connected to that signal, send the next command.
    • UNSOLVED Blackscreen when activating qtvirtualkeyboard in Desktop Mode
      General and Desktop • c++ qtwidgets qtonpi • • PaulsWidgets  

      1
      0
      Votes
      1
      Posts
      55
      Views

      No one has replied

    • UNSOLVED How to stop an animation when a new one starts c++
      General and Desktop • c++ timeline progressbar • • MEsc  

      6
      0
      Votes
      6
      Posts
      119
      Views

      @MEsc said in How to stop an animation when a new one starts c++: It should first check if QLineEdit is empty and if not then stop the animation( So change the order - I mean you're the programmer who programmed it so first checking for the QLineEdit and then doing something other shouldn't be that hard to add.
    • UNSOLVED How to detect moved columns
      General and Desktop • c++ columns proxyview • • FumbleFingers  

      8
      0
      Votes
      8
      Posts
      111
      Views

      @JonB My EDIT revision now prints the column heading I wanted. Hopefully I only need to run that header saveState function just before program exit, and restoreState just before displaying my table on the next run. If that does what I want, I won't need to directly deal with "visual indexes" at all at this stage in my ongoing "personal movie database" project. Once I can persistently re-sequence columns, I hope to add several more columns, with the less interesting ones dragged to the right of the row out of the way. I already remember user-revised column widths, so I can make those rightmost columns as narrow as possible, but I fully expect to progress to optionally hiding temporarily unwanted columns. Anyway, I'm getting older and slower, so it'll probably take me a few days just to implement "moved column memory" in my app. But eventually I want several members of a "cinema club" each having read/write access to their own database (on DropBox, GoogleDrive, whatever), and read-only access to the other members' databases (to retrieve "rating" and "date seen" values by user).
    • SOLVED I have an Error in my terminal :device not open- but usually it works...C++
      General and Desktop • c++ terminal write • • RuWex  

      16
      0
      Votes
      16
      Posts
      156
      Views

      @JonB I changed it as you said and it works well!!!
    • UNSOLVED Receive Data QserialPort
      General and Desktop • c++ qt creator qserialport readyread • • manel.sam  

      10
      0
      Votes
      10
      Posts
      141
      Views

      @JonB @mrjj It's coming back to me. I once had the same problem with an IMU sensor that I could not solve under windows. But once under linux with the same code, I receive the data perfectly. Same thing, I just tested under linux for the GPS, I receive the data but not under Windows. To this day I don't know where the problem comes from
    • UNSOLVED My QTimer isnt working...
      General and Desktop • c++ qtimer • • RuWex  

      4
      0
      Votes
      4
      Posts
      98
      Views

      @RuWex What do you think how long does "time" object exist here: void SendCommands::StartToSendCommand( QString fileName)//Ruth { Timer time(2000, fileName); ? Or "timer" here: button->show(); connect(button, &QPushButton::clicked, this, [=]() { statusBar()->showMessage(tr("Ready Start Testing"), 2000); Timer timer(num, fileName); });
    • UNSOLVED my application doesnt work:( can you help me to understand why?
      General and Desktop • c++ terminal usb command • • RuWex  

      14
      0
      Votes
      14
      Posts
      158
      Views

      @RuWex Please look at the QTimer documentation, and the examples there. This does not work by "inserting a delay" into the code where it is called. Rather, it sets off a timer which keeps running, and you supply a "slot"/"callback" which will be invoked when the timer expires. It is in that function/lambda that you do whatever work you wish to perform each time the repeating or singleshot timer expires, e.g. in your case maybe it sends the next character.
    • SOLVED c++ quetion string- int get the last character
      General and Desktop • c++ string int • • RuWex  

      2
      0
      Votes
      2
      Posts
      85
      Views

      @RuWex Iterate along the characters in the string till you find a digit; or QString::indexOf(QRegularExpression("m[0-9]")) probably does this. The last character before the digit is the index minus 1.
    • UNSOLVED When to register c++ singleton types in QML module plugins?
      QML and Qt Quick • qml c++ plugin module singleton • • Knutid  

      1
      0
      Votes
      1
      Posts
      95
      Views

      No one has replied

    • UNSOLVED Frameless widget shakes during resizing
      General and Desktop • c++ qt6 resize frameless • • bibasmall  

      2
      0
      Votes
      2
      Posts
      128
      Views

      Any idea? I found that I could use Qt::CustomizeWindowHint to remove shaking if it was possible to recolor that white bar on top — but Windows 10 doesn't have that option.
    • UNSOLVED How to create and use a QVector in other functions or is there an easier way to do this?
      General and Desktop • c++ qt creator c++ qt qvector optimization • • Turbotroop  

      6
      0
      Votes
      6
      Posts
      128
      Views

      @Turbotroop OK, so: Is the code pasted now currently what you have, exactly? What error do you currently have? Have you acted on the previous comments? For example: although it won't generate a compilation error, it does not make any sense to set up all these boxes or arrays in the main window destructor, does it? Why not in, say, the constructor instead?
    • UNSOLVED How to send command by usb (connected to terminal ) C++ QT
      Tools • c++ connect usb commands • • RuWex  

      6
      0
      Votes
      6
      Posts
      161
      Views

      @RuWex Sorry, I mean https://doc.qt.io/qt-6/qserialport.html
    • UNSOLVED error: no match for 'operator==' (operand types are 'Visitor' and 'const QString')
      General and Desktop • c++ class object • • Tasha  

      5
      0
      Votes
      5
      Posts
      294
      Views

      @Tasha said in error: no match for 'operator==' (operand types are 'Visitor' and 'const QString'): return (firstName == firstName); Do you think this line makes any sense? This line also does not make sense: if(std::find(visitorsList.begin(), visitorsList.end(), visitor->getFirstName()) You want to compare visitors, so you need a comparison function/method. You should implement this: bool operator==(const Visitor &otherVisitor);
    • SOLVED QDateTime to a file (Invalid operands to binary expression ('std::fstream' (aka 'basic_fstream<char>') and 'QDateTime')
      General and Desktop • c++ qdatetime file handling fstream • • Tasha  

      4
      0
      Votes
      4
      Posts
      86
      Views

      @Tasha said in QDateTime to a file (Invalid operands to binary expression ('std::fstream' (aka 'basic_fstream<char>') and 'QDateTime'): << + " "; Sort this bit out in your statement.
    • SOLVED Can't set fixed/minimal width for QMenuBar CornerWidget
      General and Desktop • c++ qt6 layout qmenubar layout issues • • bibasmall  

      5
      0
      Votes
      5
      Posts
      131
      Views

      @Chris-Kawa, oh, pardon my blindness, it really works. I found that the stylesheet is resetting the width of the button in my case.
    • UNSOLVED How to read number from file(casting- the numbers has readen as string)- c++ qt
      Tools • c++ file string casting int • • RuWex  

      3
      0
      Votes
      3
      Posts
      111
      Views

      @jsulm OoI, why did Qt6 QString feel the need to introduce sliced() when we have had mid() for years? EDIT Oh, mid() docs now say If you know that position and n cannot be out of bounds, use sliced() instead in new code, because it is faster.
    • UNSOLVED Why I'm not secceed to change the posiyion of the button? helpp c++ qt
      Tools • c++ layout button position • • RuWex  

      13
      0
      Votes
      13
      Posts
      191
      Views

      @JonB You have (for unknown reason) placed a button at row #5 column #6 and spanning 5 rows and 2 columns. It's not going to make much sense, is perhaps not what you intend, and will move around when you place other widgets on the grid layout. I know nothing about "In the gray square there should have been a cube. that I opened", The second shot shows about what I expect when you didn't use any layout. If the 3 lines of text there were deliberate you would need to put them into the layout now if you expect to see them.
    • UNSOLVED Qt C++ FireBase Update Unique Value
      General and Desktop • c++ qt5 database firebase • • OguzhanOzturk  

      2
      0
      Votes
      2
      Posts
      94
      Views

      Hi, Not knowing the FreeBase API it's hard to answer. Do you have a link of it ? In any case, the worst case scenario would be to fetch the whole data, change the fields you want and then send again the whole data.
    • UNSOLVED Reading Number
      General and Desktop • c++ • • aim0d  

      5
      0
      Votes
      5
      Posts
      119
      Views

      @Paul-Colby Yes, that what I was meaning. I'm gonna try thanks.
    • UNSOLVED Checkbox Dimension
      Qt Design Studio • c++ checkbox qtdesign • • aim0d  

      2
      0
      Votes
      2
      Posts
      166
      Views

      The size of the CheckBox is on controlled by the style/theme. See: https://doc.qt.io/qt-6/qtquickcontrols2-styles.html
    • UNSOLVED Add c++ model to qml
      QML and Qt Quick • qml c++ cmake • • ppitu  

      1
      0
      Votes
      1
      Posts
      163
      Views

      No one has replied

    • UNSOLVED How to create log function qt c++
      General and Desktop • c++ qt creator log code • • manel.sam  

      3
      0
      Votes
      3
      Posts
      116
      Views

      Hi @JonB , Thank's for your reply . I just solved the problem. My goal was to put them in a text file
    • SOLVED [HELP] QT6 calling android java from c++
      Language Bindings • c++ android java bindings calling method • • jhayar  

      3
      0
      Votes
      3
      Posts
      197
      Views

      okay got it working , this will mark as solved thanks
    • UNSOLVED Disconnecting From Qt VNC Server causes Segmentation Fault on Server
      Installation and Deployment • c++ qt5 tcp vnc • • lostdev  

      1
      0
      Votes
      1
      Posts
      86
      Views

      No one has replied

    • UNSOLVED QSqlDatabase: QMYSQL driver not loaded on Windows
      General and Desktop • c++ mysql mysql driver mysql 64bit • • jalway  

      4
      0
      Votes
      4
      Posts
      266
      Views

      Then please mark this topic as solved, thx.
    • UNSOLVED How to draw multiple objects using Vulkan API in Qt?
      Qt 6 • c++ vulkan render • • QtEnthusiast_Skip  

      1
      0
      Votes
      1
      Posts
      147
      Views

      No one has replied