LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-16-2016, 09:57 AM   #16
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930

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.
 
Old 02-16-2016, 10:00 AM   #17
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
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.
 
Old 02-16-2016, 11:49 AM   #18
DrDwayne
Member
 
Registered: May 2010
Location: Wichita
Distribution: Ubuntu Debian
Posts: 155

Original Poster
Rep: Reputation: 4
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.

Last edited by DrDwayne; 02-16-2016 at 11:53 AM.
 
Old 02-16-2016, 12:12 PM   #19
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
http://linux.die.net/man/3/strcasecmp

Read the library functions for GCC.

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.

Last edited by rtmistler; 02-16-2016 at 01:25 PM.
 
Old 02-16-2016, 04:20 PM   #20
DrDwayne
Member
 
Registered: May 2010
Location: Wichita
Distribution: Ubuntu Debian
Posts: 155

Original Poster
Rep: Reputation: 4
Quote:
Originally Posted by rtmistler View Post
http://linux.die.net/man/3/strcasecmp

Read the library functions for GCC.

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

http://doc.qt.io/

weeding through that is a nightmare.


Sorry my friend. . . Either stay off the insults and treat others like you would like to be treated, or don't respond.
 
Old 02-16-2016, 07:39 PM   #21
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Yes strcmpi() doesn't exist in Linux, however the link posted refers to strcasecmp() which may be a suitable alternate function.

Here's a link for Qt examples based on Qt5. http://doc.qt.io/qt-5/qtexamplesandtutorials.html
 
1 members found this post helpful.
Old 02-17-2016, 01:08 AM   #22
a4z
Senior Member
 
Registered: Feb 2009
Posts: 1,727

Rep: Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742
Quote:
Originally Posted by DrDwayne View Post
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

http://doc.qt.io/

weeding through that is a nightmare.


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!
 
2 members found this post helpful.
Old 02-18-2016, 09:34 AM   #23
DrDwayne
Member
 
Registered: May 2010
Location: Wichita
Distribution: Ubuntu Debian
Posts: 155

Original Poster
Rep: Reputation: 4
Yes, I am enjoying learning Linux's C/C++. . .

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:

[edit] Topics
_ismbblead, _ismbbtrail
_ismbclegal
_ismbslead, _ismbstrail
_mbbtype
_mbccpy
_mbsbtype
_mbsnbcmp
_mbsnbcnt, _mbsnccnt, _strncnt, _wcsncnt
_mbsnbcoll, _mbsnbicoll
_mbsnbcpy
_mbsnbicmp
_mbsnbset
_mbsninc
_mbsspnp
_strdec, mbsdec, _wcsdec
_strerror
_strinc, mbsinc, _wcsinc
_strnextc,_mbsnextc,_wcsnextc
stpcpy, _wstpcpy, _stpcpy
strcat, _mbscat, wcscat
strcat_s, wcscat_s
strchr, _mbschr, wcschr
strcmp, _mbscmp, wcscmp
strcmpi, _wcscmpi
strcoll,_stricoll, _mbscoll, _mbsicoll, wcscoll, _wcsicoll
strcpy, wcscpy, _mbscpy
strcpy_s, wcscpy_s
strcspn, _mbscspn, wcscspn
strdup, _mbsdup, _wcsdup
strerror
strerror_s, wcserror_s
strerrorlen_s
stricmp, _mbsicmp, _wcsicmp
strlwr, _mbslwr, _wcslwr
strncat
strncat_s, wcsncat_s
strncmp, _mbsncmp, wcsncmp
strncmpi, wcsncmpi
strncoll, strnicoll, _mbsncoll, _mbsnicoll, _wcsncoll, _wcsnicoll
strncpy, _mbsncpy, wcsncpy
strncpy_s, wcsncpy_s
strnicmp, _mbsnicmp, _wcsnicmp
strnlen, wcsnlen
strnset, _mbsnset, _wcsnset
strpbrk, _mbspbrk, wcspbrk
strrchr, _mbsrchr, wcsrchr
strrev, _mbsrev, _wcsrev
strset, _mbsset, _wcsset
strspn, _mbsspn, wcsspn
strstr, _mbsstr, wcsstr
strtok, _mbstok, wcstok
strtok_s, wcstok_s
strupr, _mbsupr, _wcsupr
strxfrm, wcsxfrm
Retrieved from "http://docwiki.embarcadero.com/RADStudio/en/String.h_Index"
Categories: Topic Indexes | C++ Reference
Help Feedback
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.
 
Old 02-18-2016, 11:41 AM   #24
a4z
Senior Member
 
Registered: Feb 2009
Posts: 1,727

Rep: Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742Reputation: 742
it's called QString
http://doc.qt.io/qt-5/qstring.html

From there you can click on the string function you want, and hey will show an example.

:-)
 
Old 02-18-2016, 08:51 PM   #25
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Quote:
Originally Posted by DrDwayne View Post
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.

Just a few tips.
 
Old 02-18-2016, 10:38 PM   #26
norobro
Member
 
Registered: Feb 2006
Distribution: Debian Sid
Posts: 792

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
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.

EDIT: Here is a link to a good, active Qt forum: http://www.qtcentre.org/forums/4-Newbie

Last edited by norobro; 02-18-2016 at 10:55 PM.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Qt Creator Problem MTK358 Programming 8 06-23-2010 12:18 PM
QT Creator C4C Linux - Newbie 1 12-26-2009 03:37 PM
CD Creator can't see blank CD-R jberkery Red Hat 2 08-17-2006 04:37 PM
gdm creator doralsoral Linux - Software 1 08-20-2004 02:56 AM
help with cd creator creid Linux - Hardware 1 06-14-2004 03:09 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration