Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • Dynamically create multiple layouts

    Unsolved
    20
    0 Votes
    20 Posts
    2k Views
    S
    @JonB @mpergand @jonezzpeterr @SGaist Thanks very much for the support, I think i have achieve quite a lot of those giving tough time. As @SGaist said I am using QVector and as @JonB said i declare it as a class member variable QVector<LayoutWidgets> layoutArray; Because the size will be set at run time base on user input, i resize the vector in a function layoutArray.resize(LayoutCount); and i am able to make calls to my class setters to set the values in layoutArray and use another getter function to access the set values
  • Getting MouseEvent for a QDoubleSpinBox

    Unsolved
    3
    0 Votes
    3 Posts
    260 Views
    E
    @JonB i tried findchild, and worked, thanks mate!!
  • 0 Votes
    9 Posts
    2k Views
    Christian EhrlicherC
    @Chris-Kawa said in Weird connection between QComboBox, QBasicTimer and static object initialization.: In general singleton pattern doesn't go too well with QObjects. ... and is not needed in most cases - this one here is one of the most cases where a singleton is not needed
  • DatetimeEdit Section Animation/Styling

    Unsolved
    2
    0 Votes
    2 Posts
    196 Views
    D
    @didem I've found a case as follows; aplying "QPropertyAnimation" for QRect. https://stackoverflow.com/questions/43428627/applying-qpropertyanimation-to-qrect In my case, I need to apply QPropertyAnimation for "QDateTimeEdit::Section" which is an enum ( https://doc.qt.io/qt-6/qdatetimeedit.html ). The goal is to blink/animate focused part (day) of the QDateTimeEdit widget Alternatively, I've tried to catch focused part ( day, month or year ) while editing datetime; this->setStyleSheet("QDateTimeEdit:focus { selection-background-color: red; selection-color: white; }") For the way stated above, I need to set the stylesheet for different colors for every seconds. But, I could not find the way of transition between the start and end value like in the animation ; QPushButton *button = new QPushButton(tr("Animated Button"), this); QPropertyAnimation *anim = new QPropertyAnimation(button, "opacity", this); anim->setDuration(1000); anim->setStartValue(1); anim->setEndValue(0) anim->start(); Could you please help me for both alternative ways of solution ?
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    7 Views
    No one has replied
  • Q_OBJECT macro not working

    Unsolved qobject vscode cmake
    4
    0 Votes
    4 Posts
    802 Views
    J.HilkJ
    @ugo_ I'm failing to see CMAKE_AUTOMOC in your cmake file, did you forget to enable moc for your project? Nope, I'm just blind :D
  • Error building Qt creator 9.0.1

    Unsolved
    3
    0 Votes
    3 Posts
    268 Views
    K
    @SGaist Can you please be more specific? I downloaded the source code from https://account.qt.io/s/downloads and not from git.
  • How to create rubber band line?

    Unsolved
    5
    0 Votes
    5 Posts
    400 Views
    J
    @jsulm Yes, that's why I tried to create a LineRubberBand class inheriting QRubberBand, which allows me to draw a line instead of the default rect, and it allows dynamical update ( it can draw and erase within mouseMoveEvent, but painter.drawLine() cannot do). Now the line thing created by me and the dynamical update from QRubberBand are combined well, but there are still some problems mentioned above remaind unsolved.
  • Downolad Qt 4.x

    Unsolved
    6
    0 Votes
    6 Posts
    518 Views
    M
    @jsulm Hi, I decided to go back to Ubuntu 20.04 to avoid such problems Miłosz
  • Expandable Text View

    Unsolved
    4
    0 Votes
    4 Posts
    395 Views
    jsulmJ
    @azhagans2 Either add these widgets dynamically when the button is pressed. Or use a https://doc.qt.io/qt-6/qstackedwidget.html to show these widgets when the button is pressed.
  • Cross-Compiling Qt 5.15.8 For Raspberry Pi 64bit Using Docker

    Unsolved
    1
    0 Votes
    1 Posts
    746 Views
    No one has replied
  • 0 Votes
    3 Posts
    259 Views
    Y
    @JoeCFD need to find a old school method, professor doesnt like going new school
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    3 Views
    No one has replied
  • Crypto plugins and windeployqt

    Unsolved
    2
    0 Votes
    2 Posts
    206 Views
    SGaistS
    Hi and welcome to devnet, What was the original question ?
  • Building Qt plugin (TreeView) fails

    Solved
    2
    0 Votes
    2 Posts
    232 Views
    C
    I managed to fix it. Some days ago I replaced my linker (ld) with lld, I restored my old one and now it is working again
  • QT 6.3.1

    Unsolved
    7
    0 Votes
    7 Posts
    546 Views
    SGaistS
    @ukhooder hi and welcome to devnet, Depending on your distribution, it might already provide Qt 6 and the corresponding development packages. Otherwise, you should use the online installer, it will provide with pre-built version of Qt ready to use.
  • unchanged positions of controls in main window

    Unsolved
    11
    0 Votes
    11 Posts
    584 Views
    R
    @Robert-M oldSize.height was -1 at initial call of the method. Problem solved!!!
  • Deploying MySql program

    Unsolved
    2
    0 Votes
    2 Posts
    216 Views
    Christian EhrlicherC
    See https://doc.qt.io/qt-6/sql-driver.html#qmysql "When you distribute your application, remember to include libmysql.dll / libmariadb.dll in your installation package. It must be placed in the same folder as the application executable. libmysql.dll additionally needs the MSVC runtime libraries which can be installed with vcredist.exe"
  • How to automate user tasks in a Desktop app developed in Qt?

    Unsolved
    5
    0 Votes
    5 Posts
    1k Views
    S
    After countless hours of research and try and error, here is my outcome for those interested into the same topic: Let's first define "automation": Hereby I mean that program code (a script) emulates user actions with the application. The objective is to free the user from repetitive, boring tasks. This could be for example, data exports on a scheduled basis which are then further analyzed. What I am not talking about is: Test automation. automation of industrial processes. With this out of the way, I can summarize: Web applications have an automation API based upon the W3C specification of web driver Windows applications have an automation API called UIA3. It supports Win32, Windows Form, WPF. A Qt application running on Windows cannot benefit from Window's automation API. The underlying libraries of course cannot reference and interact with QML/QQuick objects. If you have a Qt-programmed application that you did not program yourself, there is no way to emulate user interactions! There is no API that allows you to address the GUI elements programmatically. The Accessibility API requires that the developers would have invested their time to provide means to connect with accessibility applications. This is very often not the case for obvious reasons. In the QT world the rule applies : No access to the source code, no way to automate ! Squish and Ranorex are commercial tools made for test automation. In theory they could be converted to emulate user interaction with the 3rd party application. However, for non-commercial automation projects the following reasons speak against this only possible workaround: the considerable license costs of Squish and Ranorex extreme overhead installing these tools necessity to have a separate package for each Qt version, i.e. if you would like to automate an application A coded in qt 6.2 you need to install another package than for a qt application coded in version 6.4. You get it.
  • Building a QInputDialog with only the "ok" button

    Solved
    6
    0 Votes
    6 Posts
    1k Views
    Dummie1138D
    @Pl45m4 Thank you. I presume when you suggested building a custom QDialog class, that involves stuffing a QLineEdit into the QDialog?