Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.8k Posts
  • QBitArray instantiate with a sequence of bits

    Unsolved
    2
    0 Votes
    2 Posts
    243 Views
    J.HilkJ
    @roditu you don't initialiser list is not supported for QBitArray or for QByteArray you can use the from bits function correctly: const char *data = "\x7"; // 1110 in binary depending on endian QBitArray bits = QBitArray::fromBits(data, 4); keep in mind, that data needs to live as long as bits! or you could make a helper function : QBitArray bitArrayFromList(std::initializer_list<bool> list) { QBitArray bits(list.size()); int i = 0; for (bool b : list) { bits[i] = b; ++i; } return bits; } QBitArray bits = bitArrayFromList({true, true, true, false}); qDebug() << bits << bits[0] << bits[1] << bits[2] << bits[3]; //QBitArray(1110) true true true false
  • Force aspect ratio on window

    Unsolved
    3
    0 Votes
    3 Posts
    300 Views
    G
    @SamiV123 Is there no built in feature for this?
  • This topic is deleted!

    Unsolved
    3
    0 Votes
    3 Posts
    182 Views
  • Run Qt Gui in separate thread

    Unsolved
    11
    0 Votes
    11 Posts
    3k Views
    S
    @J-Hilk said in Run Qt Gui in separate thread: @SamiV123 said in Run Qt Gui in separate thread: About Qt I don't know. I can see failure modes if some bad engineering is done. there's one major problem with creating a Thread via QThread that then contains the QCoreApplication instance. QThread is a QObject. And QCoreApplication or one of its derivatives NEEDS to be the first QObject to be instantiated. One of the reasons static QObjects are prohibited Yep, but you can always use CreateThread, std::thread for example.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    3 Views
    No one has replied
  • QPrintPreviewDialog print all pages though page range is selected

    Unsolved
    3
    0 Votes
    3 Posts
    485 Views
    A
    I encountered same issue (it is mentioned even in official QT doc, that this functionality depends on operating system). However there is a way to workaround it. The idea is to create new QPrinter object, also with new QPainter. Then you pass them the print settings catched in preview dialog and render only desired pages from your data source, for example: rangePainter.begin(pageRangePrinter); for(int i = from; i <= to; i++) { yourDataSource[i-1]->view->render(&rangePainter); if (i != printer->toPage() ) { pageRangePrinter->newPage(); } } rangePainter.end(); So in fact, you print using another QPrinter object. However there is an important point to overcome. If user clicks "Print" in preview dialog, signal paintRequested() is emitted 2nd time and probably your logic showing preview before, will fire itself again and the printer will start printing all pages + pages in range (from logic above). I think there are many ways to manage with it, but one is to disconnect this signal after 1st emit (1st emit is being done when user request to show preview dialog). I hope it will help
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    3 Views
    No one has replied
  • What Are the Best Practices for Implementing Progressive Web Apps (PWAs) in 2023?

    Unsolved
    3
    0 Votes
    3 Posts
    498 Views
    S
    @Sachin-Bhatt said in What Are the Best Practices for Implementing Progressive Web Apps (PWAs) in 2023?: In 2023, what are the current best practices for developing Progressive Web Apps (PWAs) to provide an optimal user experience? You are asking this question in a Qt forum. Qt is certainly not the choice for PWAs. For an optimal user experience I always suggest Wt (https://www.webtoolkit.eu/wt). It heavily borrows from Qt and you write your web app (almost) entirely in C++. The PWA part is done totally hidden in the background. I consider the "optimal user experience" to be 1) a fast loading webpage with 2) fast response during interactions. Wt does deliver this. However, Wt does not fulfill another part of your question: @Sachin-Bhatt said in What Are the Best Practices for Implementing Progressive Web Apps (PWAs) in 2023?: how can they leverage new features and APIs for improved performance and user engagement? Wt does not have the newest features. Concerning performance it doesn't have to. But I honestly question your premise: I don't see a direct correlation between new features and improved performance. If you just add features on top I would expect things to get slower. The fastest webpage you can write is a static one. Still, a lot of "static" pages use 20 different tools to achieve the same task with inferior performance. As a user of web pages and web apps I don't see the point in using all the newest features just for the sake of it. You might use some new features for better user engagement, though.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    5 Views
    No one has replied
  • Qt6 yocto build - nothing provides tslib-native

    Unsolved
    3
    0 Votes
    3 Posts
    443 Views
    M
    @MartinD I found this https://wiki.yoctoproject.org/wiki/Technical_FAQ What does "native" mean? The "native" suffix identifies recipes (and variants of recipes) that produce files intended for the build host, as opposed to the target machine. This is usually for tools that are needed during the build process (such as automake). So, if I understand it correctly, how can I get tslib for my host machine (ubuntu)?
  • How to make QCalendarWidget not scrollable?

    Unsolved
    6
    0 Votes
    6 Posts
    457 Views
    JonBJ
    @Hai-Anh-Luu I don't know about the specific "change month", but see https://www.qtcentre.org/threads/55248-QCalendarWidget-how-to-stop-wheel-events-processing from 2013(!) with apparent solutuon Install the event filter on the view's viewport.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    4 Views
    No one has replied
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    4 Views
    No one has replied
  • How to use a custom font in Qt Installer Framework?

    Solved qt installer custom font font qtinstaller
    3
    0 Votes
    3 Posts
    1k Views
    W
    @SamurayH I have encountered a similar problem and do not know how to solve it. It's not valid here either QCheckBox::indicator:checked { image: url(img/checked_on_normal); } QCheckBox::indicator:unchecked { image: url(img/checked_off_normal); }
  • Compile to arm

    Unsolved
    2
    0 Votes
    2 Posts
    208 Views
    C
    @Kattia Assuming you have a Qt library built for the ARM architecture then your program should require little, if any, change. The areas it would have to change will be anything you have done that assumes an x86 64- or 32-bit architecture or features not available on Windows for ARM (whatever they may be).
  • Qt Bluetooth 6.6.3 Error

    Unsolved
    3
    0 Votes
    3 Posts
    336 Views
    C
    @Brightside Assuming you used the Qt online installer then: [image: 8ee6f50f-f5b1-4d8c-bf85-90a396968db8.png]
  • 0 Votes
    2 Posts
    769 Views
    A
    Ok I managed to get it through to App Store Connect! Had to replace the call to macdeployqt with Xcode's equivalents :( Got some helpful info from Apple, details on this thread if anyone's interested https://developer.apple.com/forums/thread/740606
  • This topic is deleted!

    Unsolved
    11
    0 Votes
    11 Posts
    74 Views
  • How to use qInstallMessageHandler in an in-Process Axserver

    Solved
    6
    0 Votes
    6 Posts
    689 Views
    jsulmJ
    @TheCrowKaka said in How to use qInstallMessageHandler in an in-Process Axserver: Static works as both output_ts and outFile are required across multiple classes Sounds like bad design
  • Raspberry Pi 3, QOpenGLFunctions_3_2_Core

    Unsolved
    3
    0 Votes
    3 Posts
    253 Views
    B
    @jsulm Thanks for suggestion. Ill try in several days.