Commit c25dd394 authored by Christoffer Ackelman's avatar Christoffer Ackelman

QT: Cleaned up rt_xtt_cmd.

parent 8f9c3183
...@@ -52,12 +52,12 @@ ...@@ -52,12 +52,12 @@
#include <QApplication> #include <QApplication>
#include <QMainWindow> #include <QMainWindow>
XttCmdQt::XttCmdQt(QWidget* w) XttCmdQt::XttCmdQt()
{ {
pwr_tStatus sts; pwr_tStatus sts;
pwr_tOName opplace = ""; pwr_tOName opplace = "";
xnav = new XNavQt(this, w, "Plant", &brow_widget, (xnav_sStartMenu*)root_menu, xnav = new XNavQt(this, NULL, "Plant", &brow_widget, (xnav_sStartMenu*)root_menu,
opplace, 0, &sts); opplace, 0, &sts);
xnav->message_cb = &message_cb; xnav->message_cb = &message_cb;
...@@ -67,9 +67,7 @@ XttCmdQt::XttCmdQt(QWidget* w) ...@@ -67,9 +67,7 @@ XttCmdQt::XttCmdQt(QWidget* w)
static int timeout_func() static int timeout_func()
{ {
while (QApplication::hasPendingEvents()) { QApplication::processEvents();
QApplication::processEvents();
}
return 1; return 1;
} }
...@@ -135,17 +133,13 @@ int main(int argc, char* argv[]) ...@@ -135,17 +133,13 @@ int main(int argc, char* argv[])
strcpy(title, "Xtt Cmd"); strcpy(title, "Xtt Cmd");
// Qt // Qt
QMainWindow* toplevel = new QMainWindow(); cmd = new XttCmdQt();
toplevel->setMinimumSize(400, 700); cmd->brow_widget->setMinimumSize(400, 700);
toplevel->setWindowTitle(fl(title)); cmd->brow_widget->setWindowTitle(fl(title));
toplevel->setAttribute(Qt::WA_DeleteOnClose); cmd->brow_widget->setAttribute(Qt::WA_DeleteOnClose);
cmd->brow_widget->show();
cmd = new XttCmdQt(toplevel);
toplevel->setCentralWidget(cmd->brow_widget);
toplevel->show();
if (hide) { if (hide) {
toplevel->setVisible(false); cmd->brow_widget->setVisible(false);
} }
if (!quiet) { if (!quiet) {
...@@ -195,8 +189,6 @@ GNU General Public License for more details.\n\n"; ...@@ -195,8 +189,6 @@ GNU General Public License for more details.\n\n";
str_trim(str, str); str_trim(str, str);
sts = cmd->xnav->command(str); sts = cmd->xnav->command(str);
while (QApplication::hasPendingEvents()) { QApplication::processEvents();
QApplication::processEvents();
}
} }
} }
\ No newline at end of file
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
class XttCmdQt : public XttCmd { class XttCmdQt : public XttCmd {
public: public:
XttCmdQt(QWidget* w); XttCmdQt();
QWidget* brow_widget; QWidget* brow_widget;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment