TextOutputI::TextOutputI(const std::string& name, QWidget *parent) : QMainWindow(parent) { Logos logos; QPixmap myPic; myPic.loadFromData(logos.gistLogo, logos.gistLogoSize); setWindowIcon(myPic); QFont font; QString fontFamily("Courier"); font.setFamily(fontFamily); font.setFixedPitch(true); font.setPointSize(12); editor = new QTextEdit; editor->setFont(font); editor->setReadOnly(true); editor->setLineWrapMode(QTextEdit::FixedColumnWidth); editor->setLineWrapColumnOrWidth(80); os = new GistOutputStream(editor); QAction* clearText = new QAction("Clear", this); clearText->setShortcut(QKeySequence("Ctrl+K")); this->addAction(clearText); connect(clearText, SIGNAL(triggered()), editor, SLOT(clear())); QAction* closeWindow = new QAction("Close window", this); closeWindow->setShortcut(QKeySequence("Ctrl+W")); this->addAction(closeWindow); connect(closeWindow, SIGNAL(triggered()), this, SLOT(close())); QToolBar* t = addToolBar("Tools"); t->setFloatable(false); t->setMovable(false); t->addAction(clearText); stayOnTop = new QAction("Stay on top", this); stayOnTop->setCheckable(true); t->addAction(stayOnTop); connect(stayOnTop, SIGNAL(changed()), this, SLOT(changeStayOnTop())); changeStayOnTop(); setCentralWidget(editor); setWindowTitle(QString((std::string("Gist Console: ") + name).c_str())); setAttribute(Qt::WA_QuitOnClose, false); setAttribute(Qt::WA_DeleteOnClose, false); resize(600,300); }
int Gecode::Gist::TextOutputI::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QMainWindow::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: changeStayOnTop(); break; default: ; } _id -= 1; } return _id; }