跳到內容

Brainstorm

Stuck? Some ideas just need to be dumped on someone before they can materialize.
456 主題 3.2k 貼文
  • using qtmain_win.cpp in a qt project

    Unsolved qt creator
    3
    0 評價
    3 貼文
    1k 瀏覽
    M
    @sierdzio Thank you. I am following the most-recently-updated instructions from here I tried removing exclusion of qt gui but my error persists
  • running qmake on qt project

    Unsolved
    6
    0 評價
    6 貼文
    2k 瀏覽
    SGaistS
    In that case, defines won't help. You can put that path in variable to reuse in your different calls. In any case, I would recommend to rather generate a header file using QMAKE_SUBSTITUTE like described in this wiki entry. IIRC, this variable is going to get documented in the next Qt release but is already usable since some time now. This will simplify your life and avoid having to generate string defines for all the possible shell that you are going to use.
  • What do you think about my projects?

    Unsolved
    5
    1 評價
    5 貼文
    1k 瀏覽
    mrjjM
    @arkadiusz97 That could also show of database usage. So not bad idea, IMHO
  • Signal/Slot design philosophy

    10
    0 評價
    10 貼文
    2k 瀏覽
    kshegunovK
    @J.Hilk said in Signal/Slot design philosophy: WHAT!? Do tell, I'm unaware of that feature. Debug > Operate by Instruction Unless you had something else in mind.
  • Get current working directory in a Qt application

    Unsolved
    3
    0 評價
    3 貼文
    9k 瀏覽
    JonBJ
    @davidspen From exactly what you say in your question, I would not have answered it as @sierdzio has. (Unless there is something special about "if you are inside an AppImage package", I don't know about that.) How/where do you launch your Qt executable from? You say I would like the current working directory of my program to be the directory in which I am with my terminal (ie. the result of the pwd command). If you go into a terminal and type the name of an executable to run, which is then found via a symbolic link in your ~/bin which is on your PATH, that will not change the current directory. It will remain whatever it was in the terminal you launched it from. Which is what you say you want. And what QDir::currentPath() should already be delivering you: Returns the absolute path of the application's current directory. The current directory is the last directory set with QDir::setCurrent() or, if that was never called, the directory at which this application was started at by the parent process. In that case I would ask why it is not already correct? If you instead want something about the directory the executable is actually in, or you run it in a different way, that's a different question?
  • Open source HMI/Scada

    Unsolved
    5
    1 評價
    5 貼文
    7k 瀏覽
    V
    @pokey That could be interesting.
  • Concept Development

    Unsolved
    2
    0 評價
    2 貼文
    849 瀏覽
    SGaistS
    Hi and welcome to devnet, If you want to discuss development one of the best place would be the development mailing list. You’ll find there Qt’s developers/maintainers. This forum is more user oriented.
  • Why does QVariant use a union?

    Unsolved qvariant design
    10
    0 評價
    10 貼文
    4k 瀏覽
    JKSHJ
    Hi @Larvae, you might get better answers to questions about internal code and design decisions at the Interest mailing list (subscribe first, then post). Qt engineers are active on that list; this forum is mainly used by Qt users who don't necessarily know any internal details.
  • I have doubt how to do echo from server when multiple clients connect for particular client reply?

    已鎖定 Unsolved
    2
    0 評價
    2 貼文
    1k 瀏覽
    aha_1980A
    @bhargav isn't that the same question as https://forum.qt.io/topic/93942/i-have-doubt-on-tcp-ip-multi-client-with-single-server ? please don't cross-post!
  • Why is QML not on rosettacode yet - is it a technical or practical reason?

    Unsolved
    2
    0 評價
    2 貼文
    734 瀏覽
    6thC6
    Well. I'd never seen that site before - it would be up to the site owenr / someone else to maintain the content on their site. Regarding learning QML: the documentation and forums here is plenty. Then there are the example applications, the book and also the mailing list and I check the Qt reddit but it's pretty quiet. No need to look further just imo, I'd rather have less places to look but higher quality but sometimes I'll venture online to see what others have gone and done themselves. I agree, QML is so desirable for it's declarative syntax - it makes for very clean GUI code - just define what you want to see, how it behaves and no syntax fluff - just what you need. And it only gets better as you go on too - discovering you can change this: anchors.top: parent.top; anchors.bottom: parent.bottom; anchors.left: parent.left; anchors.right: (configVisible || readoutVisible)?...; to this: anchors { top: parent.top; bottom: parent.bottom; left: parent.left; right: (configVisible || readoutVisible)?...; } makes code so much quicker to understand and read the context of, instead of reading the same over and over - you just focus your head on the important bits.
  • Simple 3d drawing

    Solved 3d canvas opengl example tesseract
    2
    0 評價
    2 貼文
    2k 瀏覽
    J.HilkJ
    Alright, with much time and an extensive amout of google search I managed to cobble a working QOpenGLWidget program together. I used this official Qt-Example as a basline: http://doc.qt.io/qt-5/qtopengl-cube-example.html here is the combination with my Tesseract code https://github.com/DeiVadder/Tesseract-Challenge-OpenGL It's working, yeah me!!, but I have the feeling that it's far from ideal. I'm just glad I managed to draw something in 3d. Anyway, closed and solved.
  • QT SQL query loop?

    Unsolved
    8
    0 評價
    8 貼文
    3k 瀏覽
    JonBJ
    @davethedave Firstly, I don't work in C++ so I don't test the code for the right way to pass the output string to printf(). So your corrections are good. [BTW you'd be better off not using printf() and using Qt/C++ functions, then you wouldn't have all that toUtf8().constData() stuff, but that's another matter.] As you can see you have 3 rows matching the query, you tell us you have 5, or you had 5 and now you have 3. That's worrying when you're asking for help. Your Username value appears to be 1 from the output. That is a strange username. I don't know what your problem is. The original code should correctly print out whatever is in the Username column of each row encountered (note that since you didn't put a \n in it will all come on one line, which isn't great, I do trust that is not what this is all about.)
  • Streaming file content from webserver or something?

    Unsolved
    15
    0 評價
    15 貼文
    4k 瀏覽
    SGaistS
    You can get get the hex values with QByteArray::toHex.
  • Read line and store info?

    Solved
    4
    0 評價
    4 貼文
    1k 瀏覽
    JonBJ
    @davethedave In addition to what @VRonin has shown, if your lineusername/linepassword are, say, QLineEdits, you cannot assign via text() = ... as you tried in yours, you'll want to use setText(). [EDIT As @VRonin 's example now shows.]
  • Extremely stuck with passing two arguments to slot

    Solved
    9
    0 評價
    9 貼文
    3k 瀏覽
    D
    @J.Hilk Thank you so much! your solution works perfectly! What an amazing helpdesk
  • adding CUDA to Qt

    Solved
    4
    0 評價
    4 貼文
    7k 瀏覽
    M
    It turned out that making cuda.conf file in /etc/ld.so.conf.d containing path to cuda libs directory and running ldconfig solved my problem.
  • QAbstractItemModel::setItemData partial success

    已移動
    18
    0 評價
    18 貼文
    5k 瀏覽
    VRoninV
    @kshegunov said in QAbstractItemModel::setItemData partial success: try pinging the list I won't even try pinging it before September, don't worry. It was more to keep the 3 channels (forum/gerrit/mailing list) aware of each other
  • QTimer not emitting timeout signal

    Unsolved
    8
    0 評價
    8 貼文
    3k 瀏覽
    J.HilkJ
    @Channareddy you ccould use a QTime or QElapsedTimer instance and check each whileloop iteration the elapsed value
  • best practices: I'm doing it wrong

    Solved
    40
    1 評價
    40 貼文
    12k 瀏覽
    mzimmersM
    Clever...very clever. So, to summarize: it's generally a good idea to perform editing in a separate window/dialog. create this window with new->Qt Designer Form Class; this create everything at once. use the QDataWidgetMapper in the edit dialog to display the details from the model. use VRonin's technique of setting the model index for the edit dialog by using the index from the parent window. I'll edit the summary if anyone informs me of errata. Thanks for all the assistance.
  • To Mutex or not to Mutex

    17
    0 評價
    17 貼文
    6k 瀏覽
    J.HilkJ
    @kshegunov said in To Mutex or not to Mutex: @J.Hilk said in To Mutex or not to Mutex: As long as the While loop is running the event loop of the thread is "on halt" therefore no Signals are emitted/received during that time. Emission of signals is not affected by a blocked event loop. Only the execution of the slot connected to the signal if the receiving object's thread's event loop is blocked. :) 😱 [image: 3ea4929e-70e7-49ad-af3a-ba508e9a22d3.png]