ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I hear you with your description, but I'm having difficulties understanding what your question is except that your point is that this is difficult.
Yes, it is. When I started with Qt I was on the cuff to make a full screen, frameless GUI for a non-keyboard, non-touchpad system that had serial and GPIO pins I/O. Plus I had to learn their entire programming styles.
I bought a book that was old 6 years ago, it's 6 years older now. It helped a bit. Just keeping within their examples and working iteratively at it, got me to where I needed to be. And yes, future projects way enhanced my experiences with it. So all I can say is immersion, as well as mimicry worked for me.
Just checking on Borland. I figured they'd be long gone and not saying they still exist, but way back in the early 2000's they converted to C++, or started to promote that language. So I'm unsure what Borland you refer too. Very old school 1980s or more current.
You say in Post #1 that you're learning Linux as well as C/C++.
You don't need Qt for C++, you can program in C++ just using the GNU tools and g++. Used to be part of the build-essentials package. See if you have g++ installed, if not find a way to install it, and try just plain old C++ programming.
Stack Overflow is a very good site for viewing C++ and other similar examples. I see a lot over there. Not to detract from LQ, but largely C++ has been uSoft stuff under Visual Studio.
Borland was bought out by embarcadero about 10 years ago or so . . .
Embarcadero is the leading C/C++ platform for Windows. . .costing well for 2000 dollars. and the Enterprise version in the 4000 dollar range.
It definitely makes Linux look like a extremely low grade platform, no matter how you look at it. It is a professional platform.
I have been dong C/C++ for almost 40 years. Starting out with Turbo C/C++ and still using RAD Studio today.
but I like how Linux has been coming along so far.. . and I would like to convert some of my programs to Linux C/C++. Eventhough they run in Wine, I would rather have the coding linux compatible. And C/C++ is NOT the same across platforms and different compilers.
the biggest problem I have with Linux, is re-inventing C/C++ all over again.
I already gave an example. . .strncmpi. . .Doesn't seem to exist in Linux C/C++. . that means I have to write a subroutine to take my
strncmpi statements and convert them into something lInux C/C++ can understand.
I have found that "open" and "close" are not compatible in linux, as well as the binary operators on how you want the file to be opened. Thus, I will write a subroutine that will take my open and close statements and convert them to Linux's.
I have found that input strings are not all compatible, as well as manipulating the strings.. . all because of idiosyncrasies between the two worlds. Even the include files are not the same between the platforms.
Thus, I am finding that if I can find the classes that QT uses to manipulate their routines from the more "formal" C/C++, I can convert my program much easier by writing some routines to use these, allow my program to do its stuff, and convert back to QT's version of manipulating data. That way, I am not re-writing the entire program just for linux. When doing this, I am also learning Linux's form of C/C++.
I messed around with GNU's and g++(installed that). That was a waste of time. .I didn't feel like re-inventing every wheel there was, from Push Buttons to input fields, to everything else. QT Came the closest to what embarcadero had for platform and GUI.
If you've been doing this for 40 years, then you've been doing it for about 5 or so years longer than I and thus you know that you have to read documentation and errata, and then use a scope and debugger to prove things; like in a microprocessor semiconductor spec, the brag sheet isn't always the definitive documentation.
open and close have manual pages too.
Sorry, but come back with something a bit more befitting of someone with your experience level. You're accusing Linux of causing you to need to re-invent C and C++. Hmmm ... maybe Borland is at fault there, or maybe you're still using C from way back in the K&R standard.
If you've been doing this for 40 years, then you've been doing it for about 5 or so years longer than I and thus you know that you have to read documentation and errata, and then use a scope and debugger to prove things; like in a microprocessor semiconductor spec, the brag sheet isn't always the definitive documentation.
open and close have manual pages too.
Sorry, but come back with something a bit more befitting of someone with your experience level. You're accusing Linux of causing you to need to re-invent C and C++. Hmmm ... maybe Borland is at fault there, or maybe you're still using C from way back in the K&R standard.
Excuse me. . ?Befitting of my level? I hope this is not some insult of my intelligence. When you use GUI's and up to date heavy equipment for programming, and switch to something like linux, there is a huge difference. It seems you have no knowledge of Embacardero and what it is all about. May I suggest downloading a trail version of it. Seattle is the latest. Then you may understand the big differences between GUI's of different OS's.
I also know about documentation and the works. But documentation isn't always as easy to find info in, when the documentation you have used for years calls things differently.
Took me a while to find something as simple as an "Event". I guess QT calls it a "Slot". Nothing wrong with a "slot" but very difficult to find in documentation when looking for "Event" or something similar.
Strncmpi. . doesn't exist in Linux. . .Open and Close are totally different. Headers for these files are totally different between the two operating system, as well as the binary switches that tell the compiler how to treat the file. And you tell me my knowledge is lacking?
Yes, I read documentation, and I read a lot. But when find documentation of
Excuse me. . ?Befitting of my level? I hope this is not some insult of my intelligence. When you use GUI's and up to date heavy equipment for programming, and switch to something like linux, there is a huge difference. It seems you have no knowledge of Embacardero and what it is all about. May I suggest downloading a trail version of it. Seattle is the latest. Then you may understand the big differences between GUI's of different OS's.
I also know about documentation and the works. But documentation isn't always as easy to find info in, when the documentation you have used for years calls things differently.
Took me a while to find something as simple as an "Event". I guess QT calls it a "Slot". Nothing wrong with a "slot" but very difficult to find in documentation when looking for "Event" or something similar.
Strncmpi. . doesn't exist in Linux. . .Open and Close are totally different. Headers for these files are totally different between the two operating system, as well as the binary switches that tell the compiler how to treat the file. And you tell me my knowledge is lacking?
Yes, I read documentation, and I read a lot. But when find documentation of
Sorry my friend. . . Either stay off the insults and treat others like you would like to be treated, or don't respond.
actually the Qt docu is very good
boost file system, something very similar will become c++ standard.
events are function pointers, you can pack them in signal slot,
gtk has libsigc, and it's c++ part libsigc++
boost has also a signal library, actually there are 2 in boost.
yes, there are differences between platforms, and between libraries, and sometimes it is hard to step into something new,
but it is always the same, the first time is hard and you wish old stuff , than it becomes better, and than it makes fun (if its not MSVC:-).
it's just a matter of invested time,
enjoy you new possibilities in the Linux world. good luck!
and I do expect a learning curve. . . I expect now, a much larger learning curve, because I do not know how to move around the documentation that well with QT. Which is a hindrance for me as a newcomer and as someone who is used to a different platform, as well as learning the different subroutine names which I am not used to. And probably as I am older, that is part of it too. <smile>
Maybe I don't have all of QT docs loaded, as well as not knowing exactly how to make the best of them. (Which could be possible. I am very far from being a "Linus" Guru. I am classified by myself as a neophyte when it comes to Linux).
The help given to me so far, I have been able to do quite well with it... Already made quite a few programs, manipulations of programs through the Widgets, and good functionality. I am quite impressed!
I see that QT has is own classes wrapped around C/C++ classes. I figured if I stuck with the basics, I can slowly learn the classes of QT. This is similar to RAD Studio's AnsiString. That is why I have so far, written subroutines to convert my code into Linux's code. Data Input and Output is doing fine, I am working on string manipulation and file's right now. Just taking small sections one at a time.
For example, if I want to deal with strings, I just type in string in help, and I get this:
Quote:
string.hFrom RAD Studio
Go Up to C Runtime Library Reference Index
The following functions, macros, and classes are provided in string.h:
From there you can click on the string function you want, and hey will show an example.
But I realize that I am use to this platform. . .and I must figure out the ins and outs of Linux's platform!
Thus, I may be lacking the proper downloaded documentation, or I haven't quite figured out the ins and outs of the
QT documentation. . (Part of that learning curve).
But I do want to thank all of you for your help... Also thank you for your patience.
Maybe I don't have all of QT docs loaded, as well as not knowing exactly how to make the best of them.
A suggestion, and not saying you already aren't doing this, but recommend you rely on the Qt documentation online. Beware of the version of Qt you are using and seek the top level of the Qt documentation for that version just to ensure that the classes supported are properly documented for what you're using.
a4z has shown a link, start there, but ensure that you find the top level and the top level of the version you have and then set a bookmark/favorite for that.
I find that easier than trying to iteratively search for each Qt class via Google, or relying on having had installed the docs when I installed Qt.
Be it Windows or Linux, I've also just set up Qt to compile on the development machine I'm using, then create my initial app and run it right on that machine to validate the widget behaviors.
Maybe not everyone's preference, for me I usually do something like 2-15 screens with anywhere from 1-20 touch/tap widgets and maybe screen overlays. So my project organization is to have a main H file defining my primary class. I separate the widget definitions by screen. I have a CPP file per screen. A separate CPP source file for all my slots. Another CPP file for my timers. An H file for my enums, another H file for any macros, especially styling for buttons and such.
A big thing for slots is that if you define a slot reference in the private slots: section, but do not define the actual slot. Or something like you assign a slot when creating a widget, but then do not define nor create the slot, one of those variations, you can get a successful compile, but it ends up doing nothing and you pull hair out trying to figure out why. This is very commonly found with typing mistakes. You do like Hungarian notation or something:
ThisSlotDoesMyAction
But you end up assigning it to the name ThisSlotDoesMyActions, notice the ending letter s in that second variation. End result is that it sees that a slot is assigned, just ... that slot doesn't exist. But you think it does because you don't notice your typing mistake. And hence you go crazy adding debug to the intended ThisSlotDoesMyAction function until you either figure it out, or ask for help and someone else notices that.
If you are running Ubuntu, as your profile says, you can use your package manager to download Qt documentation help files (.qch). Then you can access help in Qt Creator by hitting F1. After downloading, in Qt Ctreator select Tools->Options->Help->Documentation->Add to register the help files. http://packages.ubuntu.com/trusty/al...5-doc/filelist
I use Qt Creator as my C++ IDE and have help files (.qch) for C++ and the standard lib.
I agree with rtmistler that you should start off hand coding some simple programs to understand how the gui code works, but I disagree about not using Qt Creator. Just don't use the Designer to build your gui(s). I haven't looked at the Qt5 examples but I believe most of the Qt4 examples are hand coded.
I've used Qt since v3.2 which was before Nokia bought out the trolls at Trolltech and there was no Qt Creator.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.