diff --git a/src/frontends/qt4/QLToolbar.C b/src/frontends/qt4/QLToolbar.C index f1d10affe3..bdce817097 100644 --- a/src/frontends/qt4/QLToolbar.C +++ b/src/frontends/qt4/QLToolbar.C @@ -12,6 +12,8 @@ * Full author contact details are available in file CREDITS. */ +#undef QT3_SUPPORT + #include #include "buffer.h" @@ -47,6 +49,7 @@ LyXTextClass const & getTextClass(LyXView const & lv) return lv.buffer()->params().getLyXTextClass(); } +/* /// \todo Remove Qt::Dock getPosition(ToolbarBackend::Flags const & flags) if not needed anymore Qt::Dock getPosition(ToolbarBackend::Flags const & flags) { @@ -60,6 +63,7 @@ Qt::Dock getPosition(ToolbarBackend::Flags const & flags) return Qt::DockRight; return Qt::DockTop; } +*/ Qt::ToolBarArea getToolBarPosition(ToolbarBackend::Flags const & flags) { @@ -101,7 +105,7 @@ void QLayoutBox::set(string const & layout) int i = 0; for (; i < combo_->count(); ++i) { - if (name == combo_->text(i)) + if (name == combo_->itemText(i)) break; } @@ -111,7 +115,7 @@ void QLayoutBox::set(string const & layout) return; } - combo_->setCurrentItem(i); + combo_->setCurrentIndex(i); } @@ -128,7 +132,7 @@ void QLayoutBox::update() for (; it != end; ++it) { // ignore obsolete entries if ((*it)->obsoleted_by().empty()) - combo_->insertItem(qt_((*it)->name())); + combo_->addItem(qt_((*it)->name())); } // needed to recalculate size hint @@ -149,7 +153,7 @@ void QLayoutBox::clear() void QLayoutBox::open() { - combo_->popup(); + combo_->showPopup(); } diff --git a/src/frontends/qt4/QtView.C b/src/frontends/qt4/QtView.C index c79383356a..b6e7af0ec8 100644 --- a/src/frontends/qt4/QtView.C +++ b/src/frontends/qt4/QtView.C @@ -10,6 +10,8 @@ * Full author contact details are available in file CREDITS. */ +#undef QT3_SUPPORT + #include #include "BufferView.h" @@ -43,8 +45,8 @@ #include #include #include -#include -#include +//#include +//#include #include "support/lstrings.h" @@ -73,7 +75,7 @@ QtView::QtView(unsigned int width, unsigned int height) { resize(width, height); - qApp->setMainWidget(this); + mainWidget_ = this; // setToolButtonStyle(Qt::ToolButtonIconOnly); // setIconSize(QSize(12,12)); @@ -95,7 +97,7 @@ QtView::QtView(unsigned int width, unsigned int height) // since the icon is provided in the application bundle. string const iconname = libFileSearch("images", "lyx", "xpm"); if (!iconname.empty()) - setIcon(QPixmap(toqstr(iconname))); + setWindowIcon(QPixmap(toqstr(iconname))); #endif // make sure the buttons are disabled if needed @@ -129,7 +131,7 @@ void QtView::addCommandBuffer(QToolBar * toolbar) void QtView::message(string const & str) { - statusBar()->message(toqstr(str)); + statusBar()->showMessage(toqstr(str)); statusbar_timer_.stop(); statusbar_timer_.start(statusbar_timer_value); } @@ -150,7 +152,7 @@ void QtView::focus_command_widget() void QtView::update_view_state_qt() { - statusBar()->message(toqstr(getLyXFunc().viewStatusMessage())); + statusBar()->showMessage(toqstr(getLyXFunc().viewStatusMessage())); statusbar_timer_.stop(); } @@ -161,7 +163,7 @@ void QtView::update_view_state() if (statusbar_timer_.isActive()) return; - statusBar()->message(toqstr(getLyXFunc().viewStatusMessage())); + statusBar()->showMessage(toqstr(getLyXFunc().viewStatusMessage())); } @@ -194,7 +196,7 @@ void QtView::closeEvent(QCloseEvent *) void QtView::show() { - setCaption(qt_("LyX")); + QMainWindow::setWindowTitle(qt_("LyX")); QMainWindow::show(); } @@ -202,11 +204,19 @@ void QtView::show() void QtView::busy(bool yes) const { if (yes) - QApplication::setOverrideCursor(Qt::waitCursor); + QApplication::setOverrideCursor(Qt::WaitCursor); else QApplication::restoreOverrideCursor(); } +QMainWindow* QtView::mainWidget() +{ + return mainWidget_; +} + +QMainWindow* QtView::mainWidget_ = 0; + + } // namespace frontend } // namespace lyx diff --git a/src/frontends/qt4/QtView.h b/src/frontends/qt4/QtView.h index 99d45044da..937629dd7e 100644 --- a/src/frontends/qt4/QtView.h +++ b/src/frontends/qt4/QtView.h @@ -36,6 +36,7 @@ namespace frontend { class QCommandBuffer; +QWidget* mainWindow(); /** * QtView - Qt implementation of LyXView @@ -71,6 +72,8 @@ public: // returns true if this view has the focus. virtual bool hasFocus() const; + static QMainWindow* mainWidget(); + public slots: /// idle timeout void update_view_state_qt(); @@ -99,6 +102,9 @@ private: /// command buffer QCommandBuffer * commandbuffer_; + + /// + static QMainWindow* mainWidget_; }; } // namespace frontend