QHelpSearchEngine issue to show the QHelpSearchResultWidget data - qt

Hi Can any one explain me how the 'typed text' in QHelpSearchQueryWidget gets parsed and resulting HTML links gets displayed onto the QHelpSearchResultWidget.
i am using the QtHelpEngine for my application. The HTMLs as mentioned in .qhp , are showing in mi TOC and index tabs. BUT the search tab , where i included the QHelpSearchQueryWidget , and QHelpSearchResultWidget does not work.
i have tested the .qhc file in assistant , and , when i type like "all" in QHelpSearchQueryWidget it shows me the links in QHelpSearchResultWidget . But the same .qhc when used in code in my application does show show any result in QHelpSearchResultWidget.
This is the slot method i have written to , capture the entered text in QHelpSearchQueryWidget i.e "all" , and set this to QHelpSearchEngine.
and expecting the count >0 , and QHelpSearchResultWidget to be updated with related HTML links where the word "all" exists.
void CHelpSearchWidgetSample::slotSearch() const
{
QList<QHelpSearchQuery> queries = m_searchEngine->queryWidget()->query();
foreach (const QHelpSearchQuery &query, queries)
{
foreach (QString word, query.wordList)
qDebug()<<"word :"<<word; // (O/P : "all")
}
m_searchEngine->search(queries);
qDebug()<<"Hit cnt : "<<m_searchEngine->hitCount(); // O/P : Hit cnt :0
}
please guide me to solve this issue.

Related

Function for Google Sheets' Script editor with a button for TODAY(), and NOW() in two different columns of which are the next not blank in the column

Currently, I'm looking at some simple documentation for vague ways to make a 'button' (image) over a Google sheet to trigger a function on the script editor. I'm not familiar with this type of Syntax, I typically do AutoHotKey, and a bit of python.
All I want to do is have this button populate 2 columns. The current date in one, and the current time in the other (It doesn't even have to have its year or the seconds tbh). I don't know if it matters of what the pages name is based on how the script works. So the range is ( 'Log'!G4:H ).
Like if I were to make it for AutoHotkey I would put it as :
WinGet, winid ,, A ; <-- need to identify window A = active
MsgBox, winid=%winid%
;do some stuff
WinActivate ahk_id %winid%
So it affects any page it's active on.
I would like to use the same function on the same columns across different sheets. Ideally, that is. I don't care if I have to clone each a unique function based on the page, but I just can't even grasp this first step, lol.
I'm not too familiar with this new macro. If I use this macro does it only work for my client, because of say like it recording relative aspect ratio movements?
IE if I record a macro on my PC, and play it on my android. Will the change in the platform change its execution?
If anyone can point me in any direction as to any good documentation or resources for the Google Sheet Script Editor or its syntaxes I would really appreciate it.
EDIT: Just to clarify. Im really focused in on it being a function that populates from a click/press(mobile) of an image. I currently use an onEDIT on the sheet, and it wouldnt serve the purposes that I want for this function. Its just a shortcut to quickly input a timestamp, and those fields can still be retouched without it just reapplying a new function for a newer current time/date.
EDIT:EDIT: Ended up with a image button that runs a script that can only input to the current cell.
function timeStamp() {
SpreadsheetApp.getActiveSheet()
.getActiveCell()
.setValue(new Date());
}
It only works on the cell targeted.
I would like to force the input in the next availible cell in the column, and split the date from the time, and put them into cells adjacent from one another.
maybe this will help... if the 1st column is edited it will auto-print date in 2nd column and time in 3rd column on Sheet1:
function onEdit(e) {
var s = SpreadsheetApp.getActiveSheet();
if( s.getName() == "Sheet1" ) {
var r = s.getActiveCell();
if( r.getColumn() == 1 ) {
var nextCell = r.offset(0, 1);
var newDate = Utilities.formatDate(new Date(),
"GMT+8", "MM/dd/yyyy");
nextCell.setValue(newDate);
}
if( r.getColumn() == 1 ) {
var nextCell = r.offset(0, 2);
var newDate1 = Utilities.formatDate(new Date(),
"GMT+8", "hh:mm:ss");
nextCell.setValue(newDate1);
}}}
https://webapps.stackexchange.com/a/130253/186471

Check if WinList() contains a certain title

I am listing all open windows using WinList() to get window title and -handle in AutoIt.
I want to check if resulting array contains a specific title. What is the best way to do this? There is no WinList().Contains("TitleName") or something like that.
Local $aList = WinList() ;Gets a list of Window Titles and IDs
OK, I got it now:
For $i = 1 To $aList[0][0]
If $aList[$i][0] = "Title/String you search for" Then
MsgBox($MB_SYSTEMMODAL, "", "MessageBox shows this text if title is in list.")
EndIf
Next
You could also use something similar to what you wrote.
#include <Array.au3>
Opt("WinDetectHiddenText", 0) ;0=don't detect, 1=do detect
Opt("WinSearchChildren", 0) ;0=no, 1=search children also
Opt("WinTextMatchMode", 1) ;1=complete, 2=quick
Opt("WinTitleMatchMode", 1) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase
Local $title = 'AutoIt Help (v3.3.14.2)'
Local $aList = WinList()
;~ _ArrayDisplay($aList)
Local $iIndex = _ArraySearch($aList,$title)
WinActivate($aList[$iIndex][1], '')
Window exists?
"I am listing all open windows … I want to check if … contains a specific title. What is the best way to do this?"
As per Documentation - Function Reference - WinExists() :
Checks to see if a specified window exists.
Example.
Global Const $g_sWndTitle = 'Window title here'
If WinExists($g_sWndTitle) Then WinFlash($g_sWndTitle)
Retrieve window handle, -text and -title
Handle
"… to get window title and -handle …"
As per Documentation - Function Reference - WinGetHandle() :
Retrieves the internal handle of a window.
Example:
Global Const $g_sWndTitle = 'Window title here'
Global $g_hWnd
If WinExists($g_sWndTitle) Then
$g_hWnd = WinGetHandle($g_sWndTitle)
WinFlash($g_hWnd)
EndIf
Text
As per Documentation - Function Reference - WinGetText() :
Retrieves the text from a window.
Example:
Global Const $g_sWndTitle = 'Window title here'
If WinExists($g_sWndTitle) Then
WinFlash($g_sWndTitle)
ConsoleWrite(WinGetText($g_sWndTitle) & #CRLF)
EndIf
Title
Likewise, WinGetTitle().

Same value is getting displayed on Left and Right Hand Side of SysListPanel Form Ax 2012

I have used SysListPanel to display a form where we will have left panel and right panel. Whenever we double click on Right hand panel record it moves to left hand side and that value wont appear in right hand side. But I got an issue here. When I double click on RHS(right hand side) record it moved to LHS. I closed form and Opened it. I can be able to see same record in both LHS and RHS. Can someone please let me know how can I remove the value form RHS once its moved to LHS.
Also I would like to know where its getting decided to store RecId or Id in the relation table(table where data is stored when we move to LHS).?
Example of form UI I am talking about is in SysAdmin-UserGroups-UsersTab
Below is code in init of form
public void init()
{
#resAppl
#define.BPTeamName('Testdata')
;
callerRecord = element.args().record();
if(callerRecord.TableId == tableNum(CustTable))
{
select BPTeamMembCriterion where BPTeamMembCriterion.Name == #BPTeamName;
sysListPanel = SysListPanelRelationTable::newForm(element,
element.controlId(formControlStr(TableAlpha, ListPanelTabPage)),
'Selected text', 'Available text',#ImageUserGroup,
tableNum(TableAlpha),
fieldNum(TableAlpha, BPTeam),
fieldNum(TableAlpha, CustAccount),
tableNum(BPTeam),
fieldNum(BPTeam, RecId),
[fieldNum(BPTeam, Name),fieldNum(BPTeam, Description)],
fieldNum(BPTeam, TeamMemberCriterion),
BPTeamMembershipCriterion.RecId,
identifierStr(Validate),0,true,true);
}
super();
sysListPanel.init();
sysListPanel.parmRelationRangeValue(queryValue(callerRecord.RecId));
sysListPanel.fill();
}
TableAlpha
Fields:
Field1: BPteam
Field2 : CustAccount
Both above fields stores Recids

Silverstripe: partialMatchFilter and "&"

I have a client that wants to be able to pick several things off the Silverstripe tag cloud widget.
So, using jQuery, I prepare a string containing all the selected tags which I then pass to a Silverstripe function.
if($_GET["selectedTags"]){
$selectedTagString = $_GET["selectedTags"];
$selectedTagString = substr($selectedTagString, 0, strlen($selectedTagString) -1);
$tagArray = explode("|", $selectedTagString);
$blogEntries = DataObject::get("BlogEntry")->filter(array("Tags:PartialMatch" => $tagArray));
return $blogEntries->renderWith(array("blogSearchResults"));
}
}
And it works quite well.
EXCEPT for tags that have an "&" in them, like "Otago & Southland", where the search fails and nothing is retrieved.
Looking at the generated SQL, everything seems to be fine.
SELECT DISTINCT "SiteTree_Live"."ClassName", "SiteTree_Live"."Created",
.
.
.
"BlogEntry_Live"."BlogEntryThumbnailID", "SiteTree_Live"."ID", CASE WHEN "SiteTree_Live"."ClassName" IS NOT NULL THEN "SiteTree_Live"."ClassName" ELSE 'SiteTree' END AS "RecordClassName" FROM "SiteTree_Live" LEFT JOIN "Page_Live" ON "Page_Live"."ID" = "SiteTree_Live"."ID" LEFT JOIN "BlogEntry_Live" ON "BlogEntry_Live"."ID" = "SiteTree_Live"."ID" WHERE ("BlogEntry_Live"."Tags" LIKE '%southland & otago championships%') AND ("SiteTree_Live"."ClassName" IN ('BlogEntry')) ORDER BY "SiteTree_Live"."Sort" ASC
Has anyone had this problem before?
Are the tags stored using & in the db? Then you first should html encode your string.

OverbyteICS HTTPAsync example code : How to remove duplicated url's from listbox?

I started using Overbyte components , used to use Indy but blocking issue made me look for something else , so I found ICS , but in this example code:
HTTPAsync
It creates new HTTPCli component for every link inside listbox , but when I change code a bit:
procedure THttpAsyForm.HttpCli1DocData(Sender: TObject; Buffer: Pointer;
Len: Integer);
var
AHttpCli : THttpCli;
begin
if not DataCheckBox.Checked then
Exit;
AHttpCli := Sender as THttpCli;
{ Display a message stating that data is available }
DisplayMemo.Lines.Add('Item ' + IntToStr(AHttpCli.Tag) + ' Data');
{ We could display the data, but it use a huge space in the display }
DisplayMemo.Lines.Add(StrPas(Buffer));
if something then <--- CODE I ADDED
ListBox1.items.add(AHttpCli.URL); <--- CODE I ADDED
{ We could also store the data somewhere (with the help of OnDocBegin }
{ and OnDocEnd events. Or using the RcvdStream property. }
end;
When I put 10 links it sometimes adds duplicates to listbox , or with one link it adds two same links to listbox .
How can I fix it to not show duplicates.My idea was to put it inside tstringlist and check for duplicates and remove them.
Is there any other way.Thanks
You can check to see if it already exists before adding it:
if something then
if ListBox1.Items.IndexOf(AHttpCli.URL) = -1 then
ListBox1.items.add(AHttpCli.URL);

Resources