54 lines
1.7 KiB
C
54 lines
1.7 KiB
C
|
/*****************************************************************
|
|||
|
* @file FocusWindow.h
|
|||
|
* @brief <EFBFBD><EFBFBD>qt<EFBFBD><EFBFBD><EFBFBD>役<EFBFBD><EFBFBD><EFBFBD>ܹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>࣬<EFBFBD>ڲ<EFBFBD>ʵ<EFBFBD><EFBFBD>ȫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>androidԴ<EFBFBD>뽹<EFBFBD><EFBFBD><EFBFBD>ƶ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>֡<EFBFBD>
|
|||
|
* <EFBFBD><EFBFBD>ʹ<EFBFBD>õ<EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>̳<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>༴<EFBFBD>ɲ<EFBFBD><EFBFBD><EFBFBD>дgetAllFocusabelWidget<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
* @author luoxiang
|
|||
|
* @date May 23 2024
|
|||
|
****************************************************************/
|
|||
|
#include <qwidget.h>
|
|||
|
#ifndef FOCUS_WINDOW_H
|
|||
|
#define FOCUS_WINDOW_H
|
|||
|
|
|||
|
namespace FW
|
|||
|
{
|
|||
|
class FocusWindow
|
|||
|
{
|
|||
|
public:
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ƶ<EFBFBD><C6B6><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
enum Direction
|
|||
|
{
|
|||
|
Up,
|
|||
|
Down,
|
|||
|
Left,
|
|||
|
Right
|
|||
|
};
|
|||
|
void focusNext(Direction direction);
|
|||
|
|
|||
|
protected:
|
|||
|
// <20><><EFBFBD>麯<EFBFBD><E9BAAF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD>Ի<EFBFBD>ȡ<EFBFBD><C8A1>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>п<EFBFBD><D0BF>Ի<EFBFBD><D4BB>ý<EFBFBD><C3BD><EFBFBD><EFBFBD>Ŀؼ<C4BF><D8BC><EFBFBD>
|
|||
|
virtual QList<QWidget*> getAllFocusabelWidget() = 0;
|
|||
|
|
|||
|
private:
|
|||
|
QList<QWidget*> focusableList;
|
|||
|
|
|||
|
private:
|
|||
|
// <20>뽹<EFBFBD><EBBDB9><EFBFBD>ƶ<EFBFBD><C6B6><EFBFBD><EFBFBD>صĺ<D8B5><C4BA><EFBFBD>
|
|||
|
QWidget* getNextFocusWidget(Direction direction);
|
|||
|
bool isCandidate(QRect focused, QRect focusable, Direction direction);
|
|||
|
bool isBetterCandidate(Direction direction, QRect focused, QRect focusable, QRect curCandidate);
|
|||
|
bool beamBeats(Direction dircetion, QRect source, QRect rect1, QRect rect2);
|
|||
|
bool beamsOverlap(Direction direction, QRect rect1, QRect rect2);
|
|||
|
bool isToDirectionOf(Direction direction, QRect source, QRect dest);
|
|||
|
int majorAxisDistance(Direction direction, QRect source, QRect dest);
|
|||
|
int majorAxisDistanceRaw(Direction direction, QRect source, QRect dest);
|
|||
|
int minorAxisDistance(Direction direction, QRect source, QRect dest);
|
|||
|
int getWeightDistanceFor(int majorAxisDistance, int minorAxisDistance);
|
|||
|
int majorAxisDistanceToFarEdge(Direction dircetion, QRect source, QRect dest);
|
|||
|
int majorAxisDistanceToFarEdgeRaw(Direction dircetion, QRect source, QRect dest);
|
|||
|
};
|
|||
|
}
|
|||
|
|
|||
|
#endif // !FOCUS_WINDOW_H
|
|||
|
|
|||
|
|