}
void SearchBarWidget::checkFocus(){
- qDebug()<<"focus:"<<QApplication::focusWidget();
if(focusWidget()!=QApplication::focusWidget())
emit focusOff();
}
QString tempString;
if(!preferedCompliter.isEmpty()){
int index = completerActualList.indexOf(preferedCompliter);
- qDebug()<<"index"<<index<<"size"<<completerActualList.size()<<"+1";
if(index!=-1 && completerActualList.size()>index+1){
preferedCompliter = completerActualList.at(index+1);
tempString=preferedCompliter;
QIcon SearchBarWidget::generateIcon(QIcon original, qreal rotation) {
- qDebug()<<"test2";
QPixmap p = original.pixmap(64);
if(rotation != 0) {
}
void SearchBarWidget::initializeUI() {
- qDebug()<<"test4";
#ifdef Q_WS_MAEMO_5
setMaximumHeight(150);
}
void SearchBarWidget::searchButtonClicked(QString text) {
- qDebug()<<"test5";
if(busy)
Q_EMIT stopSearching();
else
}
void SearchBarWidget::searchPushButtonClicked() {
- qDebug()<<"test6";
#ifdef Q_WS_MAEMO_5
if(busy) {
Q_EMIT stopSearching();
}
void SearchBarWidget::searchDelay(QString word) {
- qDebug()<<"test8";
if(!busy && !word.isEmpty()) {
#ifndef Q_WS_MAEMO_5
emit setLineEditText(word);
}
void SearchBarWidget::delaySearchTimeout() {
- qDebug()<<"test9";
delayTimer.stop();
if(!busy) {
Q_EMIT searchForTranslations(delayString);
}
void SearchBarWidget::setEnabled(bool enabled) {
- qDebug()<<"test10";
#ifndef Q_WS_MAEMO_5
emit setLineEditEnables(enabled);
if(!enabled) {
- qDebug()<<"tu???";
emit setEnableHistoryNext(false);
emit setEnableHistoryShow(false);
emit setEnableHistoryPrev(false);
historyShowToolButton->setEnabled(false);
}
#endif
-qDebug()<<"tu2???";
}
void SearchBarWidget::setBusy() {
- qDebug()<<"test11";
if(busy) return;
#ifndef Q_WS_MAEMO_5
}
void SearchBarWidget::updateBusyTimer(){
- qDebug()<<"test12";
if(progressMax==true){
emit progresSetValue2(0);
progressMax=false;
}
void SearchBarWidget::setIdle() {
- qDebug()<<"test13";
if(!busy) return;
#ifndef Q_WS_MAEMO_5
progressBar->hide();
void SearchBarWidget::clearSearchWordToolButtonClicked() {
- qDebug()<<"test14";
#ifdef Q_WS_MAEMO_5
searchWordLineEdit->clear();
#endif
void SearchBarWidget::updateHistoryButtons(bool prev, bool next, bool list) {
- qDebug()<<"test15";
if(!busy) {
#ifndef Q_WS_MAEMO_5
emit setEnableHistoryNext(next);
}
void SearchBarWidget::showHistoryButtonClicked() {
- qDebug()<<"test16";
#ifndef Q_WS_MAEMO_5
QPoint p=view->pos(); // = historyShowToolButton->pos();
p=mapToGlobal(p);
model: dictModel
}
- //buttons
Item {
id: buttonsBox
SystemPalette { id: myPalette; colorGroup: SystemPalette.Active }
color : myPalette.window;
-
Text {
id: textInfo
text: "Tekst: "
import Qt 4.7
Rectangle {
+ id: rectangle1
+ color: myPalette.base
+ anchors.fill: parent
function changeWordState(nr, state) {
wordList.currentIndex = nr
function setEnabled(Boolean) { wordList.enabled = Boolean } // slot
signal wordSelected(string word);
-
+ signal checkFocus();
SystemPalette { id: myPalette; colorGroup: SystemPalette.Active }
- id: rectangle1
- color: myPalette.base
- anchors.fill: parent
-
ElementsListView{
id: wordList
width: rectangle1.width
delegate: Component{
id: wordListDelegate
Item {
+ onActiveFocusChanged: rectangle1.checkFocus();
+
width: rectangle1.width
height: {
if (wordText.height + 4 > check.height)
else
return check.height;
}
-
MouseArea{
anchors.fill: parent
- onClicked: {
+ onClicked: wordList.currentIndex = number
+ onDoubleClicked: {
wordList.currentIndex = number
rectangle1.wordSelected(word)
}
}
}
}
-
}
-
}
model: wordModel
}
+
+ states: [
+ State {
+ name: "noFocus";
+ when: ((!wordList.focus) && (!rectangle1.focus))
+ PropertyChanges { target: wordList.highlightItem; opacity:0}
+ }
+ ]
}
Text {
id: textInfo
width: rectangle1.width
- height: paintedHeight+5;
+ height: (paintedHeight+5)>150?150:paintedHeight+5;
text: ": "
wrapMode: Text.Wrap;
anchors.top: textDescription.bottom
font.pixelSize: 12
}
+
+ Rectangle {
+ anchors.right: parent.right
+ anchors.left: parent.left
+ anchors.bottom: saveButton.bottom
+ anchors.top: optimalizeCheckbox.top
+
+ id: rectangle2
+ color: myPalette.window
+ anchors.topMargin: -2
+ }
+
Checkbox {
id: optimalizeCheckbox
width: 20
height: 20
+ anchors.bottom: stripCheckbox.top
+ anchors.bottomMargin: 5
anchors.left: parent.left
anchors.leftMargin: 5
- anchors.top: textInfo.bottom
onChanged: rectangle1.optimalizeCheckboxChanged(selected);
}
id: stripCheckbox
width: 20
height: 20
- anchors.top: optimalizeCheckbox.bottom
- anchors.topMargin: 5
+ anchors.bottom: saveButton.top
+ anchors.bottomMargin: 15
anchors.horizontalCenter: optimalizeCheckbox.horizontalCenter
onChanged: rectangle1.stripCheckboxChanged(selected);
}
Button {
id: saveButton
height: 30
+ anchors.bottom: parent.bottom
textInButton: qsTr("Save")
- anchors.top: stripCheckbox.bottom
- anchors.topMargin: 10
anchors.right: parent.right
anchors.left: parent.left
onClicked: rectangle1.saveButtonClicked();
onClicked: rectangle1.downloadButtonClicked();
}
+
states: [
State {
name: "Stan1"
XdxfDictDownloadProgressDialog::XdxfDictDownloadProgressDialog(QWidget*parent):
QDialog(parent) {
-qDebug()<<"etap 01";
#ifndef Q_WS_MAEMO_5
view= new QDeclarativeView();
view->setSource(QUrl::fromLocalFile("/usr/share/mdictionary/qml/XdxfDictDownloader.qml"));
void XdxfDictDownloadProgressDialog::show() {
-qDebug()<<"etap 02";
#ifndef Q_WS_MAEMO_5
emit setMaximumValue(0);
maximumValue=0;
void XdxfDictDownloadProgressDialog::setText(QString text) {
-qDebug()<<"etap 03";
-
#ifndef Q_WS_MAEMO_5
emit setTextt(text);
#else
void XdxfDictDownloadProgressDialog::reject() {
-qDebug()<<"etap 05";
#ifndef Q_WS_MAEMO_5
Q_EMIT cancelDownloading();
#else