]> git.lyx.org Git - lyx.git/commitdiff
remove QT3_SUPPORT macro dependency by Peter Kummel (syntheticpp@gmx.net)
authorAbdelrazak Younes <younes@lyx.org>
Sun, 4 Jun 2006 20:49:09 +0000 (20:49 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Sun, 4 Jun 2006 20:49:09 +0000 (20:49 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13999 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/QLToolbar.C
src/frontends/qt4/QtView.C
src/frontends/qt4/QtView.h

index f1d10affe324ca256333e549564baaf694cd4e90..bdce817097a67ffa1c5b7592e6b1b9e5cc54e91c 100644 (file)
@@ -12,6 +12,8 @@
  * Full author contact details are available in file CREDITS.
  */
 
+#undef QT3_SUPPORT
+
 #include <config.h>
 
 #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();
 }
 
 
index c79383356ab49f50279cd2a5e34b28bc805dce05..b6e7af0ec871441389abc577a0606187c5c89cf0 100644 (file)
@@ -10,6 +10,8 @@
  * Full author contact details are available in file CREDITS.
  */
 
+#undef QT3_SUPPORT
+
 #include <config.h>
 
 #include "BufferView.h"
@@ -43,8 +45,8 @@
 #include <QToolBar>
 #include <QCloseEvent>
 #include <QAction>
-#include <QMenu>
-#include <QMenuBar>
+//#include <QMenu>
+//#include <QMenuBar>
 
 #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
 
index 99d45044dacd1883639918051994da29b675f359..937629dd7e77122031b73dbc0ea28c81af13486a 100644 (file)
@@ -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