S
S
sig2011-10-08 13:06:14
Startups
sig, 2011-10-08 13:06:14

Framework Qt 4.7 Display issues when migrating a project from Windows to Mac OS

The question is actually trivial and I sincerely hope that the answer will follow soon.

There is a working project on Win7x64, fully working (in every sense, and most importantly - regarding the display of graphic objects). The project was made without the use of forms (everything was written with pens).

When transferring this to Mac OS X 10.6.8, for no reason, neither buttons, nor windows, nor text-edits are displayed. The only thing that is displayed is the tables, which, by the way, are "attached" to the same layers as the above objects.

The project builds without errors.

For the sake of interest, I created a project using forms, so everything works there with a bang (both buttons and text-edits).

Tell me, what's the problem?

Answer the question

In order to leave comments, you need to log in

6 answer(s)
Z
Zeldan, 2011-10-09
@Zeldan

Go through this list first, Qt for Mac OS X - Specific Issues
Quote:
"Mac OS X handles most applications as 'bundles'. A bundle is a directory structure that groups related files together (eg, widgets.app/). GUI applications in particular must be run from a bundle or by using the open(1), because Mac OS X needs the bundle to dispatch events correctly, as well as for accessing the menu bar."
Translation:
"MacOs X handles applications as a 'bundle'. "Bundle" is a directory structure that combines files (widgets, etc.). GUI applications usually need to be launched from a bundle or using open(1) because MacOs X requires a "bundle" to properly handle events such as menu bar access"
etc.
If all the features have been taken into account, then details are needed, because there may be separate patches for your problem.

P
Paul, 2011-10-09
@Paul

I correctly understood that lTable is your Q3Table? If this is the case, then it may be due to inadequate qt3support on a poppy, although I'm not sure.
You don't see the code yet where you stack lTable, iTalbe and lCode in lMainLayout.

S
sig, 2011-10-09
@sig

Now I tried to create a project from scratch. All the same files, copied the contents. The result is the same.
Then I decided that the problem was in the implicit indication of the connected libraries - I rewrote it in <QtGui / QPushButton>, etc. 20 lines. The result is the same.
There is no way out, but either you have to transfer the project to ui-forms, or put windows on vm virtualbox.
Neither is encouraging, given the 4 hours spent reinstalling Mac OS X from 10.5 to 10.6.8 at the request of the Qt 4.7 package.

V
vooft, 2011-10-09
@vooft

Just missed the most interesting thing - how you form the layout, obviously, this is the problem.
When a widget is added to the layout, the first one becomes the parent of the second one. Therefore, if at some point your mainWindow is deleted, then the layout is also deleted, which already demolishes all the widgets on it. And the devil knows what happens to lTable objects and the like.

S
sig, 2011-10-09
@sig


// Слои главного окна
       // Тут 4 описания пропустил. Основной слой - ниже.
        QVBoxLayout *mainLayout = new QVBoxLayout;
        mainLayout->addLayout(topLayout);
        mainLayout->addLayout(afterTopLayout1);
        mainLayout->addWidget(&code);
        mainLayout->addLayout(buttomLayout);

// Слои окна лексического анализатора
        QHBoxLayout *lHeaderLayout = new QHBoxLayout;
        lHeaderLayout->addWidget(&lCode);
        lHeaderLayout->addWidget(&lTable);
        lHeaderLayout->addWidget(&iTable);

        QVBoxLayout *lMainLayout = new QVBoxLayout;
        lMainLayout->addWidget(lHeader);
        lMainLayout->addLayout(lHeaderLayout);

Then there is the addition of layers to their windows, respectively.

V
vooft, 2011-10-09
@vooft

In principle, you can look at the generated ui_*.h file and find the difference :)
There, everything is done through new and parent is indicated.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question