Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • Parse Date/Time with timezone offset and convert to local date / time String

    Unsolved
    2
    0 Votes
    2 Posts
    3k Views
    B
    Your string have "+02:00" in it so it is not an UTC time. //This is not Qt::UTC but Qt::OffsetFromUTC because of the "+02:00" QDateTime::fromString("2020-10-14T21:22:24+02:00", Qt::ISODate); If you want an UTC time QDateTime utcDateTime = QDateTime::fromString(utcDateTimeString, Qt::ISODate).toUTC(); I'm not familiar with toLocalDateTime() in java, but I think toLocalTime() might be not quite the same with it. It will convert the datetime to your system's locale time. Anyway if you want to convert it to Timezone "Europe/Berlin". QDateTime localDateTime = utcDateTime.toTimeZone(QTimeZone("Europe/Berlin")); As I tested, you'll get "2020-10-14 21:22:24" for "Europe/Berlin" time, the same as "+02:00", because of the DST. If you change the month to November QString dateTimeString = "2020-11-14T21:22:24+02:00"; QDateTime berlinDateTime = QDateTime::fromString(dateTimeString , Qt::ISODate).toTimeZone(QTimeZone("Europe/Berlin")); Then you'll get "2020-11-14 20:22:24"
  • QSharedMemory, Read / Write and Read Only.

    Unsolved
    16
    0 Votes
    16 Posts
    2k Views
    JonBJ
    @SPlatten Then I think I would at least read the proposed solutuon in, say, https://stackoverflow.com/a/35003672/489865 So one thing you can do is shm_open(..., O_RDWR) in the parent and set up a writable mapping for the parent before closing the handle, then shm_open(..., O_RDONLY) to get a read-only file handle which you will pass to the children I do not know how QSharedMemory operates, but if it indeed leverages this shm_... approach it may be relevant. I will keep quiet now, as I know no more than this....
  • Changing tab in QTabWidget

    Solved
    3
    0 Votes
    3 Posts
    296 Views
    SGaistS
    Hi, Beside the good points of @JonB, you should also add which version of Qt you are using as well as the platform you are running your application on.
  • QLowEnergyController with error: AuthorizationError

    Unsolved
    3
    0 Votes
    3 Posts
    254 Views
    JonBJ
    @Pham-Hoang Since no one else has replied: if you connect some device to your phone, do you have to do something to give permission to access that device to individual applications under Android?
  • This topic is deleted!

    Unsolved
    3
    0 Votes
    3 Posts
    18 Views
  • Scroll QTableView as soon as model changes

    Unsolved
    10
    0 Votes
    10 Posts
    1k Views
    SGaistS
    Which version of Qt are you running ?
  • Issues locating Assets folder

    Unsolved
    1
    0 Votes
    1 Posts
    145 Views
    No one has replied
  • 1 Votes
    3 Posts
    2k Views
    Guy GizmoG
    @JKSH You know, even though I use event filters all the time, for some reason I didn't think about using them here. But obviously that's a better way of accomplishing this than subclassing QApplication. And based on the doc excerpt you posted, it sounds like posting an event with very high priority is what I want.
  • simple Notepad

    Solved
    12
    0 Votes
    12 Posts
    1k Views
    J
    Thanks to JonB I have now managed to get things working as I want.
  • Set Color and background color of childs of custom QWidgetAction

    Unsolved
    12
    0 Votes
    12 Posts
    2k Views
    SGaistS
    You can't directly apply your hover background to widgets that are not being hovered. One thing you can do is to use a dynamic property and set it to all the widgets when you entering the main one and change its value when moving out of it.
  • Problems encountered when upgrading openssl1.0.2k to openssl1.1.1

    Unsolved
    2
    0 Votes
    2 Posts
    355 Views
    SGaistS
    Hi, You cannot just replace OpenSSL 1.0 with 1.1. The 1.1 release is not backward compatible. Furthermore, OpenSSL 1.1 support has started with Qt 5.10.0.
  • Windows 10: deleting the 'build' directory doesn't work… but works

    Unsolved
    2
    0 Votes
    2 Posts
    198 Views
    GerhardG
    Close project in qtcreator
  • Accessing qrc resources

    Unsolved
    10
    0 Votes
    10 Posts
    2k Views
    N
    For anyone interested: the app and my dll were using different qt library versions.
  • Error converting double to int

    Solved
    8
    0 Votes
    8 Posts
    3k Views
    JonBJ
    @HB76 said in Error converting double to int: It was just that Qt didn't showed the real value of a even with this output format QString::number(a,'g',16) FGS. Count the number of digits. Yes, that is all digits, not just the ones after the decimal place, as per the documentation: For the 'g' and 'G' formats, the precision represents the maximum number of significant digits (trailing zeroes are omitted). Is 16 enough?
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    16 Views
    No one has replied
  • Cross compiling QT for raspberry pi - AT_FDCWD was not declared in this scope

    Solved
    2
    0 Votes
    2 Posts
    589 Views
    B
    Figured it out finally. The original compiler from rpi toolchain didn't work for some reason, and my own compiler was built without --enable-multiarch Adding this parameter to gcc configure script finally solved the problem.
  • Starting executable failed

    Unsolved
    4
    0 Votes
    4 Posts
    1k Views
    JonBJ
    @Gregor_-15 You should change your real-life name to not have an accent ;-)
  • Can't drag widgets form or navigator Mac OS Catalina

    Unsolved
    2
    0 Votes
    2 Posts
    262 Views
    jandymanJ
    This situation resolved itself for unknown reasons.
  • The best communication protocol for project

    Unsolved
    4
    0 Votes
    4 Posts
    557 Views
    Pablo J. RoginaP
    @Creatorczyk said in The best communication protocol for project: transfer of large amounts of data such as camera data (openCV) ... I would like to do it mainly with the Qt and wiringPi library Those two requirements seem not to be related, I mean I don't expect you will use the wiringPi library to drive the acquisition of camera data, right? As @SGaist suggested, you may want to consider ROS, especially ROS2. And keep in mind that data acquisition (i.e. using RPi + wiringPi) is separated from robot control and actuation.
  • Is it possible to override designer double click functionality on a custom widget?

    Solved
    9
    0 Votes
    9 Posts
    988 Views
    K
    I'm slowly starting to get a better understanding of how to accomplish what I need. I managed to correctly open the editor and override the actual "double click" functionality I was originally asking about. It is simple, but my mistake was thinking the double click functionality was just a double click... it actually runs the default item list in the task menu that appears when you right click the widget in the designer. Anyways, anyone looking to "override" the designers "double click" functionality on custom widgets you need to add a custom QDesignerTaskMenuExtension to your custom widget. Then you can have the window that opens up set the tables columns and column properties of your widget. Once I understood the idea, it took me like 5 minutes to implement (it looks scarier than it is). Qt has a pretty good example of this located here: https://doc.qt.io/qt-5/qtdesigner-taskmenuextension-example.html Now I just have to figure out how to apply the results of my popup to the .ui file....