Listing line number of results in `find` and `ls`
3,861
Solution 1
You can use the following command:
ls | nl
Solution 2
"cat -n" will add line numbers. E.g.: ls | cat -n
Related videos on Youtube
Author by
Sadık
Updated on September 18, 2022Comments
-
Sadık over 1 year
When using a QToolButton and the
setDefaultAction(myAction)
method, it will get the default actions propertiesIf a tool button has a default action, the action defines the button's properties like text, icon, tool tip, etc.
So I try to overwrite the icon, calling setIcon on the QToolButton.
myAction.setIcon(...); myToolButton->setDefaultAction(myAction); myToolButton->setIcon(...);
But it
myToolButton
still has the Icon ofmyAction
.Is there a way to hold the default action but overwrite it's icon, only for the QToolButton, not for the action itself? In otherwords: How can the QToolButtons have different properties than its default action?
-
Pavel Strakhov over 9 yearsOverwriting icon using
setIcon
perfectly works, at least in Qt 5.2. What is your Qt version? -
Admin over 8 yearseh, same solution, but somewhat different problem
-
Admin over 8 yearsNot if you see the problem for what it is: "Run some command and get line numbers in output"
-
Admin over 8 yearsbut how would i go about finding that thread given my question, ie how did you find it?
-
Admin over 8 yearsGoogled
line number output site:unix.stackexchange.com
(it was the last result on the first page.) The Stack Exchange site search is notoriously bad, Googling with a site restriction often yields better results. -
Admin over 8 yearseh ok, i'll accept that
-
-
Andrew Dolby over 9 yearsThe reference docs you linked were for Qt 4.8, so I checked the source for 4.8. It's got the same use of
setIcon(action->icon())
. Could you post a more complete code example? I've tested usingsetDefaultAction
thensetIcon
, and it's working for me. I'll post an example if you'd like to take a look. -
Sadık over 9 yearsyour code works for me. However my code doesn't and I don't understand why. Anyhow, it seems that I have another problem here.
-
cfye14 over 8 yearsThx. Can't upvote but what I'm looking for.
-
cfye14 over 8 yearswhat i'm looking for, thx. probably could find this but my google query was awkward, i think.