You can use C++/CLI (that is C++ building for CLR) to build a simple wrapper on the unmanaged C++ code that can be exposed directly to C#. If you want an example of exposing a Qt API to .Net you can check here
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.
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?
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?
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.
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.
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.right: (configVisible || readoutVisible)?...;
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.
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:
here is the combination with my Tesseract code
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.
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.)
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.]
@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
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.
@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. :)
@mzimmers said in suggestions for repeating display views:
I was thinking to use a combo box for the MAC address.
Then it's just a small change to the connect statement:
Hi, and welcome to the Qt dev net!
@Znalazca said in GPL licensing and Contributor Licensing Agreement:
Recently I finished a project. I want to publish it as open source under GNU GPLv3 license. I want to be an owner of whole source code including possible future contributions of other people.
Do you want to be the owner, or just an irrevocable license to use contributed code?
With the Qt Project, the contributor retains copyright of the code. The contributor just grants the Qt Project the right to use the code as they see fit.
I suppose that there may be some 'universal' CLA texts written by lawyers for individuals but I haven't found anything.
Could you recommend me some CLA text for my purposes? I appreciate any help.
I'm not aware of any such universal CLAs either.
If you're interested, here is the Qt Project's CLA: https://www1.qt.io/contributionagreement/
@JKSH said in QAbstractItemModel::dataChanged what would you prefer?:
I'd just choose the option that requires simpler code (which I think is Flavour 1)
it's actually flavour 2 in my case as I would have to check that the two indexes are one next to the other while I don't care using flavour 2
@Christian-Ehrlicher said in QAbstractItemModel::dataChanged what would you prefer?:
When you look at the default implementation you will see that the second one is better:
Ok, this is a show stopper. I did not realise sending topLeft!=bottomRight (often) triggers a repaint of the entire view. This makes flavour 2 strictly better
Thanks everyone for your insight
@Pablo-J-Rogina thanks for the link - very useful indeed and a very good starting point.
Ultimately I'm going for a fully-integrated solution which will have its own waterproof housing and could potentially be Wi-Fi linked to a home network (for email notifications, web access, etc).
It doesn't look like QDataStream has an option to disable the writing of metadata through << operators when using template objects. writeRawData() requires a length field, and I don't believe it's possible to recognize that with a template object. The simple workaround would be to make the template method private with some secondary overload methods that would accept all the different kinds of data I plan on working with and then detect the lengths of the files, but I feel like that would defeat the goal of what I'm going for here.
I could remove the metadata manually. Looking at the resulting files through a hex editor, it seems simple enough to spot. Not preferable, not very optimized, having to open and close the file twice.
@GhostWolf said in Tomtom linux:
The reason I wanted the TomTom was because I just have it laying here, and the programm doesn't have to be fast. The only thing it needs to do is to send data if I press a button on the screen.
As @Wieland already said, most likely nobody here can help you with this. So even if it's possible (from hardware side) to do what you want, you're on your own.