Fix a signal name consistency issue for qt5
This commit is contained in:
parent
40c07f28d2
commit
295f763189
9 changed files with 41 additions and 19 deletions
|
@ -16,6 +16,7 @@
|
|||
*/
|
||||
#ifndef _ADVSEARCH_W_H_INCLUDED_
|
||||
#define _ADVSEARCH_W_H_INCLUDED_
|
||||
#include "autoconfig.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
*/
|
||||
#ifndef _ADVSHIST_H_INCLUDED_
|
||||
#define _ADVSHIST_H_INCLUDED_
|
||||
#include "autoconfig.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
*/
|
||||
#ifndef _confgui_h_included_
|
||||
#define _confgui_h_included_
|
||||
#include "autoconfig.h"
|
||||
|
||||
/**
|
||||
* This file defines a number of simple classes (virtual base: ConfParamW)
|
||||
* which let the user input configuration parameters.
|
||||
|
@ -36,7 +38,6 @@
|
|||
* destroyed and recreated as a copy if Cancel is pressed (you have to
|
||||
* delete/recreate the widgets in this case as the links are no longer valid).
|
||||
*/
|
||||
#include "autoconfig.h"
|
||||
|
||||
#include <string>
|
||||
#include <limits.h>
|
||||
|
|
|
@ -67,6 +67,20 @@
|
|||
#include "rclhelp.h"
|
||||
#include "moc_rclmain_w.cpp"
|
||||
|
||||
/* Qt5 moc expands macros when defining signals. The SIGNAL() macro is
|
||||
a stringification, so it does not expand macros. We have signals
|
||||
where one of the types is a #define (for the variations on
|
||||
std::shared_ptr). In qt5, the connection does not work because the
|
||||
signal string is different between the definition and the connect
|
||||
call, because of the different macro expansion. We have to use
|
||||
another level of macro in Qt5 to force macro expansion, but not in
|
||||
Qt4, so we both define the XSIGNAL and XSLOT macros here, and have
|
||||
ifdefs in the code. What a mess... */
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
|
||||
#define XSIGNAL(X) SIGNAL(X)
|
||||
#define XSLOT(X) SLOT(X)
|
||||
#endif
|
||||
|
||||
using std::pair;
|
||||
|
||||
QString g_stringAllStem, g_stringNoStem;
|
||||
|
@ -288,13 +302,15 @@ void RclMain::init()
|
|||
sc = new QShortcut(seql, this);
|
||||
connect(sc, SIGNAL (activated()), sSearch, SLOT (takeFocus()));
|
||||
|
||||
connect(&m_watcher, SIGNAL(fileChanged(QString)),
|
||||
this, SLOT(idxStatus()));
|
||||
#ifdef _WIN32
|
||||
connect(sSearch, SIGNAL(startSearch(std::shared_ptr<Rcl::SearchData>, bool)),
|
||||
this, SLOT(startSearch(std::shared_ptr<Rcl::SearchData>, bool)));
|
||||
connect(&m_watcher, SIGNAL(fileChanged(QString)), this, SLOT(idxStatus()));
|
||||
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
|
||||
connect(sSearch,
|
||||
XSIGNAL(startSearch(STD_SHARED_PTR<Rcl::SearchData>, bool)),
|
||||
this, XSLOT(startSearch(STD_SHARED_PTR<Rcl::SearchData>, bool)));
|
||||
#else
|
||||
connect(sSearch, SIGNAL(startSearch(STD_SHARED_PTR<Rcl::SearchData>, bool)),
|
||||
connect(sSearch,
|
||||
SIGNAL(startSearch(STD_SHARED_PTR<Rcl::SearchData>, bool)),
|
||||
this, SLOT(startSearch(STD_SHARED_PTR<Rcl::SearchData>, bool)));
|
||||
#endif
|
||||
connect(sSearch, SIGNAL(clearSearch()),
|
||||
|
@ -357,9 +373,9 @@ void RclMain::init()
|
|||
restable->setRclMain(this, true);
|
||||
connect(actionSaveResultsAsCSV, SIGNAL(triggered()),
|
||||
restable, SLOT(saveAsCSV()));
|
||||
#ifdef _WIN32
|
||||
connect(this, SIGNAL(docSourceChanged(std::shared_ptr<DocSequence>)),
|
||||
restable, SLOT(setDocSource(std::shared_ptr<DocSequence>)));
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
|
||||
connect(this, XSIGNAL(docSourceChanged(STD_SHARED_PTR<DocSequence>)),
|
||||
restable, XSLOT(setDocSource(STD_SHARED_PTR<DocSequence>)));
|
||||
#else
|
||||
connect(this, SIGNAL(docSourceChanged(STD_SHARED_PTR<DocSequence>)),
|
||||
restable, SLOT(setDocSource(STD_SHARED_PTR<DocSequence>)));
|
||||
|
@ -393,9 +409,9 @@ void RclMain::init()
|
|||
this, SLOT(showSnippets(Rcl::Doc)));
|
||||
|
||||
reslist->setRclMain(this, true);
|
||||
#ifdef _WIN32
|
||||
connect(this, SIGNAL(docSourceChanged(std::shared_ptr<DocSequence>)),
|
||||
reslist, SLOT(setDocSource(std::shared_ptr<DocSequence>)));
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
|
||||
connect(this, XSIGNAL(docSourceChanged(STD_SHARED_PTR<DocSequence>)),
|
||||
reslist, XSLOT(setDocSource(STD_SHARED_PTR<DocSequence>)));
|
||||
#else
|
||||
connect(this, SIGNAL(docSourceChanged(STD_SHARED_PTR<DocSequence>)),
|
||||
reslist, SLOT(setDocSource(STD_SHARED_PTR<DocSequence>)));
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
*/
|
||||
#ifndef RCLMAIN_W_H
|
||||
#define RCLMAIN_W_H
|
||||
#include "autoconfig.h"
|
||||
|
||||
#include <qvariant.h>
|
||||
#include <qmainwindow.h>
|
||||
|
|
|
@ -17,15 +17,11 @@
|
|||
|
||||
#ifndef _RESLIST_H_INCLUDED_
|
||||
#define _RESLIST_H_INCLUDED_
|
||||
#include "autoconfig.h"
|
||||
|
||||
#include <list>
|
||||
#include <utility>
|
||||
|
||||
#ifndef NO_NAMESPACES
|
||||
using std::list;
|
||||
using std::pair;
|
||||
#endif
|
||||
|
||||
#ifdef RESLIST_TEXTBROWSER
|
||||
#include <QTextBrowser>
|
||||
#define RESLIST_PARENTCLASS QTextBrowser
|
||||
|
@ -133,7 +129,7 @@ class ResList : public RESLIST_PARENTCLASS
|
|||
// docnum. Built while we insert text into the qtextedit
|
||||
std::map<int,int> m_pageParaToReldocnums;
|
||||
virtual int docnumfromparnum(int);
|
||||
virtual pair<int,int> parnumfromdocnum(int);
|
||||
virtual std::pair<int,int> parnumfromdocnum(int);
|
||||
#else
|
||||
// Webview makes it more difficult to append text incrementally,
|
||||
// so we store the page and display it when done.
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
*/
|
||||
#ifndef _RESPOPUP_H_INCLUDED_
|
||||
#define _RESPOPUP_H_INCLUDED_
|
||||
#include "autoconfig.h"
|
||||
|
||||
namespace ResultPopup {
|
||||
enum Options {showExpand = 0x1, showSubs = 0x2, isMain = 0x3,
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
*/
|
||||
#ifndef _SSEARCH_W_H_INCLUDED_
|
||||
#define _SSEARCH_W_H_INCLUDED_
|
||||
#include "autoconfig.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
|
|
|
@ -14,6 +14,9 @@
|
|||
* Free Software Foundation, Inc.,
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#ifndef XMLTOSD_H_INCLUDED
|
||||
#define XMLTOSD_H_INCLUDED
|
||||
#include "autoconfig.h"
|
||||
|
||||
/** Parsing XML from saved queries or advanced search history.
|
||||
*
|
||||
|
@ -75,3 +78,4 @@ struct SSearchDef {
|
|||
int mode;
|
||||
};
|
||||
bool xmlToSSearch(const string& xml, SSearchDef&);
|
||||
#endif /* XMLTOSD_H_INCLUDED */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue