Qt-interest Archive, June 2007
Problem with QTabdialog
Pages: Prev | 1 | 2 | Next
Message 1 in thread
Hi,
I am getting problem with QTabDialog.
I have a dialog called sample dialog inherited from QTabDialog.
The dialog has 6 tabs. Each tab has 20 controls like QLineEdit, QComboBox,
and QLabel..........
The problem is when I try to open the dialog repeatedly like open-close,
open-close................after opening 'n' number of times(20 to 30) times
continuously have missed some controls in my dialog and the system is
getting freezed.
I am not sure why this is happening.
Could you please help me on this?
Thanks in Advance.........
Padmaja.
Message 2 in thread
Hi,
> The problem is when I try to open the dialog repeatedly like open-close,
> open-close................after opening 'n' number of times(20 to 30)
> times continuously have missed some controls in my dialog and the system
> is getting freezed.
Could you maybe expand on "the system is getting freezed"?
Which version of Qt are you using? Which OS?
Do you have a minimal, compilable example that reproduces the problem?
Maybe you're allocating too much memory somewhere and not relaing it? In which
case the system might be swapping.
--
[ signature omitted ]
Message 3 in thread
Hi,
I am using QT 3.3.5 on Windows XP OS with 512 RAM.
I am unable to open the dialog or perform any operation if I open-close for
'n' (>100) times. I have to restart the system.
The sample code:
NewDialog::NewDialog( QWidget *parent, const char *name, const QString
&_filename )
: QTabDialog( parent, name ), filename( _filename ), fileinfo( filename
) {
setupTab1();
setupTab2();
setupTab3();
connect( this, SIGNAL( applyButtonPressed() ), qApp, SLOT( quit() ) ); }
void NewDialog::setupTab1()
{
QVBox *tab1 = new QVBox( this );
tab1->setMargin( 5 );
(void)new QLabel( "Filename:", tab1 );
QLineEdit *fname = new QLineEdit( filename, tab1 );
fname->setFocus();
(void)new QLabel( "Filename1:", tab1 );
QLineEdit *fname1 = new QLineEdit( filename, tab1 );
(void)new QLabel( "Filename2:", tab1 );
QLineEdit *fname2 = new QLineEdit( filename, tab1 );
(void)new QLabel( "Filename3:", tab1 );
QLineEdit *fname3 = new QLineEdit( filename, tab1 );
(void)new QLabel( "Filename4:", tab1 );
QLineEdit *fname4 = new QLineEdit( filename, tab1 );
(void)new QLabel( "Filename5:", tab1 );
QLineEdit *fname5 = new QLineEdit( filename, tab1 );
(void)new QLabel( "Filename5:", tab1 );
QComboBox *fname6 = new QComboBox( filename, tab1 );
(void)new QLabel( "Path:", tab1 );
QLabel *path = new QLabel( fileinfo.dirPath( TRUE ), tab1 );
path->setFrameStyle( QFrame::Panel | QFrame::Sunken );
(void)new QLabel( "Size:", tab1 );
ulong kb = (ulong)(fileinfo.size()/1024);
QLabel *size = new QLabel( QString( "%1 KB" ).arg( kb ), tab1 );
size->setFrameStyle( QFrame::Panel | QFrame::Sunken );
(void)new QLabel( "Last Read:", tab1 );
QLabel *lread = new QLabel( fileinfo.lastRead().toString(), tab1 );
lread->setFrameStyle( QFrame::Panel | QFrame::Sunken );
(void)new QLabel( "Last Modified:", tab1 );
QLabel *lmodif = new QLabel( fileinfo.lastModified().toString(), tab1 );
lmodif->setFrameStyle( QFrame::Panel | QFrame::Sunken );
addTab( tab1, "General" );
}
void NewDialog::setupTab2()
{
QVBox *tab2 = new QVBox( this );
tab2->setMargin( 5 );
QButtonGroup *bg = new QButtonGroup( 1, QGroupBox::Horizontal,
"Permissions", tab2 );
QCheckBox *readable = new QCheckBox( "Readable", bg );
if ( fileinfo.isReadable() )
readable->setChecked( TRUE );
QCheckBox *writable = new QCheckBox( "Writeable", bg );
if ( fileinfo.isWritable() )
writable->setChecked( TRUE );
QCheckBox *executable = new QCheckBox( "Executable", bg );
if ( fileinfo.isExecutable() )
executable->setChecked( TRUE );
QButtonGroup *bg2 = new QButtonGroup( 2, QGroupBox::Horizontal, "Owner",
tab2 );
(void)new QLabel( "Owner", bg2 );
QLabel *owner = new QLabel( fileinfo.owner(), bg2 );
owner->setFrameStyle( QFrame::Panel | QFrame::Sunken );
(void)new QLabel( "Group", bg2 );
QLabel *group = new QLabel( fileinfo.group(), bg2 );
group->setFrameStyle( QFrame::Panel | QFrame::Sunken );
addTab( tab2, "Permissions" );
}
void NewDialog::setupTab3()
{
QVBox *tab3 = new QVBox( this );
tab3->setMargin( 5 );
tab3->setSpacing( 5 );
(void)new QLabel( QString( "Open %1 with:" ).arg( filename ), tab3 );
QListBox *prgs = new QListBox( tab3 );
for ( unsigned int i = 0; i < 30; i++ ) {
QString prg = QString( "Application %1" ).arg( i );
prgs->insertItem( prg );
}
prgs->setCurrentItem( 3 );
(void)new QCheckBox( QString( "Open files with the extension '%1' always
with this application" ).arg( fileinfo.extension() ), tab3 );
addTab( tab3, "Applications" );
}
And main:
#include "newdialog.h"
#include <qapplication.h>
#include <qstring.h>
int main( int argc, char **argv )
{
QApplication a( argc, argv );
NewDialog tabdialog( 0, "tabdialog", QString( argc < 2 ? "." : argv[1] )
);
tabdialog.resize( 450, 350 );
tabdialog.setCaption( "Qt Example - Tabbed Dialog" );
a.setMainWidget( &tabdialog );
tabdialog.exec();
return a.exec();
}
Thanks & Regards,
Padmaja S
-----Original Message-----
From: Dimitri [mailto:dimitri@xxxxxxxxxxxxx]
Sent: Wednesday, June 27, 2007 12:29 PM
To: qt-interest@xxxxxxxxxxxxx
Subject: Re: Problem with QTabdialog
Hi,
> The problem is when I try to open the dialog repeatedly like open-close,
> open-close................after opening 'n' number of times(20 to 30)
> times continuously have missed some controls in my dialog and the system
> is getting freezed.
Could you maybe expand on "the system is getting freezed"?
Which version of Qt are you using? Which OS?
Do you have a minimal, compilable example that reproduces the problem?
Maybe you're allocating too much memory somewhere and not relaing it? In
which
case the system might be swapping.
--
[ signature omitted ]
Message 4 in thread
Hi,
> I am using QT 3.3.5 on Windows XP OS with 512 RAM.
> I am unable to open the dialog or perform any operation if I open-close for
> 'n' (>100) times. I have to restart the system.
>
> The sample code:
> [...]
The newdialog.h file is missing. I would suggest simplifying your code first,
before posting it. I guess all the style setting and teh QFileInfo stuff is
not need to reproduce the bug?
--
[ signature omitted ]
Message 5 in thread
Hi,
> The newdialog.h file is missing. I would suggest simplifying your code
> first, before posting it. I guess all the style setting and teh
> QFileInfo stuff is not need to reproduce the bug?
Also, I understand how you close the dialog, but how do you reopen it?
--
[ signature omitted ]
Message 6 in thread
I am reopening it by clicking on the application's exe file.
Thanks & Regards,
Padmaja S
-----Original Message-----
From: Dimitri [mailto:dimitri@xxxxxxxxxxxxx]
Sent: Wednesday, June 27, 2007 12:44 PM
To: qt-interest@xxxxxxxxxxxxx
Subject: Re: Problem with QTabdialog
Hi,
> The newdialog.h file is missing. I would suggest simplifying your code
> first, before posting it. I guess all the style setting and teh
> QFileInfo stuff is not need to reproduce the bug?
Also, I understand how you close the dialog, but how do you reopen it?
--
[ signature omitted ]
Message 7 in thread
Hi,
> I am reopening it by clicking on the application's exe file.
OK, then you're restarting the whole application, not merely opening a
QTabDialog within the application.
Has the previous instance of your application been stopped?
--
[ signature omitted ]
Message 8 in thread
It will not be stopped until and unless I click on 'X' or click on 'OK'.
Thanks & Regards,
Padmaja S
-----Original Message-----
From: Dimitri [mailto:dimitri@xxxxxxxxxxxxx]
Sent: Wednesday, June 27, 2007 12:49 PM
To: qt-interest@xxxxxxxxxxxxx
Subject: Re: Problem with QTabdialog
Hi,
> I am reopening it by clicking on the application's exe file.
OK, then you're restarting the whole application, not merely opening a
QTabDialog within the application.
Has the previous instance of your application been stopped?
--
[ signature omitted ]
Message 9 in thread
Hi,
> It will not be stopped until and unless I click on 'X' or click on 'OK'.
The above just closes a window. It doesn't necessarily close the application.
Have a look at:
http://doc.trolltech.com/4.3/qapplication.html#setMainWidget
Make sure you exit your application!
--
[ signature omitted ]
Message 10 in thread
But in my application which I am not working on I should not exit the
application every time I close the dialog. Opening the dialog is a part of
application.
Thanks & Regards,
Padmaja S
-----Original Message-----
From: Dimitri [mailto:dimitri@xxxxxxxxxxxxx]
Sent: Wednesday, June 27, 2007 12:58 PM
To: qt-interest@xxxxxxxxxxxxx
Subject: Re: Problem with QTabdialog
Hi,
> It will not be stopped until and unless I click on 'X' or click on 'OK'.
The above just closes a window. It doesn't necessarily close the
application.
Have a look at:
http://doc.trolltech.com/4.3/qapplication.html#setMainWidget
Make sure you exit your application!
--
[ signature omitted ]
Message 11 in thread
So.. why do you reopen the dialog by clicking on the application's exe
file then? You should reopen the dialog programmatically.
Current situation if I'm not mistaken
1) Start of process
2) Widget shows up
3) Widget closes but process is still active
4) Continue with step 1
Do you see the problem? :-) You have hundreds of active processes...
Padmaja S schrieb:
> But in my application which I am not working on I should not exit the
> application every time I close the dialog. Opening the dialog is a part of
> application.
>
> Thanks & Regards,
> Padmaja S
>
> -----Original Message-----
> From: Dimitri [mailto:dimitri@xxxxxxxxxxxxx]
> Sent: Wednesday, June 27, 2007 12:58 PM
> To: qt-interest@xxxxxxxxxxxxx
> Subject: Re: Problem with QTabdialog
>
> Hi,
>
>> It will not be stopped until and unless I click on 'X' or click on 'OK'.
>
> The above just closes a window. It doesn't necessarily close the
> application.
> Have a look at:
> http://doc.trolltech.com/4.3/qapplication.html#setMainWidget
>
> Make sure you exit your application!
>
> --
> Dimitri
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
--
[ signature omitted ]
Message 12 in thread
Yes you are right......
In my real application I am creating the instance and deleting it like:
MyDialog *dlg = new MyDialog(...)
Dlg->exec();
Delete dlg;
But still my system is getting hanged.
Please help me.
Thanks & Regards,
Padmaja S
-----Original Message-----
From: Niklas Hofmann [mailto:n.hofmann@xxxxxxxxxxxxxxxxxxxxxxxxxxx]
Sent: Wednesday, June 27, 2007 6:20 PM
To: qt-interest@xxxxxxxxxxxxx
Subject: Re: Problem with QTabdialog
So.. why do you reopen the dialog by clicking on the application's exe
file then? You should reopen the dialog programmatically.
Current situation if I'm not mistaken
1) Start of process
2) Widget shows up
3) Widget closes but process is still active
4) Continue with step 1
Do you see the problem? :-) You have hundreds of active processes...
Padmaja S schrieb:
> But in my application which I am not working on I should not exit the
> application every time I close the dialog. Opening the dialog is a part of
> application.
>
> Thanks & Regards,
> Padmaja S
>
> -----Original Message-----
> From: Dimitri [mailto:dimitri@xxxxxxxxxxxxx]
> Sent: Wednesday, June 27, 2007 12:58 PM
> To: qt-interest@xxxxxxxxxxxxx
> Subject: Re: Problem with QTabdialog
>
> Hi,
>
>> It will not be stopped until and unless I click on 'X' or click on 'OK'.
>
> The above just closes a window. It doesn't necessarily close the
> application.
> Have a look at:
> http://doc.trolltech.com/4.3/qapplication.html#setMainWidget
>
> Make sure you exit your application!
>
> --
> Dimitri
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
"unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
--
[ signature omitted ]
Message 13 in thread
On 27.06.07 18:24:41, Padmaja S wrote:
> Yes you are right......
> In my real application I am creating the instance and deleting it like:
> MyDialog *dlg = new MyDialog(...)
> Dlg->exec();
> Delete dlg;
>
> But still my system is getting hanged.
Strip down your application to a minimal compilable example and post it
here.
Andreas
--
[ signature omitted ]
Message 14 in thread
Hi,
>> I am reopening it by clicking on the application's exe file.
>
> OK, then you're restarting the whole application, not merely opening a
> QTabDialog within the application.
>
> Has the previous instance of your application been stopped?
If the previous instance of your application has not been stopped, then you're
simply trying to run hundreds applications on your PC. This cannot work, and
is not related to Qt.
--
[ signature omitted ]
Message 15 in thread
Hi,
looks like one of my old .pro file broke in 4.3.0.
CONFIG+=database
CONFIG(database){
message(Building database support)
}
--> Unknown test function: CONFIG
I am sure it once worked and according to the 4.3.0 qmake docs it still should.
What is the correct syntax now?
Guido
--
[ signature omitted ]
Pages: Prev | 1 | 2 | Next