Using this:
void MainWindow::on_webView_linkClicked(const QUrl &arg1)
{
}
How can I set a lineEdit to the link text? I can't figure it out.
If I'm understanding you correctly, you have a link like the following ...
bar
.. and you want to get the value "bar." If that's what you are trying to do, you can't from that method. A few options, depending on how much control you have over the page:
Embed the text of the hyperlink into the URL and extract it. Something like: bar
If you are generating these links yourself, and there is a one-to-one relationship between URL and text, set up a map from url to text and look up the text in the map.
Related
I'm wanting to create a variable to grab the username from a landing page (assuming it's possible). In my attached examples, I'd like to grab the text "Landing_page_test".
I'm just learning CSS so I'm not able to single out just that text.
Any thoughts/suggestions would be much appreciated! enter image description here
Console
Elements Pane of Landing Page
document.querySelector returns an element, not the text. Add .innerText
Try it out on this page: document.querySelector("a.question-hyperlink").innerText to get the name of the question.
But you probably don't want to do it as custom html tag. You probably want to do it on click. in that case, you have {{Clicked Element}} variable in GTM, of which you can also get .innerText, or get its .parentElement and further navigate DOM from the clicked element as you wish and get whatever you need.
Here's the html of the Location & Date/Time text blocks
Text Block
So we currently have Jira in our workplace and no Jira Administrator. I'm feeling up to the task and would like to know if Jira has the functionality I'm looking for.
So when you have comments in Jira or even in the body of a Jira ticket. You can italicize the text from the comment ribbon
As you can see I am interested in being able to have the same functionality as bold or italicize or underline
but I want to be able to highlight some code that i insert in a ticket comment and click a button and make it into a code block. Or add curly brackets and make it a quote... Exactly like how StackOverflow does it.
Anyone know how I can accomplish this?
This is quite old question but it might help someone else looking for an answer later...
If you're familiar with JavaScript, simply inject a button via JS onto the toolbar. I've done this for a couple of custom fields. Such JS can be included in the custom field's description.
Example
In my case, I've added two buttons on two custom fields to copy original content from Summary/Description. You can adjust the code to do a whatever action on any custom field or comment field.
Screenshot
Code
Code to be included in the custom field's description. Adjust your code to place the JS into appropriate elements.
<script>
var cfAltDescription = 14705;
var elAltDescription = AJS.$("#customfield_" + cfAltDescription);
function addDescriptionButton() {
var buttonHTML = ' <button type="button" class="aui-button" style="font-size: 11px;padding: 1px 5px;" title="Paste original description into this field" onclick="copyDescription()">< Description</button>';
AJS.$(".jira-wikifield[field-id=customfield_" + cfAltDescription + "] ~ .wiki-button-bar").append(buttonHTML);
}
function copyDescription() {
var origDescription = AJS.$("#description").attr("value");
elAltDescription.attr("value", origDescription);
// set focus in the input box after copying...
elAltDescription.focus()[0].setSelectionRange(0, 0);
elAltDescription.scrollTop(0);
}
addDescriptionButton();
</script>
For comments, you cannot inject JS into the custom field description (comments are not a custom field). You will need to include your JS either via Announcement Banner (this would be global JS for any Jira page). Alternatively, you can utilize simple yet powerful JsIncluder add-on to inject your own JS code only for certain project/issuetype or globally and/or for edit/transition screens only.
I think you can use plugin for this. jeditor plugin gives you more options in text editors. all information you need is provided in above link.after installing this plugin you can change the text renderer as "JEditor Renderer".
Marketplace: https://marketplace.atlassian.com/plugins/com.jiraeditor.jeditor
or you can use.....
Note:-I guess this is not the exact answer you need but I think you can use macros inside the comment field. ex:if you want to add panel in inside of comment you can simply use
{panel}Some text{panel}
{panel:title=My Title}Some text with a title{panel}
{panel:title=My Title| borderStyle=dashed| borderColor=#ccc| titleBGColor=#F7D6C1| bgColor=#FFFFCE}
a block of text surrounded with a *panel*
yet _another_ line
{panel}
and if you want to add code you can use...
--- Java example ---
{code:title=Bar.java|borderStyle=solid}
// Some comments here
public String getFoo()
{
return foo;
}
{code}
*--- XML example ---*
{code:xml}
<test>
<another tag="attribute"/>
</test>
{code}
here is a example screenshot..
follow this link for more information..
UPDATE
with the plugin you can get something like this..I think this will helps you.
I’d like to be able to add a LOCK / UNLOCK behaviour on the checkbox using twitter bootstrap. I found a similar sample at boostrap-switch.org at the section of Label Text. In this example they have used ON-TV-OFF, Similarly I want to give my own text in the place of ON, OFF. Like UNLOCK-Username-LOCK.
LOCK should be disappeared by clicking on UNLOCK then output should be like XXX-LOCK
UNLOCK should be disappeared by click on ON text then output should be like UNLOCK-XXX
How can I do this with bootstrap?
It's a Github repository. Go to /build/js and in the bootstrap-switch.js change the string in the following:
html = "ON";
It's the line 35 of the js file.
Similarly change the string in:
html = "OFF";
i.e. line 47.
This might not be exact same thing as boostrap-switch.org, but I have done it using fadeTo() property of jquery.
Here is the jsfiddle output link.
I have a Grid, which have a TopToolbar and BottomToolbar. In the BottomToolbar, I added a CSVDataExporter:
CSVDataExporter csvDataExporter = new CSVDataExporter();
csvDataExporter.setDataFormatNameModel(new ResourceModel("csv.export.link.name"));
csvDataExporter.setDelimiter('|');
addBottomToolbar(new ExportToolbar(this).addDataExporter(csvDataExporter));
I have the link, so I can export the table to CSV fine!
BUT! How could I change the CSV export link to be a Button, but do the same and be at the same place as it was? Thank you!
The Link is generated by your ExportToolbar using the createExportLink method. To generate something else (as in any other component) you can extend the ExportToolbar to override this method. If this is the only place where you need this functionality, you can do so by implementing an anonymous inner class.
Generally you'll want this method to return a Component that has it's own markup, like a Panel, that contains whatever you want to display as your Exportlink or -button.
I have a QLineEdit, on which I have set a QRegExpValidator, that allows the user to input only one whitespace between words.
Now I want that whenever the user tries to enter more than one whitespaces, the tooltip of the QLineEdit should show up, but I'm not getting any method to implement it.
Thanx :)
It seems there is no direct method to perform what you want. One way to do above is to handle QLineEdit's textChanged() signal. Then you can check that string against your regular expression using QRegExp::exactMatch() function and if it don't match then show tooltip.
Connect the signal..
...
connect(ui->lineEdit,SIGNAL(textChanged(QString)),this,SLOT(onTextChanged(QString)));
...
Here your slot goes..
void MainWindow::onTextChanged(QString text)
{
QRegExp regExp;
regExp.setPattern("[^0-9]*"); // For example I have taken simpler regex..
if(regExp.exactMatch(text))
{
m_correctText = text; // Correct text so far..
QToolTip::hideText();
}
else
{
QPoint point = QPoint(geometry().left() + ui->lineEdit->geometry().left(),
geometry().top() + ui->lineEdit->geometry().bottom());
ui->lineEdit->setText(m_correctText); // Reset previous text..
QToolTip::showText(point,"Cannot enter number..");
}
}
I don't remember explicit API for showing a tooltip. I'm afraid you'll have to go with popping up a custom tool window (i.e. a parent-less QWidget) to achieve the desired result.
If you want to style your own popup window like a standard tooltip, QStyle should have something for that. If in doubt, read into the Qt source code where it renders the tooltip. That'll tell you which style elements to use.