Skip to content

Commit

Permalink
pmquery: fix up issues relating to the qt6 port
Browse files Browse the repository at this point in the history
  • Loading branch information
natoscott committed Aug 16, 2023
1 parent 2931126 commit b060f50
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/pmquery/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <QCursor>
#include <QScreen>
#include <QTextStream>
#include <QGuiApplication>
#include <QApplication>
#include "pmquery.h"

static char usage[] =
Expand Down Expand Up @@ -108,7 +108,7 @@ int main(int argc, char ** argv)
int usesliderflag = 0;
int exclusiveflag = 0;

QGuiApplication a(argc, argv);
QApplication a(argc, argv);

while ((option = getoption(argc, argv)) != NULL) {
if (strcmp(option, "-c") == 0 || strcmp(option, "-center") == 0) {
Expand Down Expand Up @@ -276,7 +276,7 @@ int main(int argc, char ** argv)
if (!PmQuery::buttonCount())
PmQuery::addButton("Continue", true, 0);

PmQuery q(inputflag, printflag, noframeflag,
PmQuery q(a, inputflag, printflag, noframeflag,
nosliderflag, usesliderflag, exclusiveflag);

if (nearmouseflag)
Expand Down
5 changes: 3 additions & 2 deletions src/pmquery/pmquery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,10 @@ void PmQuery::timerEvent(QTimerEvent *)
// Note: the +4 pixels for height ensure the auto-scroll does not
// kick in, seems to be required.

PmQuery::PmQuery(bool inputflag, bool printflag, bool noframeflag,
PmQuery::PmQuery(QApplication &application,
bool inputflag, bool printflag, bool noframeflag,
bool nosliderflag, bool usesliderflag, bool exclusiveflag)
: QDialog()
: QDialog(application.activeWindow())
{
QHBoxLayout *hboxLayout;
QVBoxLayout *vboxLayout;
Expand Down
2 changes: 1 addition & 1 deletion src/pmquery/pmquery.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class PmQuery : public QDialog
{
Q_OBJECT
public:
PmQuery(bool inputflag, bool printflag, bool noframeflag,
PmQuery(QApplication&, bool inputflag, bool printflag, bool noframeflag,
bool nosliderflag, bool usesliderflag, bool exclusiveflag);
void setStatus(int status) { my.status = status; }

Expand Down

0 comments on commit b060f50

Please sign in to comment.