Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.5k Posts
  • Security thoughts on Webchannel

    Unsolved webchannel security credentials
    3
    0 Votes
    3 Posts
    1k Views
    F
    @SGaist Thanks a lot, I'll post my question there.
  • QSysInfo::machineUniqueId() empty on Windows

    Solved
    28
    0 Votes
    28 Posts
    7k Views
    JonBJ
    @Marek Well Qt is only a library providing "abstracted, convenience" functions where possible, it's not magic, so yes sometimes you have to supply your own alternatives as best you can. If you can't find anything, chances are nor can Qt.
  • Image Toggling

    Solved
    3
    0 Votes
    3 Posts
    386 Views
    G
    @raven-worx Thanks for all the help!
  • Qut of memory in QVector

    Solved runtime error
    14
    0 Votes
    14 Posts
    5k Views
    SGaistS
    There's always a need to return something when your method has a return type. If you don't know what to return at first then return a default value. Also, always take into account the warnings the compiler throws at you (there is one for functions not returning anything when their signature contains a return type). As the old saying goes: a compiler warning ignored today is a catastrophic crash in production tomorrow.
  • Save permanent settings on QT Web App

    Unsolved
    12
    0 Votes
    12 Posts
    2k Views
    JonBJ
    @GCDX Further to @SGaist 's observation. Although http://doc.qt.io/qt-5/qsettings.html#details states Constructing and destroying a QSettings object is very fast. to me it seems "odd/inefficient" to be creating one specifying your organization & project names each time, as these never vary. I would either take the doc's suggestion of: If you use QSettings from many places in your application, you might want to specify the organization name and the application name using QCoreApplication::setOrganizationName() and QCoreApplication::setApplicationName(), and then use the default QSettings constructor or I would create one & only one QSettings in your app and re-use that each time.
  • How to set width of one column int a QTableView?

    Solved
    3
    0 Votes
    3 Posts
    7k Views
    qazaq408Q
    Thank you.... I read document not careful enough ,My mistake.....
  • How to change QStyleOptionButton's text?

    Solved
    4
    0 Votes
    4 Posts
    1k Views
    qazaq408Q
    @VRonin I got it ,thanks
  • qtmqtt make error on linux: "qmqttglobal.h: No such file or directory"

    Unsolved
    17
    0 Votes
    17 Posts
    7k Views
    Pablo J. RoginaP
    @udayraj123 said in qtmqtt make error on linux: "qmqttglobal.h: No such file or directory": Download zip from https://github.com/qt/qtmqtt I can confirm that using the .zip download from such location gave me same errors as you mention (I'm using Lubuntu 18.04 / Qt 5.11) However cloning https://code.qt.io/qt/qtmqtt.git and doing: qmake -r qmake make sudo make install led to QtMQTT module built Ok and installed along other existing modules in my Qt installation so later on you could use the module in any application (i.e. provided examples or your own).
  • QtCreator UI-designer suddenly fails to add/find slots

    14
    0 Votes
    14 Posts
    20k Views
    S
    @kottalovag I had the same problem and was able to verify that the change from raw pointer to std::unique_ptr broke it. Thanks for the tip, you are a life saver. In other words, if you have "std::unique_ptr<Ui::MainWindow> ui;" in your mainwindow.h, your project will still build and run, but you won't be able to use "go to slot" from the ui designer. To fix, change it back to "Ui::MainWindow* ui;".
  • Drag&Drop between Treeviews replaces target item

    Unsolved drag&drop treeview
    2
    0 Votes
    2 Posts
    714 Views
    SGaistS
    Hi and welcome to devnet, What version of Qt are you using ? On what OS ? With what compiler ? Can you provide a minimal compilable example that shows that behaviour ?
  • Can I change Qt's pro file settings to influence sub-projects settings?

    Unsolved
    3
    0 Votes
    3 Posts
    610 Views
    SGaistS
    Hi, What kind of settings do you have in mind ?
  • Database data media error by setRecord via ODBC

    Unsolved
    4
    0 Votes
    4 Posts
    790 Views
    SGaistS
    I haven't used that plugin so I can't comment on that behaviour.
  • QMetaObject::invokeMethod with BlockingQueuedConnection hangs forever

    Unsolved
    14
    0 Votes
    14 Posts
    4k Views
    kshegunovK
    @sykac said in QMetaObject::invokeMethod with BlockingQueuedConnection hangs forever: So if doStuff() was connected to a timer and wasn't in the while loop, it would work? Yes. And as you're mentioning thread safety and data manipulation - is this safe? Is what safe? If you use the data from one thread only then it's safe, yes. @KillerSmath said in QMetaObject::invokeMethod with BlockingQueuedConnection hangs forever: Below is an example of how you can implement Is the mutex really necessary to guard a simple boolean? I'd suggest substituting that with an atomic, even if Qt's mutex implementation is rather fast.
  • How to for QThread and QThreadPool objects wait for thread creation?

    Unsolved
    12
    0 Votes
    12 Posts
    4k Views
    kshegunovK
    @AlekseyB said in How to for QThread and QThreadPool objects wait for thread creation?: I use wait- methods, but they're use my processor to 100%. Why? You never answered what's this waitForDone and how it is implemented. Also note that calling some function waitFor***, won't make it blocking. As I mentioned in your other thread, you can use a semaphore for waiting: // # thread 1 semaphore.acquire(); //< We block here until someone calls release(), or we continue on if someone already did // # thread 2 semaphore.release(); //< Free the waiting thread if it's blocked My post devote by this question was unduly closed (may be bad question ban on this forum). Unduly? I don't think so. We don't discriminate in this forum, the question may be bad, may be good, it's still a question. However we do try to keep the place tidy, which excludes posting of multiples of the same question. I see that is the other question, but I have no choice and ask here. Which is exactly why I closed your other thread, as the issues you describe as two different problems are rather one.
  • Error in toolchain.prf when building new project

    Solved
    10
    1 Votes
    10 Posts
    3k Views
    PhrogzP
    @Andrew-Banson Absolutely! I was having this same problem: I even reinstalled both Visual Studio 2017 Community Edition and all of Qt, but brand new projects were unable to build, giving this output: Running Windows Runtime device detection. No winrtrunner.exe found. C:/Qt/5.11.1/msvc2017_64/mkspecs/features/toolchain.prf(208): Extra characters after test expression. Project ERROR: Compiler produced empty value for Active. C:/Qt/5.11.1/msvc2017_64/mkspecs/features/toolchain.prf(208): Extra characters after test expression. Error while parsing file C:\Users\gkistner\Documents\FooBar\FooBar.pro. Giving up. I had recently added an Autorun registry key with the value chcp 65001 in an attempt to fix cmd.exe's broken Unicode. As soon as I removed this registry key, I was able to build and run projects in Qt Creator. @glarson Great find, thank you! @SGaist Thanks for the tips that led glarson to find this. Based on the error messages, I never would have found the problem without this post. Note: Instead of removing the chcp 65001 Unicode code page hack, you can modify it to emit no output text by instead using @chcp 65001>nul. This fixes Qt Creator's fragile parsing, while retaining a slightly better cmd.exe unicode experience. :p
  • Interesting effect with tr().arg()

    Solved
    14
    0 Votes
    14 Posts
    6k Views
    JonBJ
    @ChrisVT I love things which "MOSTLY" work :) Be aware, if you are going to use "numerical formats" as you say then, as @VRonin pointed out in the post he referred to, these will not be localed. If you care about that, you must format them to localed strings in the first place, then you can pass them to the list-arg() because they are now strings.
  • ListWidget Text size fixed

    Solved
    13
    0 Votes
    13 Posts
    4k Views
    A
    @JonB Wrapping is work for me. Thank you
  • QFile::rename problem

    Solved
    7
    0 Votes
    7 Posts
    3k Views
    S
    I found the root cause. while exit the application, removed the source file in the de-constructor. Thanks all of you.
  • Error c1083 QtSql

    Solved
    38
    0 Votes
    38 Posts
    8k Views
    Prince_0912P
    @123456789 Separate the code, put in next line QT += sql in .pro file, Save all, Close the qt project, go to project file location, delete ex3.pro.user, open ex3 project, Choose appropriate kit when configure project, rebuild the project.
  • How to convert rgb value to QColor?

    Moved Unsolved
    6
    -2 Votes
    6 Posts
    7k Views
    jsulmJ
    @Prince_0912 It's even easier QColor color(red, green, blue); http://doc.qt.io/qt-5/qcolor.html#QColor-2 And fromRgb() is static - you do not need a QColor instance to use it: QColor color = QColor::fromRgb(...);