我正在开发一个GUI,我已经想出了如何创建一个closeEvent()
,当用户按下Windows X关闭窗口时调用该closeEvent()
。但是,当倒数计时器到期时我会调用同一个this->close()
并调用closeEvent()
。有没有办法让this->close()
检测关闭是来自用户单击Windows X还是代码调用<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
tools:layout_editor_absoluteX="0"
tools:layout_editor_absoluteY="0">
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scrollView1"
android:layout_width="50dp"
android:layout_height="fill_parent"
android:background="#477046">
<TextView
android:id="@+id/txtViewLeft"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:textSize="18dp"
android:text="A1" />
</ScrollView>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scrollView2"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#468490"
android:layout_toRightOf="@id/scrollView1">
<TextView
android:id="@+id/txtViewRight"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:textSize="18dp"
android:text="This is some sample text that I have added. Thank you for helping" />
</ScrollView>
</RelativeLayout>
函数?
由于