Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Application Development with Qt Creator
  • Table Of Contents Toc
  • Feedback & Rating feedback
Application Development with Qt Creator

Application Development with Qt Creator - Second Edition

4 (25)
close
close
Application Development with Qt Creator

Application Development with Qt Creator

4 (25)

Overview of this book

This book is great for developers who are new to Qt and Qt Creator and who are interested in harnessing the power of Qt for cross-platform development. If you have basic experience programming in C++, you have what it takes to create engaging cross-platform applications using Qt and Qt Creator!
Table of Contents (15 chapters)
close
close
14
Index

Representing data using Qt's core classes


Probably the most common Qt core class you'll run into is QString, Qt's container class for character strings. It has similar capabilities to the C++ STL class, std::wstring. Like wstring, it's multibyte. You can construct one from a traditional C-style char * string or another QString.

QString has lots of helper methods, some of which are as follows:

  • append: This appends one QString class onto another

  • arg: This is used to build up formatted strings (instead of sprintf)

  • at and operator[]: These you can use to access a single character in the QString

  • operator==, operator!=, operator<, operator>, operator<=, and operator>=: These compare two QStrings

  • clear: This empties a QString and sets it to the null string

  • contains: This searches one string for another string or a regular expression

  • count: This counts the occurrences of a substring or character in a QString

  • startsWith and endsWith: These return true if a QString starts with or ends...

Subscribe to access the full title

Advance your knowledge in tech

A Packt subscription gives you instant online access to our library of over 8,000 practical eBooks and videos, constantly updated with the latest in tech
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon