How to set a fix string at first of QLineEdit? [duplicate] - c++

This question already has answers here:
How to put a static text (postfix, prefix) in QLineEdit?
(2 answers)
Closed 2 years ago.
It's possible to set a fix string at first of QLineEdit? something like this:
Which in here $ is constant and user could not remove or edit it.

use the input mask in the object: e.g.
ui->lineEdit->setInputMask("$ 000.000.000.000 ");
will look like

Related

Remove ".txt" from filename variable [duplicate]

This question already has answers here:
Removing extension of a file name in Qt
(5 answers)
Closed 3 years ago.
I want to save some files with QT:
QString path = SAVE_AUDIO_PATH+filename+QDateTime::currentDateTime().toString("yyyyMMdd_hhmmss");
filename have a format audiotest.txt
I want to delete a ending of filename - change from audiotest.txt -> audiotest
How can I do it? Thank you!
The right way to get rid of the file extension is using QFileInfo class. For example:
auto fileNameWithoutExtension = QFileInfo(fileName).baseName();
If you can safely assume there is always an extension, you can use:
filename.left( filename.lastIndexOf( '.' ) )
Otherwise, you would have to check to see if it has an extension or not first.

Notepad++ Delete 9 characters after a string [duplicate]

This question already has answers here:
How to remove the last 13 (or n) characters of every line using Notepad++
(3 answers)
Closed 5 years ago.
I am looking for a way to delete 9 characters after a string :
vimeo.com/600984066
I want to only have vimeo.com/ is there a way to do it with maybe regex ?
Important : I have some content after so i can't delete the 9 last characters of a line.
I found a solution using (?=vimeo\.com).{18}, hope that will help someone.

Increase print depth for lists in SML/NJ [duplicate]

This question already has an answer here:
Increasing the print depth in SML/NJ
(1 answer)
Closed 6 years ago.
I'm using Emacs to write a simple function in sml of about 4 lines and when I try to call the function/evaluate it in the buffer it returns this with 3 dots at the end
val it = [1,2,2,2,2,2,2,2,2,2,2,2,...] : int list
What's the dots at the end? My code doesn't print any dots. Is this is from Emacs or sml? any hints please.
Also I'm supposed to get a longer list like
[1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2]
is that why the dots there?
is that why the dots there?
Yes.

how to check the second character match in mongoDB. in sql we are using like '_a%'. how to use in mongoDB? [duplicate]

This question already has answers here:
How to query MongoDB with "like"
(45 answers)
Closed 6 years ago.
how to check the second character match in mongoDB. in sql we are using like '_a%'. how to use in mongoDB??
you should use syntax like below:-
db.users.find({"name": /.a./})
or like >> db.users.find({"name": /a/})
if you want to search for character "a"

display integer value in textbox in c++ [duplicate]

This question already has answers here:
Inserting an integer value in a TextBox
(5 answers)
Closed 7 years ago.
I have one Text Box in windows application. This Text box can only hold a String value and not an integer. How can i pass the integer as a String to the text box?
int a=3;
//textBox1->Text = ???
Assuming you are working with VisualC++, you can convert integer to string as follows:
yourIntegerValue.toString();
in your case:
textBox1->Text = a.toString();
Please consider using the search function, next time you are tempted to ask. This question is a duplicate for:
Inserting an integer value in a TextBox