Reply
Thread Tools
Posts: 180 | Thanked: 76 times | Joined on May 2010
#151
 
CepiPerez's Avatar
Posts: 1,023 | Thanked: 4,421 times | Joined on Feb 2010 @ Argentina
#152
So you want to revert to original value in the text lenght is < 7 ?
You can use focusInEvent to save the original text in a qstring and focusOutEvent to revert.
 

The Following User Says Thank You to CepiPerez For This Useful Post:
d-iivil's Avatar
Posts: 2,154 | Thanked: 2,186 times | Joined on Dec 2009 @ Hellsinki, Finland
#153
Originally Posted by nicolai View Post
Is the behavrio different, if you use setInputMask instead
of a validator?

http://doc.trolltech.com/4.7/qlineed...inputMask-prop

ui->line_edit_font1->setInputMask("\#NNNNNN");

regards
Nicolai
Then I can't input anything since it wants me to input all seven digits at the same time (copy paste works, but I can't type the digits one by one).
__________________
If you're rich and you think I deserve a cold beer, you may donate one or two :-P

80's style stadium rock is back - FIRENOTE
Hi-Octane heavy metal - FORCE MAJEURE
 
nicolai's Avatar
Posts: 1,637 | Thanked: 4,424 times | Joined on Apr 2009 @ Germany
#154
That is strange, btw my example was wrong. The format
for Hex-Digits is "HHHHHH". I am pretty sure this should work.
But I can not try it out at the moment. Can you try again with the
format:
ui->line_edit_font1->setInputMask("HHHHHH");
 

The Following User Says Thank You to nicolai For This Useful Post:
d-iivil's Avatar
Posts: 2,154 | Thanked: 2,186 times | Joined on Dec 2009 @ Hellsinki, Finland
#155
Originally Posted by nicolai View Post
That is strange, btw my example was wrong. The format
for Hex-Digits is "HHHHHH". I am pretty sure this should work.
But I can not try it out at the moment. Can you try again with the
format:
ui->line_edit_font1->setInputMask("HHHHHH");
Thanks! Will test it out tomorrow Didn't know there was an input mask for hexes already existing
__________________
If you're rich and you think I deserve a cold beer, you may donate one or two :-P

80's style stadium rock is back - FIRENOTE
Hi-Octane heavy metal - FORCE MAJEURE
 
d-iivil's Avatar
Posts: 2,154 | Thanked: 2,186 times | Joined on Dec 2009 @ Hellsinki, Finland
#156
Originally Posted by CepiPerez View Post
So you want to revert to original value in the text lenght is < 7 ?
You can use focusInEvent to save the original text in a qstring and focusOutEvent to revert.
I can't see such signals in Qt Creator when I right click the lineEdit and select "Go to slot...".
__________________
If you're rich and you think I deserve a cold beer, you may donate one or two :-P

80's style stadium rock is back - FIRENOTE
Hi-Octane heavy metal - FORCE MAJEURE
 
Posts: 16 | Thanked: 18 times | Joined on Sep 2010
#157
They aren't signals. They are virtual methods. You have to reimplement those methods to use them.
 
Posts: 180 | Thanked: 76 times | Joined on May 2010
#158
I don't know how you can use this in Qt Designer, but you can use those methods like this:

mylineedit.h
PHP Code:
#ifndef MYLINEEDIT_H
#define MYLINEEDIT_H

#include <QLineEdit>

class MyLineEdit : public QLineEdit
{
    
Q_OBJECT
public:
    
MyLineEdit(QWidget *parent 0);

protected:
    
void focusOutEvent(QFocusEvent *event);
    
void focusInEvent(QFocusEvent *event);

};

#endif // MYLINEEDIT_H 
mylineedit.cpp
PHP Code:
#include "mylineedit.h"

MyLineEdit::MyLineEdit(QWidget *parent) :
    
QLineEdit(parent)
{
}

void MyLineEdit::focusInEvent(QFocusEvent *event)
{
    
//Save text from line edit
}

void MyLineEdit::focusOutEvent(QFocusEvent *event)
{
    
//Restore text if it is not valid

 

The Following User Says Thank You to Diph For This Useful Post:
Berserk's Avatar
Posts: 199 | Thanked: 156 times | Joined on May 2010 @ Holland
#159
Sorry for changing the subject, but the GConfItem problem still remains for both D-Livil and me..



Originally Posted by Diph View Post
Install lib in scratchbox armel target and make links of gconf lib and include files under usr and place them in NokiaQtSDK Maemo usr/lib and usr/include.
I use WinXP, and I'm afraid I can't install libs using Madde, or is it possible?

I've downloaded libgq-gconf-dev_0.2-3+0m5_armel.deb from the package page,
Then I unpacked everything into:
E:\NokiaQtSDK\Maemo\4.6.2\sysroots\fremantle-arm-sysroot-1030-slim\usr
and added your suggestion to src.pro:
Originally Posted by Diph View Post
Code:
CONFIG += link_pkgconfig
PKGCONFIG += gq-gconf
But I still can't include GConfItem..
Copying doesn't seem like the right way to do it, but I'm clueless.

==================================================

I did manage to include GConfItem by putting these files in my project, but those files also had their own includes, and it seemed endless to me.
It wouldn't build because I don't have those headers.

Another thing.. I see "#include <gconf/gconf.h>" here and there, but in my setup it's "#include <gconf/2/gconf/gconf.h>". I didn't change anything manually, just a straightforward Nokia Qt SDK install.
The #include lines in those headers point to <gconf/....h>, so that's a dead end.


I hope I don't bother anyone too much about this, but any help would be great
__________________
Wallpaeper - Desktop background manager (in Extras!)
Config Reader - Export all Gconf to an HTML file + compare feature (Extras-testing)
Even though these programs are available for free, I would appreciate any donations

Last edited by Berserk; 2010-10-01 at 22:22.
 
Berserk's Avatar
Posts: 199 | Thanked: 156 times | Joined on May 2010 @ Holland
#160
Well.. I think it's solved

Use system("command");
But be careful with system commands

For instance, when you use
Code:
system("gconftool-2 -R /apps/osso/hildon-desktop/views");
It outputs this:
Code:
 current = 1
 active = [1,2,3,4]
 /apps/osso/hildon-desktop/views/1:
  bg-image = /home/user/MyDocs/.images/abstract1_01.jpg
 /apps/osso/hildon-desktop/views/2:
  bg-image = /home/user/MyDocs/.images/abstract1_02.jpg
 /apps/osso/hildon-desktop/views/3:
  bg-image = /home/user/MyDocs/.images/abstract1_03.jpg
 /apps/osso/hildon-desktop/views/4:
  bg-image = /home/user/MyDocs/.images/abstract1_04.jpg
I'll write how to catch that output in a QString tomorrow, time for some sleep first..


I've been able to set backgrounds with the following:
Code:
system('gconftool -s /apps/osso/hildon-desktop/views/1/bg-image -t string "/home/user/MyDocs/.images/abstract1_01.jpg"');
(For every desktop)
__________________
Wallpaeper - Desktop background manager (in Extras!)
Config Reader - Export all Gconf to an HTML file + compare feature (Extras-testing)
Even though these programs are available for free, I would appreciate any donations

Last edited by Berserk; 2010-10-02 at 01:27.
 

The Following User Says Thank You to Berserk For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 13:27.