mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-30 05:12:40 +00:00
GuiWorkArea: #undef QT3_SUPPORT
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14649 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
1a08a29b0f
commit
f01c7f5983
@ -9,6 +9,8 @@
|
|||||||
* Full author contact details are available in file CREDITS.
|
* Full author contact details are available in file CREDITS.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#undef QT3_SUPPORT
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
|
|
||||||
@ -55,7 +57,7 @@ namespace os = lyx::support::os;
|
|||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
/// return the LyX key state from Qt's
|
/// return the LyX key state from Qt's
|
||||||
key_modifier::state q_key_state(Qt::ButtonState state)
|
key_modifier::state q_key_state(Qt::KeyboardModifiers state)
|
||||||
{
|
{
|
||||||
key_modifier::state k = key_modifier::none;
|
key_modifier::state k = key_modifier::none;
|
||||||
if (state & Qt::ControlModifier)
|
if (state & Qt::ControlModifier)
|
||||||
@ -69,7 +71,7 @@ key_modifier::state q_key_state(Qt::ButtonState state)
|
|||||||
|
|
||||||
|
|
||||||
/// return the LyX mouse button state from Qt's
|
/// return the LyX mouse button state from Qt's
|
||||||
mouse_button::state q_button_state(Qt::ButtonState button)
|
mouse_button::state q_button_state(Qt::MouseButton button)
|
||||||
{
|
{
|
||||||
mouse_button::state b = mouse_button::none;
|
mouse_button::state b = mouse_button::none;
|
||||||
switch (button) {
|
switch (button) {
|
||||||
@ -90,7 +92,7 @@ mouse_button::state q_button_state(Qt::ButtonState button)
|
|||||||
|
|
||||||
|
|
||||||
/// return the LyX mouse button state from Qt's
|
/// return the LyX mouse button state from Qt's
|
||||||
mouse_button::state q_motion_state(Qt::ButtonState state)
|
mouse_button::state q_motion_state(Qt::MouseButton state)
|
||||||
{
|
{
|
||||||
mouse_button::state b = mouse_button::none;
|
mouse_button::state b = mouse_button::none;
|
||||||
if (state & Qt::LeftButton)
|
if (state & Qt::LeftButton)
|
||||||
@ -167,7 +169,8 @@ GuiWorkArea::GuiWorkArea(int w, int h, QWidget * parent, BufferView * buffer_vie
|
|||||||
lyxerr[Debug::GUI] << "ERROR: keyeventTimeout cannot connect!" << endl;
|
lyxerr[Debug::GUI] << "ERROR: keyeventTimeout cannot connect!" << endl;
|
||||||
|
|
||||||
// Start the timer, one-shot.
|
// Start the timer, one-shot.
|
||||||
step_timer_.start(50, true);
|
step_timer_.setSingleShot(true);
|
||||||
|
step_timer_.start(50);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Enables input methods for asian languages.
|
// Enables input methods for asian languages.
|
||||||
@ -188,7 +191,7 @@ void GuiWorkArea::setScrollbarParams(int h, int scroll_pos, int scroll_line_step
|
|||||||
|
|
||||||
verticalScrollBar()->setRange(0, scroll_max_);
|
verticalScrollBar()->setRange(0, scroll_max_);
|
||||||
verticalScrollBar()->setSliderPosition(scroll_pos);
|
verticalScrollBar()->setSliderPosition(scroll_pos);
|
||||||
verticalScrollBar()->setLineStep(scroll_line_step);
|
verticalScrollBar()->setSingleStep(scroll_line_step);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -265,7 +268,7 @@ void GuiWorkArea::mouseReleaseEvent(QMouseEvent * e)
|
|||||||
void GuiWorkArea::mouseMoveEvent(QMouseEvent * e)
|
void GuiWorkArea::mouseMoveEvent(QMouseEvent * e)
|
||||||
{
|
{
|
||||||
FuncRequest cmd(LFUN_MOUSE_MOTION, e->x(), e->y(),
|
FuncRequest cmd(LFUN_MOUSE_MOTION, e->x(), e->y(),
|
||||||
q_motion_state(e->state()));
|
q_motion_state(e->button()));
|
||||||
|
|
||||||
// If we're above or below the work area...
|
// If we're above or below the work area...
|
||||||
if (e->y() <= 20 || e->y() >= viewport()->height() - 20) {
|
if (e->y() <= 20 || e->y() >= viewport()->height() - 20) {
|
||||||
@ -329,7 +332,7 @@ void GuiWorkArea::wheelEvent(QWheelEvent * e)
|
|||||||
// documentation of QWheelEvent)
|
// documentation of QWheelEvent)
|
||||||
int const lines = qApp->wheelScrollLines() * e->delta() / 120;
|
int const lines = qApp->wheelScrollLines() * e->delta() / 120;
|
||||||
verticalScrollBar()->setValue(verticalScrollBar()->value() -
|
verticalScrollBar()->setValue(verticalScrollBar()->value() -
|
||||||
lines * verticalScrollBar()->lineStep());
|
lines * verticalScrollBar()->singleStep());
|
||||||
adjustViewWithScrollBar();
|
adjustViewWithScrollBar();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -357,7 +360,7 @@ void GuiWorkArea::keyPressEvent(QKeyEvent * e)
|
|||||||
{
|
{
|
||||||
lyxerr[Debug::KEY] << BOOST_CURRENT_FUNCTION
|
lyxerr[Debug::KEY] << BOOST_CURRENT_FUNCTION
|
||||||
<< " count=" << e->count()
|
<< " count=" << e->count()
|
||||||
<< " text=" << (const char *) e->text()
|
<< " text=" << fromqstr(e->text())
|
||||||
<< " isAutoRepeat=" << e->isAutoRepeat()
|
<< " isAutoRepeat=" << e->isAutoRepeat()
|
||||||
<< " key=" << e->key()
|
<< " key=" << e->key()
|
||||||
<< endl;
|
<< endl;
|
||||||
@ -368,7 +371,7 @@ void GuiWorkArea::keyPressEvent(QKeyEvent * e)
|
|||||||
else {
|
else {
|
||||||
boost::shared_ptr<QLyXKeySym> sym(new QLyXKeySym);
|
boost::shared_ptr<QLyXKeySym> sym(new QLyXKeySym);
|
||||||
sym->set(e);
|
sym->set(e);
|
||||||
processKeySym(sym, q_key_state(e->state()));
|
processKeySym(sym, q_key_state(e->modifiers()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -393,19 +396,20 @@ void GuiWorkArea::keyeventTimeout()
|
|||||||
|
|
||||||
lyxerr[Debug::GUI] << BOOST_CURRENT_FUNCTION
|
lyxerr[Debug::GUI] << BOOST_CURRENT_FUNCTION
|
||||||
<< " count=" << ev->count()
|
<< " count=" << ev->count()
|
||||||
<< " text=" << (const char *) ev->text()
|
<< " text=" << fromqstr(ev->text())
|
||||||
<< " isAutoRepeat=" << ev->isAutoRepeat()
|
<< " isAutoRepeat=" << ev->isAutoRepeat()
|
||||||
<< " key=" << ev->key()
|
<< " key=" << ev->key()
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
processKeySym(sym, q_key_state(ev->state()));
|
processKeySym(sym, q_key_state(ev->modifiers()));
|
||||||
keyeventQueue_.pop();
|
keyeventQueue_.pop();
|
||||||
|
|
||||||
handle_autos = false;
|
handle_autos = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Restart the timer.
|
// Restart the timer.
|
||||||
step_timer_.start(25, true);
|
step_timer_.setSingleShot(true);
|
||||||
|
step_timer_.start(25);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -600,8 +604,8 @@ void GuiWorkArea::inputMethodEvent(QInputMethodEvent * e)
|
|||||||
if (!text.isEmpty()) {
|
if (!text.isEmpty()) {
|
||||||
|
|
||||||
lyxerr[Debug::KEY] << BOOST_CURRENT_FUNCTION
|
lyxerr[Debug::KEY] << BOOST_CURRENT_FUNCTION
|
||||||
<< " preeditString =" << (const char *) e->preeditString()
|
<< " preeditString =" << fromqstr(e->preeditString())
|
||||||
<< " commitString =" << (const char *) e->commitString()
|
<< " commitString =" << fromqstr(e->commitString())
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
int key = 0;
|
int key = 0;
|
||||||
@ -609,7 +613,7 @@ void GuiWorkArea::inputMethodEvent(QInputMethodEvent * e)
|
|||||||
// ideally, such special coding should not be necessary
|
// ideally, such special coding should not be necessary
|
||||||
if (text == "^")
|
if (text == "^")
|
||||||
key = Qt::Key_AsciiCircum;
|
key = Qt::Key_AsciiCircum;
|
||||||
QKeyEvent ev(QEvent::KeyPress, key, *text.ascii(), 0, text);
|
QKeyEvent ev(QEvent::KeyPress, key, 0, text);
|
||||||
keyPressEvent(&ev);
|
keyPressEvent(&ev);
|
||||||
}
|
}
|
||||||
e->accept();
|
e->accept();
|
||||||
|
@ -54,7 +54,7 @@ class double_click {
|
|||||||
public:
|
public:
|
||||||
int x;
|
int x;
|
||||||
int y;
|
int y;
|
||||||
Qt::ButtonState state;
|
Qt::MouseButton state;
|
||||||
bool active;
|
bool active;
|
||||||
|
|
||||||
bool operator==(QMouseEvent const & e) {
|
bool operator==(QMouseEvent const & e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user