I had the same problem (on other platforms as well). I fixed it by using a Flickable for my display object, and modifying the contentY property when I displayed the keyboard:
flickable.contentY = Math.max(0, (yValue + (height / 2)) - ((flickable.height - inputPanelPopup.height) / 2))
You'll probably need to modify the algorithm for your application, but the idea should work.
The missing identity file warning says that the local ssh client can't find credentials to log into the i.MX6.
The connection to the debugee isn't established, so the debugging process aborts.
The ssh connection to the remote system needs to be fixed.
Although this is a very old question I think it's worth to mention this (I searched 3+ days to find a solution).
In Qt 6.8 if you set this environment variable it causes the Accessibility manager in QtAccessibilityDelegate.java to completely disable itself:
qputenv("QT_ANDROID_DISABLE_ACCESSIBILITY", "1");
Hi @jsulm thanks for answering...
the only shortcut i have for qt environment is Qt 6.6.3 MinGW (11.2.0) 64 bits... i tried with it.. but still cant build for Android... i think it should be somewhere or somehow the same shortcut but for ARM and Intel Kits for Android.... that could have more sense...
@Prabhakaran said in need help on build for android:
give me any sample codes for android
What sample code do you need?
Also take a look at:
https://doc.qt.io/qt-6/android-getting-started.html
https://doc.qt.io/qt-6/android.html
SOLVED: I had to type this command:
sudo chmod $USER:$USER $ANDROID_SDK_ROOT
I hope this will help unfortunate people like me, who couldn't figure this out for days or even months.
Here is the same code using appDataLocation
void DatabaseManager::OpenConnection() {
// Configure the database connection parameters for SQLite
m_db = QSqlDatabase::addDatabase("QSQLITE");
// Use QStandardPaths to get the application data location
QString dbName = "identifier.sqlite";
QString dbLocation = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
QString fullDbPath = dbLocation + "/" + dbName;
QDir dbDir(dbLocation);
if (!dbDir.exists()) {
if (dbDir.mkpath(dbLocation)) {
qDebug() << "Created application data directory:" << dbLocation;
} else {
qDebug() << "Failed to create application data directory:" << dbLocation;
return; // Exit if the directory cannot be created
}
}
// Set the SQLite database file location
m_db.setDatabaseName(fullDbPath);
// Check if the database file exists in the application data location
if (!QFile::exists(fullDbPath)) {
qDebug() << "Database does not exist in AppDataLocation, copying from resources.";
// Path to the resource database file
QString resourceDbPath = ":/resources/identifier.sqlite"; // Adjust the path to your resource file
// Attempt to copy the database from resources to the writable location
if (QFile::copy(resourceDbPath, fullDbPath)) {
qDebug() << "Database copied successfully to AppDataLocation.";
// Set file permissions to writable (necessary for some platforms)
QFile::setPermissions(fullDbPath, QFileDevice::ReadOwner | QFileDevice::WriteOwner);
} else {
qDebug() << "Failed to copy database from resources.";
return; // Exit if the database cannot be copied
}
}
// Open the database connection and handle success or failure
if (m_db.open()) {
qDebug() << "Database opened successfully.";
// Sample query to verify the database contents
} else {
// Handle connection error
qDebug() << "Database failed to open.";
qDebug() << m_db.lastError().text();
}
}
My workaround for the time being is as follows:
Construct the Java class when the related C++ class is constructed
Set Activity for the class
Call static methods like before
Java:
private static Activity m_activity = null;
public void setActivity(Activity activity) {
m_activity = activity;
return;
}
also change all methods that previously called QtNative.activity() to now check for and use m_activity instead.
C++:
mJNIInstance = QJniObject("the/qualified/ClassPath");
if (mJNIInstance.isValid()) {
mJNIInstance.callMethod<void>("setActivity", "(Landroid/app/Activity;)V", QNativeInterface::QAndroidApplication::context().object());
} else {
// output a warning or error
}
Hi, jsulm,
Thanks for your reply.
Yeap, I want the app to always stay on top.
Because the Android system have a Activate Window always on the top of the screen.
My program app must be in front of the Activate Window. And I must.
I implemented a demo in Android Studio by using TYPE_SYSTEM_ALERT to on the top.
But my full program is implemented using Qt.
Need your advice.
Daniel
Hi, AnQuter,
Is your question solved?
// setContentView(R.layout.dream); - how to use Qt app layout?
How can I load Qt mainwindow.ui in java code?
Thanks a lot.
Hi and welcome to devnet,
From the looks of it, no there's nothing directly in Qt for that.
You should take a look at the bug report system to see if there's something related to that.