Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • How to use custom scripts or other programs with mouse button click

    Unsolved
    3
    0 Votes
    3 Posts
    205 Views
    Pl45m4P
    @icebergenergy What should the images tell us? Is your question related to QtCreator or "programs" you are developing with QtC? Because the second picture doesn't show the Qt version you are using. It's the Qt version which was used to make the QtCreator (-GUI)...
  • QT drag n drop bug with ubuntu/Wayland

    Unsolved
    1
    0 Votes
    1 Posts
    179 Views
    No one has replied
  • Start script in QProcess?

    Solved
    14
    0 Votes
    14 Posts
    1k Views
    M
    @jsulm I'm restart computer and it's help me.
  • QStringList can replace int back?

    Unsolved
    8
    0 Votes
    8 Posts
    521 Views
    B
    @DhanyaRaghav You shouldn't use HH with AP, change it to hh. Also it will be invalid if the running program's default QLocale::amText()/QLocale::pmText() is not AM/PM. So in my above code I use QLocale::c() which is a simplified English locale to make sure that wouldn't happen. Here you can use QLocale::c().toDateTime(qstrData, "MM/dd/yyyy hh:mm:ss AP")
  • layout alignment problem

    Solved
    3
    0 Votes
    3 Posts
    256 Views
    J
    @mpergand thanks, it works
  • Qt for Microcontrollers 2.0 for console app

    Unsolved
    2
    0 Votes
    2 Posts
    200 Views
    Kent-DorfmanK
    according to the docs, it looks like it's heavily weighted to QML GUI generation. IMHO, MCU programming should remain in the domain of RTOS control systems. Frameworks will never be as lite as, bare metal programming or a lite weight RTOS like FreeRTOS. I mean...MCUs are for time critical hardware control where sometimes optimizations are at the level of counting machine code instructions and multiplying by SYSCLOCK rate. re RPI ... bad juju...it unfortunately gives managers a very unrealistic and simplistic view of what real embedded programming is and you CANNOT write a safety critical application for RPI. they are incompatible. Good luck.
  • RemoteObjects version compatibility?

    Solved
    4
    0 Votes
    4 Posts
    368 Views
    R
    @jeremy_k Thanks. I must have been looking at an earlier version of the docs because it didn't list 6.2.0. What I didn't see is the warning message. But at least I understand it now.
  • QString setnum behavior when inputted value is negative

    Unsolved
    13
    0 Votes
    13 Posts
    1k Views
    M
    @Chris-Kawa said in QString setnum behavior when inputted value is negative: What platform, toolset and Qt version are you using? Qt 5.12.10, OSX 10.14 and Kubuntu 21.04
  • Corrupted characters in std::string

    Solved
    8
    0 Votes
    8 Posts
    1k Views
    M
    @Christian-Ehrlicher You were right, I was declaring my variables locally then they were being destroyed as soon as I detached the thread. It was webdev thinking. Sorry to waste everyone's time!
  • How to combine two pieces of code?

    Unsolved
    6
    0 Votes
    6 Posts
    415 Views
    jsulmJ
    @JMad0436 Python basics. def UiComponents(self): self.scroll = QScrollBar(self) # setting geometry of the scroll bar self.scroll.setGeometry(100, 50, 200, 30) # making its background color to green self. scroll.setStyleSheet("background : rgba(0, 59, 42, 1);") # setting single step self.scroll.setSingleStep(25) # setting orientation self.scroll.setOrientation(Qt.Horizontal) # creating a label self.label = QLabel("Stress Level", self) # setting geometry to the label self.label.setGeometry(200, 100, 300, 80) # making label multi line self.label.setWordWrap(True) # getting value changed signal self.scroll.valueChanged.connect(lambda: do_action()) # method called when signal is emitted def do_action(): # setting text to the label self.label.setText("Stress Level : " + str(scroll.value()))
  • Environment Variable

    Unsolved
    21
    0 Votes
    21 Posts
    4k Views
    JonBJ
    @8Observer8 Ah yes, OK. The linker processes its files once in a single pass, left to right (there is no "going back" leftwards). Only those modules in a library which resolve currently (i.e. at the instant they are encountered) wanted symbols are pulled into the target executable. Else it would have to include everything just in case it's wanted later, and that's not how libraries work. So basically arrange them with the "lowest level" libraries to the right.
  • Errors everywhere

    Unsolved
    6
    0 Votes
    6 Posts
    458 Views
    C
    If the collection of files in the OneDrive location includes the Qt Creator generated AppLEEM_2.0.pro.user file from the other machine then it may well have Project settings that do not match your current machine. You should shut down Qt Creator, delete/rename the AppLEEM_2.0.pro.user file, restart Qt Creator and then reopen the AppLEEM_2.0.pro project file with Qt Creator.
  • Stop timer after 30 seconds

    Solved
    5
    0 Votes
    5 Posts
    602 Views
    Cobra91151C
    @JonB Hello! Yes, you are right reqarding QElapsedTimer, it could be more "accurate". Code: QElapsedTimer *timer = new QElapsedTimer; timer->start(); while (!timer->hasExpired(30000)) { qDebug() << "Elapsed: " << timer->elapsed() << " milliseconds"; } delete timer; Or usage of QDeadlineTimer which counts towards a timeout in the future instead of tracking elapsed time. QDeadlineTimer timer(30000); while (!timer.hasExpired()) { qDebug() << "Remaining time: " << timer.remainingTime(); } It also could be useful solution in this case, but running 2 QTimers and one QTimer runs only to stop another I do not think it would be a good practice.
  • Custom QWidget (Qwt) class not found when promoted

    Unsolved
    1
    0 Votes
    1 Posts
    283 Views
    No one has replied
  • QWizard persistence

    Solved
    2
    0 Votes
    2 Posts
    179 Views
    JonBJ
    @ivanicy Creating Linear Wizards: If the user presses Back, cleanupPage() is called (which in turn calls QWizardPage::cleanupPage()). The default implementation resets the page's fields to their original values (the values they had before initializePage() was called). If you want the Back button to be non-destructive and keep the values entered by the user, simply enable the IndependentPages option.
  • confusing error

    Solved
    5
    0 Votes
    5 Posts
    449 Views
    S
    @MScottM said in confusing error: The IDE has an error message: "'this' argument to member function 'byteArrayToUint32' has type 'const MainWindow', but function is not marked const". Here is another lesson to learn: The error tells us that byteArrayToUint32 is a member function of MainWindow. And the error also tells us that you are calling this function from within another function that is marked as const. For member functions everything after the argument list applies to the implicit this pointer in member functions. And even though you are not writing it explicitly you are actually calling this->byteArrayToUint32(ba). If the this pointer is const it can only call member functions that are also marked as const. So, the easy solution is to declare your function const: quint32 byteArrayToUint32(QByteArray &bytes) const; However, your conversion function actually does not need the this pointer in any way. You can either have it as a free-standing function (declared outside of your class). This might pollute your global namespace unnecessarily. Another approach is to mark it static. The latter would be the general approach I'd prefer.
  • qt examples

    Unsolved
    3
    0 Votes
    3 Posts
    259 Views
    M
    @gio6363 Did you install qt examples package? You need to tick the examples checkbox in qtinstaller/maintenance tool.
  • Returning struct from class method

    Unsolved
    3
    0 Votes
    3 Posts
    313 Views
    L
    @jsulm said in Returning struct from class method: MainWindow::final_average_s Issue fixed. Thank you very much
  • 0 Votes
    3 Posts
    554 Views
    J
    @JoeCFD Thank you for your reply.I would try delegate.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    3 Views
    No one has replied